From c0ce0d188b0c204594d2bc1e91f5d72eb7d66a31 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 21 Mar 2008 18:17:03 +0000 Subject: [PATCH] Allow the no-show timer to be customized. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@576 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../parlor/game/server/GameManager.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/java/com/threerings/parlor/game/server/GameManager.java b/src/java/com/threerings/parlor/game/server/GameManager.java index c21aab9d..ba087c2a 100644 --- a/src/java/com/threerings/parlor/game/server/GameManager.java +++ b/src/java/com/threerings/parlor/game/server/GameManager.java @@ -666,6 +666,15 @@ public class GameManager extends PlaceManager return (getMatchType() == GameConfig.SEATED_GAME); } + /** + * Returns the time after which we consider any player that has not yet reported into the game + * as a no-show and try to start the game anyway. + */ + protected long getNoShowTime () + { + return DEFAULT_NOSHOW_DELAY; + } + /** * Derived classes that need their AIs to be ticked periodically should override this method * and return true. Many AIs can act entirely in reaction to game state changes and need no @@ -803,7 +812,7 @@ public class GameManager extends PlaceManager checkForNoShows(); } }; - _noShowInterval.schedule(NOSHOW_DELAY); + _noShowInterval.schedule(getNoShowTime()); } } @@ -1337,9 +1346,8 @@ public class GameManager extends PlaceManager } }; - /** We give players 30 seconds to turn up in a game; after that, they're considered a no - * show. */ - protected static final long NOSHOW_DELAY = 30 * 1000L; + /** The default value returned by {@link #getNoShowTime}. */ + protected static final long DEFAULT_NOSHOW_DELAY = 30 * 1000L; /** The delay in milliseconds between ticking of all game managers. */ protected static final long TICK_DELAY = 5L * 1000L;