Add overridable function to potentially allow games to start up even without any humans present if they wish. Defaults to NOT allow that behavior.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4076 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Mike Thomas
2006-04-28 20:40:04 +00:00
parent b2896dc7ff
commit e2057d362d
@@ -677,7 +677,7 @@ public class GameManager extends PlaceManager
}
}
if (humansHere == 0) {
if ((humansHere == 0) && !startWithoutHumans()) {
// if there are no human players in the game, just cancel it
Log.info("Canceling no-show game [game=" + _gameobj.which() +
", players=" + StringUtil.toString(_playerOids) + "].");
@@ -751,6 +751,15 @@ public class GameManager extends PlaceManager
return true;
}
/**
* @return true if we should start the game even without any humans.
* Default implementation always returns false.
*/
protected boolean startWithoutHumans ()
{
return false;
}
/**
* Called when the game is about to start, but before the game start
* notification has been delivered to the players. Derived classes