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
This commit is contained in:
Michael Bayne
2008-03-21 18:17:03 +00:00
parent 828753344d
commit c0ce0d188b
@@ -666,6 +666,15 @@ public class GameManager extends PlaceManager
return (getMatchType() == GameConfig.SEATED_GAME); 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 * 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 * 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(); 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 /** The default value returned by {@link #getNoShowTime}. */
* show. */ protected static final long DEFAULT_NOSHOW_DELAY = 30 * 1000L;
protected static final long NOSHOW_DELAY = 30 * 1000L;
/** The delay in milliseconds between ticking of all game managers. */ /** The delay in milliseconds between ticking of all game managers. */
protected static final long TICK_DELAY = 5L * 1000L; protected static final long TICK_DELAY = 5L * 1000L;