From f6b716c4eaf980055d5dbcd2a0a2f5b67bb6c348 Mon Sep 17 00:00:00 2001 From: Robert Zubeck Date: Wed, 10 Oct 2007 00:52:26 +0000 Subject: [PATCH] Reset the round number to zero before each EZ game (in case the player keeps restarting the game without quitting it). This also ensures they will get a fresh RoundStarted event at the beginning of each new game. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@447 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../threerings/ezgame/server/EZGameManager.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/ezgame/server/EZGameManager.java b/src/java/com/threerings/ezgame/server/EZGameManager.java index 4c20ea28..752596cc 100644 --- a/src/java/com/threerings/ezgame/server/EZGameManager.java +++ b/src/java/com/threerings/ezgame/server/EZGameManager.java @@ -595,6 +595,16 @@ public class EZGameManager extends GameManager super.didShutdown(); } + @Override + protected void gameWillStart () + { + // reset the round id to an initial value. note that we don't distribute the initial value, + // because the super's version of this function will immediately increment it, and then + // distribute the new incremented value. + _ezObj.roundId = 0; + super.gameWillStart(); + } + @Override protected void gameDidEnd () { @@ -605,11 +615,6 @@ public class EZGameManager extends GameManager // EZ games immediately resest to PRE_GAME after they end so that they can be restarted if // desired by having all players call playerReady() again _ezObj.setState(EZGameObject.PRE_GAME); - - // untwiddle the round id if we ended the game in between rounds - if (_ezObj.roundId < 0) { - _ezObj.setRoundId(-_ezObj.roundId); - } } @Override