From: <z-...@us...> - 2009-02-12 12:38:24
|
Revision: 8954 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8954&view=rev Author: z-man Date: 2009-02-12 12:38:21 +0000 (Thu, 12 Feb 2009) Log Message: ----------- Merging branch 0.2.8 from revision 8940 to 8953: ------------------------------------------------------------------------ r8953 | bazaarmagetron | 2009-02-12 12:39:50 +0100 (Thu, 12 Feb 2009) | 2 lines Manuel Moos: properly saving and restoring CFLAGS for ZThread test. ------------------------------------------------------------------------ r8952 | bazaarmagetron | 2009-02-09 03:25:34 +0100 (Mon, 09 Feb 2009) | 2 lines Daniel Lee Harple: Using the custom connect menu after browsing a server subculture didn't work. ------------------------------------------------------------------------ r8951 | bazaarmagetron | 2009-02-09 01:04:31 +0100 (Mon, 09 Feb 2009) | 2 lines Manuel Moos: Better alignment for more than 9 players. ------------------------------------------------------------------------ r8950 | bazaarmagetron | 2009-02-09 00:56:56 +0100 (Mon, 09 Feb 2009) | 4 lines author: Manuel Moos Implemented team ID printing for /team output for ease of /shuffling. Implemented /myteam to only get your own team layout. ------------------------------------------------------------------------ r8949 | bazaarmagetron | 2009-02-08 04:47:28 +0100 (Sun, 08 Feb 2009) | 2 lines Daniel Lee Harple: Removed debug output. ------------------------------------------------------------------------ r8946 | bazaarmagetron | 2009-02-04 20:57:03 +0100 (Wed, 04 Feb 2009) | 4 lines author: epsy Changed se_DeOp to not use se_ChangeAccess. Moved stuff from se_ChangeAccess to se_CanChangeAccess. Removed references to /promote. ------------------------------------------------------------------------ r8945 | bazaarmagetron | 2009-02-04 20:55:24 +0100 (Wed, 04 Feb 2009) | 1 line epsy: Fixed spectators not seeing their own team messages when invited ------------------------------------------------------------------------ Revision Links: -------------- http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8940&view=rev Modified Paths: -------------- armagetronad/trunk/armagetronad/acinclude.m4 armagetronad/trunk/armagetronad/language/english_base.txt armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp armagetronad/trunk/armagetronad/src/tron/gServerFavorites.cpp Property Changed: ---------------- armagetronad/trunk/ Property changes on: armagetronad/trunk ___________________________________________________________________ Modified: svn:mergeinfo - /armagetronad/branches/0.2.8:8751-8852,8855-8940 + /armagetronad/branches/0.2.8:8751-8852,8855-8953 Modified: armagetronad/trunk/armagetronad/acinclude.m4 =================================================================== --- armagetronad/trunk/armagetronad/acinclude.m4 2009-02-12 11:39:50 UTC (rev 8953) +++ armagetronad/trunk/armagetronad/acinclude.m4 2009-02-12 12:38:21 UTC (rev 8954) @@ -763,7 +763,7 @@ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_zthreadtest" = "xyes" ; then ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_CFLAGS="$CXXFLAGS" + ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CXXFLAGS="$CXXFLAGS $ZTHREAD_CXXFLAGS" CFLAGS="$CFLAGS $ZTHREAD_CXXFLAGS" @@ -887,7 +887,7 @@ echo "*** may want to edit the zthread-config script: $ZTHREAD_CONFIG" ]) CC=${CC_OLD} - CFLAGS="$ac_save_CXXFLAGS" + CFLAGS="$ac_save_CFLAGS" CXXFLAGS="$ac_save_CXXFLAGS" LIBS="$ac_save_LIBS" fi Modified: armagetronad/trunk/armagetronad/language/english_base.txt =================================================================== --- armagetronad/trunk/armagetronad/language/english_base.txt 2009-02-12 11:39:50 UTC (rev 8953) +++ armagetronad/trunk/armagetronad/language/english_base.txt 2009-02-12 12:38:21 UTC (rev 8954) @@ -2842,10 +2842,10 @@ access_level_hide_of_help Minimal access level to be able to hide it's own user account information. access_level_hide_to_help Minimal access level to see everyone's user account information. access_level_team_help Minimal access level for /lock, /unlock, /invite and /uninvite team management. -access_level_op_help Minimal access level for /op, /deop, /promote and /demote co-admin management commands commands. -access_level_op_max_help Maximal access level attainable by /op and /promote commands. +access_level_op_help Minimal access level for /op and /deop co-admin management commands commands. +access_level_op_max_help Maximal access level directly attainable by /op commands. access_level_admin_help Minimal access level for /admin command. -access_level_rtfm_help Minimal access level for /teach or /rtfm command. +access_level_rtfm_help Minimal access level for /teach or /rtfm command. access_level_chat_help Minimal access level for chatting. access_level_ips_help Minimal access level you need for seeing IPs of other players in the /players command. access_level_nver_help Minimal access level you need for seeing Network versions/strings from other players in /players. @@ -2866,7 +2866,7 @@ access_level_vote_command_execute_help Minimal access level successful command votes will be executed at. access_level_chat_timeout_help Time in seconds between public announcements that someone wants to chat, but can't. Set to 0 to disable the public warnings. -access_level_chat_request \10xRESETT would like to chat, but is not authorized yet. Would someone be so kind and say "/op \2" or "/promote \2"?\n +access_level_chat_request \10xRESETT would like to chat, but is not authorized yet. Would someone be so kind and say "/op \2"?\n access_level_chat_denied 0xff7f7fChat denied,0xffffff insufficient access level.\n access_level_op_denied 0xff7f7f\1 denied,0xffffff insufficient access level.\n access_level_op_overpowered 0xff7f7f\1 denied,0xffffff your need higher access righrs than your victim.\n @@ -2874,7 +2874,7 @@ access_level_op_denied_max 0xff7f7f\1 denied,0xffffff your victim already has maximal rights.\n access_level_op_denied_ai 0xff7f7f\1 denied,0xffffff your victim is an AI.\n access_level_op_same \1: This would have no effect.\n -access_level_op_unclear \1: User is already logged in, please explicitely set an access level.\n +access_level_op_unclear \1: User is already logged in, please explicitly set an access level.\n access_level_demote \1 has been demoted to "\2" by order of \3.\n access_level_promote \1 has been promoted to "\2" by order of \3.\n Modified: armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp 2009-02-12 11:39:50 UTC (rev 8953) +++ armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp 2009-02-12 12:38:21 UTC (rev 8954) @@ -2041,8 +2041,6 @@ tColoredString say; say << tColoredString::ColorString(1,1,.5) << "( " << *sender; - con << team->Name() << "\n"; - if( !team ) { // foo --> Spectatos: message @@ -2176,6 +2174,32 @@ static tSettingItem< tAccessLevel > se_opAccessLevelMaxConf( "ACCESS_LEVEL_OP_MAX", se_opAccessLevelMax ); static tAccessLevelSetter se_opAccessLevelMaxConfLevel( se_opAccessLevelMaxConf, tAccessLevel_Owner ); +static bool se_CanChangeAccess( ePlayerNetID * admin, ePlayerNetID * victim, char const * command ) +{ + tASSERT( admin ); + tASSERT( victim ); + + if ( admin->GetAccessLevel() > se_opAccessLevel ) // Can he even use this command? + { + sn_ConsoleOut( tOutput( "$access_level_op_denied", command ), admin->Owner() ); + } + else if ( victim == admin ) + { + sn_ConsoleOut( tOutput( "$access_level_op_self", command ), admin->Owner() ); + } + else if ( admin->GetAccessLevel() >= victim->GetAccessLevel() ) + { + sn_ConsoleOut( tOutput( "$access_level_op_overpowered", command ), admin->Owner() ); + } + else + { + return true; + } + + return false; + +} + // an operation that changes the access level of another player typedef void (*OPFUNC)( ePlayerNetID * admin, ePlayerNetID * victim, tAccessLevel accessLevel ); @@ -2183,81 +2207,60 @@ { bool isexplicit = false; - if ( admin->GetAccessLevel() <= se_opAccessLevel ) + ePlayerNetID * victim = se_FindPlayerInChatCommand( admin, command, s ); + + if ( victim && se_CanChangeAccess( admin, victim, command ) ) { - ePlayerNetID * victim = se_FindPlayerInChatCommand( admin, command, s ); - if ( victim ) + // read optional access level, this part is merly a copypaste from the /shuffle code + int level = se_opAccessLevelMax; + if ( victim->IsAuthenticated() ) { - if ( victim == admin ) + level = victim->GetAccessLevel(); + } + char first; + s >> first; + if ( !s.eof() && !s.fail() ) + { + isexplicit = true; + s.unget(); + int newLevel = 0; + s >> newLevel; + + if ( first == '+' || first == '-' ) { - sn_ConsoleOut( tOutput( "$access_level_op_self", command ), admin->Owner() ); + level += newLevel; } - else if ( admin->GetAccessLevel() >= victim->GetAccessLevel() ) + else { - sn_ConsoleOut( tOutput( "$access_level_op_overpowered", command ), admin->Owner() ); + level = newLevel; } - else - { - // read optional access level, this part is merly a copypaste from the /shuffle code - int level = se_opAccessLevelMax; - if ( victim->IsAuthenticated() ) - { - level = victim->GetAccessLevel(); - } - char first; - s >> first; - if ( !s.eof() && !s.fail() ) - { - isexplicit = true; - s.unget(); - int newLevel = 0; - s >> newLevel; + } - if ( first == '+' || first == '-' ) - { - level += newLevel; - } - else - { - level = newLevel; - } - } + s >> level; - s >> level; + // Make a last safety check on the given AL, then DON'T TOUCH IT ANYMORE + if ( level <= admin->GetAccessLevel() ) + level = admin->GetAccessLevel() + 1; - if ( level <= admin->GetAccessLevel() ) - level = admin->GetAccessLevel() + 1; + tAccessLevel accessLevel; + accessLevel = static_cast< tAccessLevel >( level ); - tAccessLevel accessLevel; - - accessLevel = static_cast< tAccessLevel >( level ); - - if ( accessLevel == victim->GetAccessLevel() ) - { - if ( isexplicit ) - { - sn_ConsoleOut( tOutput( "$access_level_op_same", command ), admin->Owner() ); - } - else - { - sn_ConsoleOut( tOutput( "$access_level_op_unclear", command ), admin->Owner() ); - } - } - else if ( accessLevel > admin->GetAccessLevel() ) - { - (*F)( admin, victim, accessLevel ); - } - else - { - sn_ConsoleOut( tOutput( "$access_level_op_denied_max", command ), admin->Owner() ); - } + if ( accessLevel == victim->GetAccessLevel() ) + { + if ( isexplicit ) + { + sn_ConsoleOut( tOutput( "$access_level_op_same", command ), admin->Owner() ); } + else + { + sn_ConsoleOut( tOutput( "$access_level_op_unclear", command ), admin->Owner() ); + } } + else if ( accessLevel > admin->GetAccessLevel() ) + { + (*F)( admin, victim, accessLevel ); + } } - else - { - sn_ConsoleOut( tOutput( "$access_level_op_denied", command ), admin->Owner() ); - } } // Promote changes the access rights of an already authed player @@ -2337,11 +2340,20 @@ } // DeOp takes it away -void se_DeOp( ePlayerNetID * admin, ePlayerNetID * victim, tAccessLevel ) +void se_DeOp( ePlayerNetID * admin, std::istream & s, char const * command ) { - if ( victim->IsAuthenticated() ) + ePlayerNetID * victim = se_FindPlayerInChatCommand( admin, command, s ); + + if ( victim && se_CanChangeAccess ( admin, victim, command ) ) { - victim->DeAuthenticate( admin ); + if ( victim->IsAuthenticated() ) + { + victim->DeAuthenticate( admin ); + } + else + { + sn_ConsoleOut( tOutput( "$access_level_op_same", command ), admin->Owner() ); + } } } @@ -2555,7 +2567,7 @@ } // log out -static void se_AdminLogout( ePlayerNetID * p ) +static void se_AdminLogout( ePlayerNetID * p, char const * command ) { #ifdef KRAWALL_SERVER // revoke the other kind of authentication as well @@ -2563,6 +2575,10 @@ { p->DeAuthenticate(); } + else + { + sn_ConsoleOut( tOutput( "$access_level_op_same", command ), p->Owner() ); + } #else if ( p->IsLoggedIn() ) { @@ -2615,7 +2631,7 @@ if (command == "/login") { // Really, there's no reason one would log in and log out all the time - spam.factor_ = 2; + spam.factor_ = 1; if ( spam.Block() ) { return; @@ -2627,13 +2643,13 @@ } else if (command == "/logout") { - spam.factor_ = 2; + spam.factor_ = 1; if( spam.Block() ) { return; } - se_AdminLogout( p ); + se_AdminLogout( p, command ); } #ifdef KRAWALL_SERVER else if ( command == "/op" ) @@ -2642,7 +2658,7 @@ } else if ( command == "/deop" ) { - se_ChangeAccess( p, s, "/deop", &se_DeOp ); + se_DeOp( p, s, "/deop" ); } else if ( command == "/invite" ) { @@ -2974,8 +2990,6 @@ ePlayerNetID * admin = se_PlayerNetIDs(i); if ( - admin != p && - ( // two cases: ( // You are a speccing admin, and you aren't invited to anything: @@ -2988,7 +3002,6 @@ // invited players are also authorized currentTeam->IsInvited( admin ) ) - ) ) { se_SendTeamMessage(currentTeam, p, admin, msg); @@ -3075,9 +3088,11 @@ } } -// prints an indented team member -static void se_SendTeamMember( ePlayerNetID const * player, int indent, std::ostream & tos ) +// prints an indented team member with position marker +static void se_SendTeamMember( ePlayerNetID const * player, int indent, std::ostream & tos, int index, int width ) { + tos << '#' << std::setw( width ) << index+1 << ' '; + // send team name for( int i = indent-1; i >= 0; --i ) { @@ -3102,18 +3117,19 @@ // send team members int teamMembers = team->NumPlayers(); + int width = teamMembers >= 10 ? 2 : 1; int indent = 0; // print left wing, the odd team members for( int i = (teamMembers/2)*2-1; i>=0; i -= 2 ) { - se_SendTeamMember( team->Player(i), indent, tos ); + se_SendTeamMember( team->Player(i), indent, tos, i, width ); indent += 2; } // print right wing, the even team members for( int i = 0; i < teamMembers; i += 2 ) { - se_SendTeamMember( team->Player(i), indent, tos ); + se_SendTeamMember( team->Player(i), indent, tos, i, width ); indent -= 2; } @@ -3658,6 +3674,14 @@ se_ChatTeams( p ); return; } + else if (command == "/myteam") { + eTeam *currentTeam = se_GetManagedTeam( p ); + if( currentTeam ) + { + se_ListTeam( p, currentTeam ); + } + return; + } else if (command == "/help") { se_Help( p, p, s ); return; Modified: armagetronad/trunk/armagetronad/src/tron/gServerFavorites.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/tron/gServerFavorites.cpp 2009-02-12 11:39:50 UTC (rev 8953) +++ armagetronad/trunk/armagetronad/src/tron/gServerFavorites.cpp 2009-02-12 12:38:21 UTC (rev 8954) @@ -508,6 +508,7 @@ // create menu entries sg_languageIDPrefix = "$bookmarks_"; + sg_Connect = &sg_ConnectFavorite; gCustomConnectEntries submenu( fav, &net_menu ); net_menu.Enter(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |