From: <he...@us...> - 2012-04-07 07:22:37
|
Revision: 301 http://simspark.svn.sourceforge.net/simspark/?rev=301&view=rev Author: hedayat Date: 2012-04-07 07:22:30 +0000 (Sat, 07 Apr 2012) Log Message: ----------- Add/Enable automatic quit after game over. Modified Paths: -------------- trunk/rcssserver3d/ChangeLog trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h trunk/rcssserver3d/rcssserver3d/naosoccersim.rb trunk/spark/ChangeLog trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp Modified: trunk/rcssserver3d/ChangeLog =================================================================== --- trunk/rcssserver3d/ChangeLog 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/ChangeLog 2012-04-07 07:22:30 UTC (rev 301) @@ -1,3 +1,8 @@ +2012-04-07 Hedayat Vatankhah <hed...@gm...> + + * plugin/soccer/soccerruleaspect/soccerruleaspect.cpp (SoccerRuleAspect::UpdateGameOver): + - add AutomaticQuit mode to shutdown automatically when the game is over + 2012-02-14 Sander van Dijk <sgv...@gm...> * rcssserver3d/main.cpp (Spark): Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.cpp 2012-04-07 07:22:30 UTC (rev 301) @@ -49,6 +49,7 @@ mAutomaticKickOff(false), mWaitBeforeKickOff(1.0), mSingleHalfTime(false), + mAutomaticQuit(true), mSayMsgSize(20), mAudioCutDist(50.0), mFirstCollidingAgent(true), @@ -1152,7 +1153,7 @@ SoccerRuleAspect::UpdateGameOver() { // wait for 10 seconds to finish - if (mGameState->GetModeTime() < 9) + if (mGameState->GetModeTime() < 9 || !mAutomaticQuit) { return; } @@ -1346,6 +1347,7 @@ SoccerBase::GetSoccerVar(*this,"AutomaticKickOff",mAutomaticKickOff); SoccerBase::GetSoccerVar(*this,"WaitBeforeKickOff",mWaitBeforeKickOff); SoccerBase::GetSoccerVar(*this,"SingleHalfTime",mSingleHalfTime); + SoccerBase::GetSoccerVar(*this,"AutomaticQuit",mAutomaticQuit); SoccerBase::GetSoccerVar(*this,"UseOffside",mUseOffside); float penaltyLength, penaltyWidth; SoccerBase::GetSoccerVar(*this,"PenaltyLength",penaltyLength); Modified: trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h =================================================================== --- trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/plugin/soccer/soccerruleaspect/soccerruleaspect.h 2012-04-07 07:22:30 UTC (rev 301) @@ -296,6 +296,8 @@ float mWaitBeforeKickOff; /** flag if we want to play only one half of the match */ bool mSingleHalfTime; + /** flag if the simulator should quit automatically when the game is over */ + bool mAutomaticQuit; //FCP 2010 - New Parameters (added by FCPortugal for Singapure 2010) /** max time player may be sitted or laying down before being repositioned */ Modified: trunk/rcssserver3d/rcssserver3d/naosoccersim.rb =================================================================== --- trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/rcssserver3d/rcssserver3d/naosoccersim.rb 2012-04-07 07:22:30 UTC (rev 301) @@ -50,6 +50,7 @@ addSoccerVar('GoalKickDist', 1.0) addSoccerVar('AutomaticKickOff', false) addSoccerVar('WaitBeforeKickOff', 2.0) +addSoccerVar('AutomaticQuit', true) addSoccerVar('BorderSize', 0.0) # prevent complaining about missing variable # agent parameters Modified: trunk/spark/ChangeLog =================================================================== --- trunk/spark/ChangeLog 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/spark/ChangeLog 2012-04-07 07:22:30 UTC (rev 301) @@ -1,3 +1,8 @@ +2012-04-07 Hedayat Vatankhah <hed...@gm...> + + * lib/oxygen/simulationserver/simulationserver.cpp (SimulationServer::Step): + - quit if GameControlServer is finished (e.g. the end of a game) + 2012-02-16 Hedayat Vatankhah <hed...@gm...> * lib/salt/gmath.h: Modified: trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp =================================================================== --- trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2012-03-20 16:44:23 UTC (rev 300) +++ trunk/spark/lib/oxygen/simulationserver/simulationserver.cpp 2012-04-07 07:22:30 UTC (rev 301) @@ -265,6 +265,13 @@ mSimTime += mSumDeltaTime; mSumDeltaTime = 0; } + + if (mGameControlServer->IsFinished() && !mExit) + { + GetLog()->Normal() << "(SimulationServer) GameControlServer finished," + " exiting.\n"; + Quit(); + } } void SimulationServer::ControlEvent(EControlEvent event) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |