From: <z-...@us...> - 2008-03-08 16:55:08
|
Revision: 8287 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8287&view=rev Author: z-man Date: 2008-03-08 08:55:06 -0800 (Sat, 08 Mar 2008) Log Message: ----------- Merging branch 0.2.8 from revision 8269 to 8286: ------------------------------------------------------------------------ r8285 | z-man | 2008-03-08 15:24:06 +0100 (Sat, 08 Mar 2008) | 3 lines Experimenting with different visuals for slowly collapsing zones. Take 1: When conquered, the zone lights up in white, then slows down. When the rotation stops, it darkens. ------------------------------------------------------------------------ r8284 | z-man | 2008-03-08 15:06:41 +0100 (Sat, 08 Mar 2008) | 3 lines Voter datastructure (with a little more persistence than ePlayerNetID) is only used to store suspensions while the ePlayerNetID object does not exist. This avoids suspending everyone connecting from the same LAN all at once. ------------------------------------------------------------------------ r8283 | z-man | 2008-03-08 14:53:19 +0100 (Sat, 08 Mar 2008) | 2 lines Re-added VOTE_USE_SERVER_CONTROLLED_KICK config item on the client to avoid UPGRADE messages. ------------------------------------------------------------------------ r8282 | z-man | 2008-03-08 13:51:07 +0100 (Sat, 08 Mar 2008) | 2 lines Fixed clientside reception of server controlled vote items. ------------------------------------------------------------------------ r8281 | z-man | 2008-03-08 13:49:37 +0100 (Sat, 08 Mar 2008) | 2 lines Added -O0 to debug configuration, just in case. ------------------------------------------------------------------------ r8280 | z-man | 2008-03-08 13:48:27 +0100 (Sat, 08 Mar 2008) | 2 lines Recording fixes for the case when there are errors talking to the authority. ------------------------------------------------------------------------ r8279 | z-man | 2008-03-08 11:49:26 +0100 (Sat, 08 Mar 2008) | 2 lines Added full user name to recording. ------------------------------------------------------------------------ r8278 | z-man | 2008-03-08 11:48:51 +0100 (Sat, 08 Mar 2008) | 2 lines Fixed extra trailing \0 in playback strings. ------------------------------------------------------------------------ r8276 | bazaarmagetron | 2008-03-08 00:57:06 +0100 (Sat, 08 Mar 2008) | 2 lines Manuel Moos: Fixed one vote item delivery bug. There must be another one hiding somewhere, though. ------------------------------------------------------------------------ r8275 | bazaarmagetron | 2008-03-08 00:56:32 +0100 (Sat, 08 Mar 2008) | 2 lines Manuel Moos: Fixed blank screen bug; it was caused by bad tToDo recursion. ------------------------------------------------------------------------ r8273 | z-man | 2008-03-07 14:20:40 +0100 (Fri, 07 Mar 2008) | 2 lines Don't show "IP=<empty>" in /players output. ------------------------------------------------------------------------ r8272 | z-man | 2008-03-07 12:03:02 +0100 (Fri, 07 Mar 2008) | 4 lines Added eGameObject::OnRoundBegin(), called after game object creation. Used it in the zone code to fix the flickering empty zone glitch in sumo, and to avoid rare midgame zone ownership changes. ------------------------------------------------------------------------ Revision Links: -------------- http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8269&view=rev Modified Paths: -------------- armagetronad/trunk/armagetronad/configure.ac armagetronad/trunk/armagetronad/src/engine/eGameObject.cpp armagetronad/trunk/armagetronad/src/engine/eGameObject.h armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp armagetronad/trunk/armagetronad/src/engine/ePlayer.h armagetronad/trunk/armagetronad/src/engine/eVoter.cpp armagetronad/trunk/armagetronad/src/network/nAuthentication.cpp armagetronad/trunk/armagetronad/src/tron/gGame.cpp Modified: armagetronad/trunk/armagetronad/configure.ac =================================================================== --- armagetronad/trunk/armagetronad/configure.ac 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/configure.ac 2008-03-08 16:55:06 UTC (rev 8287) @@ -292,7 +292,7 @@ dnl default CXX flags: optimize a bit if no optimization optimization has been selected yet test -z "`echo $CXXFLAGS | grep "\-O"`" && CXXFLAGS="$CXXFLAGS -O2" -test $DEBUGLEVEL -ge 1 && CXXFLAGS="`echo $CXXFLAGS | sed -e 's,-O.,,'` -g" +test $DEBUGLEVEL -ge 1 && CXXFLAGS="`echo $CXXFLAGS | sed -e 's,-O.,,'` -g -O0" test $DEBUGLEVEL -ge 2 && CXXFLAGS="$CXXFLAGS -DDEBUG" test $DEBUGLEVEL -ge 3 && enable_memmanager=yes test $DEBUGLEVEL -ge 4 && CXXFLAGS="$CXXFLAGS -DDEBUG_EXPENSIVE" Modified: armagetronad/trunk/armagetronad/src/engine/eGameObject.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/engine/eGameObject.cpp 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/src/engine/eGameObject.cpp 2008-03-08 16:55:06 UTC (rev 8287) @@ -617,6 +617,7 @@ } // return value: shall this object be destroyed? +void eGameObject::OnRoundBegin(){} void eGameObject::OnRoundEnd(){} void eGameObject::Kill(){} Modified: armagetronad/trunk/armagetronad/src/engine/eGameObject.h =================================================================== --- armagetronad/trunk/armagetronad/src/engine/eGameObject.h 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/src/engine/eGameObject.h 2008-03-08 16:55:06 UTC (rev 8287) @@ -157,6 +157,10 @@ return w; } + //! called when the round begins, after all game objects have been created, + //! before the first network sync is sent out. + virtual void OnRoundBegin(); + //! called when the round ends virtual void OnRoundEnd(); Modified: armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/src/engine/ePlayer.cpp 2008-03-08 16:55:06 UTC (rev 8287) @@ -2992,7 +2992,11 @@ } if ( tCurrentAccessLevel::GetAccessLevel() <= se_ipAccessLevel ) { - tos << ", IP = " << p2->GetMachine().GetIP(); + tString IP = p2->GetMachine().GetIP(); + if ( IP.Len() > 1 ) + { + tos << ", IP = " << IP; + } } tos << "\n"; @@ -3712,6 +3716,7 @@ stealth_ = false; chatFlags_ = 0; disconnected = false; + suspended_ = 0; loginWanted = false; @@ -3778,6 +3783,7 @@ spectating_ =false; stealth_ =false; disconnected=false; + suspended_ = 0; chatFlags_ =0; r = g = b = 15; @@ -3874,6 +3880,12 @@ // clear old legacy spectator that may be lurking around se_ClearLegacySpectator( Owner() ); + + // get suspension count + if ( GetVoter() ) + { + suspended_ = GetVoter()->suspended_; + } } this->wait_ = 0; @@ -7293,6 +7305,12 @@ { if ( registeredMachine_ ) { + // store suspension count + if ( GetVoter() ) + { + GetVoter()->suspended_ = suspended_; + } + registeredMachine_->RemovePlayer(); registeredMachine_ = 0; } @@ -7473,26 +7491,11 @@ //! accesses the suspension count int & ePlayerNetID::AccessSuspended() { - static int dummy; - dummy = 0; - - if ( Owner() == 0 || !GetVoter() ) - { - return dummy; - } - - return GetVoter()->suspended_; + return suspended_; } //! returns the suspension count int ePlayerNetID::GetSuspended() const { - int dummy = 0; - - if ( Owner() == 0 || !GetVoter() ) - { - return dummy; - } - - return GetVoter()->suspended_; + return suspended_; } Modified: armagetronad/trunk/armagetronad/src/engine/ePlayer.h =================================================================== --- armagetronad/trunk/armagetronad/src/engine/ePlayer.h 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/src/engine/ePlayer.h 2008-03-08 16:55:06 UTC (rev 8287) @@ -153,6 +153,7 @@ int teamListID; // ID in the list of the team bool silenced_; // flag indicating whether the player has been silenced + int suspended_; //! number of rounds the player is currently suspended from playing nTimeAbsolute timeJoinedTeam; // the time the player joined the team he is in now tCONTROLLED_PTR(eTeam) nextTeam; // the team we're in ( logically ) Modified: armagetronad/trunk/armagetronad/src/engine/eVoter.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/engine/eVoter.cpp 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/src/engine/eVoter.cpp 2008-03-08 16:55:06 UTC (rev 8287) @@ -43,6 +43,12 @@ #include "ePlayer.h" #include "eGrid.h" +#ifndef DEDICATED +// use server controlled votes (just for the client, to avoid UPGRADE messages) +static bool se_useServerControlledKick = false; +static nSettingItem< bool > se_usc( "VOTE_USE_SERVER_CONTROLLED_KICK", se_useServerControlledKick ); +#endif + // basic vote timeout value static unsigned short se_votingItemID = 0; static float se_votingTimeout = 300.0f; @@ -201,10 +207,13 @@ if ( !DoFillFromMessage( m ) ) return false; - if ( !CheckValid( m.SenderID() ) ) - return false; + if ( sn_GetNetState() == nSERVER ) + { + if ( !CheckValid( m.SenderID() ) ) + return false; - ReBroadcast( m.SenderID() ); + ReBroadcast( m.SenderID() ); + } return true; } @@ -552,6 +561,11 @@ // checks whether the vote is a valid vote to make bool CheckValid( int senderID ) { + if ( sn_GetNetState() != nSERVER ) + { + return true; + } + // fill suggestor if ( !suggestor_ ) { @@ -829,7 +843,7 @@ { m >> description_; m >> details_; - return true; + return eVoteItem::DoFillFromMessage( m ); }; virtual void DoFillToMessage( nMessage& m ) const @@ -881,7 +895,7 @@ static void se_HandleNewServerVote( nMessage& m ) { - if ( eVoteItem::AcceptNewVote( m ) ) + if ( sn_GetNetState() != nCLIENT || eVoteItem::AcceptNewVote( m ) ) { // accept message eVoteItem* item = tNEW( eVoteItemServerControlled )(); @@ -1350,7 +1364,7 @@ { // no objection? Broadcast it to everyone. item->Update(); - item->ReBroadcast( p->Owner() ); + item->ReBroadcast( senderID ); } // and cancel this item here. Modified: armagetronad/trunk/armagetronad/src/network/nAuthentication.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/network/nAuthentication.cpp 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/src/network/nAuthentication.cpp 2008-03-08 16:55:06 UTC (rev 8287) @@ -520,14 +520,21 @@ tRecorder::Playback( section, method.prefix ); tRecorder::Playback( section, method.suffix ); tRecorder::Playback( section, authority ); + tRecorder::Playback( section, error ); tRecorder::Record( section, ret ); tRecorder::Record( section, method.method ); tRecorder::Record( section, method.prefix ); tRecorder::Record( section, method.suffix ); tRecorder::Record( section, authority ); + tRecorder::Record( section, error ); if ( !ret ) { + if ( tRecorder::IsPlayingBack() ) + { + Abort(); + } + return; } @@ -951,9 +958,11 @@ // exploitable information for password theft: the scrambled password // stored in the incoming network stream has an unknown salt value. ) static char const * section = "AUTH_RESULT"; + tRecorder::Playback( section, username ); tRecorder::Playback( section, success ); tRecorder::Playback( section, authority ); tRecorder::Playback( section, error ); + tRecorder::Record( section, username ); tRecorder::Record( section, success ); tRecorder::Record( section, authority ); tRecorder::Record( section, error ); Modified: armagetronad/trunk/armagetronad/src/tron/gGame.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/tron/gGame.cpp 2008-03-08 15:27:37 UTC (rev 8286) +++ armagetronad/trunk/armagetronad/src/tron/gGame.cpp 2008-03-08 16:55:06 UTC (rev 8287) @@ -2579,9 +2579,6 @@ // unsigned short int mes1 = 1, mes2 = 1, mes3 = 1, mes4 = 1, mes5 = 1; - // now would be a good time to tend for pending tasks - nAuthentication::OnBreak(); - switch (state){ case GS_DELETE_GRID: // sr_con.autoDisplayAtNewline=true; @@ -2669,6 +2666,19 @@ ePlayerNetID::RankingLadderLog(); + // do round begin stuff + { + const tList<eGameObject>& gameObjects = Grid()->GameObjects(); + for (int i=gameObjects.Len()-1;i>=0;i--) + { + eGameObject * e = gameObjects(i); + if ( e ) + { + e->OnRoundBegin(); + } + } + } + // do the first analysis of the round, now is the time to get it used to the number of teams Analysis( -1000 ); @@ -2847,6 +2857,10 @@ default: break; } + + // now would be a good time to tend for pending tasks + nAuthentication::OnBreak(); + if (sn_GetNetState()==nSERVER){ NetSyncIdle(); RequestSync(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |