Wait to start a party and seated continuous EZ games until we've heard
playerReady() from at least one player. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@522 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -564,16 +564,6 @@ public class EZGameManager extends GameManager
|
||||
_ezObj = (EZGameObject) _plobj;
|
||||
_ezObj.setEzGameService(
|
||||
(EZGameMarshaller) CrowdServer.invmgr.registerDispatcher(new EZGameDispatcher(this)));
|
||||
|
||||
// if we don't need the no-show timer, start right away (but allow the manager startup
|
||||
// process to finish before doing so)
|
||||
if (!needsNoShowTimer()) {
|
||||
CrowdServer.omgr.postRunnable(new Runnable() {
|
||||
public void run () {
|
||||
startGame();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override // from PlaceManager
|
||||
@@ -619,6 +609,27 @@ public class EZGameManager extends GameManager
|
||||
}
|
||||
}
|
||||
|
||||
@Override // from PlaceManager
|
||||
protected void playersAllHere ()
|
||||
{
|
||||
switch (getMatchType()) {
|
||||
default:
|
||||
case GameConfig.SEATED_GAME:
|
||||
super.playersAllHere();
|
||||
break;
|
||||
|
||||
case GameConfig.PARTY:
|
||||
case GameConfig.SEATED_CONTINUOUS:
|
||||
// the first time the first player calls playerReady() in a party or seated continuous
|
||||
// game, we start the game; after that it's up to the game to restart itself
|
||||
if (!_haveAutoStarted && _gameobj.state == EZGameObject.PRE_GAME) {
|
||||
_haveAutoStarted = true;
|
||||
startGame();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void didShutdown ()
|
||||
{
|
||||
@@ -779,6 +790,10 @@ public class EZGameManager extends GameManager
|
||||
/** Handles the storage of our user cookies; lazily initialized. */
|
||||
protected GameCookieManager _cookMgr;
|
||||
|
||||
/** Tracks whether or not we've auto-started a non-seated game. Unfortunately there's no way to
|
||||
* derive this from existing game state. */
|
||||
protected boolean _haveAutoStarted;
|
||||
|
||||
/** The minimum delay a ticker can have. */
|
||||
protected static final int MIN_TICKER_DELAY = 50;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user