It's a party in here. We have a method that handles checking whether to start

up a shutdown interval. Let's override that method and implement GameManager's
special requirements instead of overriding an unrelated method and duplicating
most of the code from it.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@588 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-04-29 18:57:15 +00:00
parent 759050d576
commit c8f680696d
@@ -854,15 +854,8 @@ public class GameManager extends PlaceManager
@Override
protected void placeBecameEmpty ()
{
// We do not call super.
super.placeBecameEmpty();
// Duplicated from super(): let our delegates do their business
applyToDelegates(new DelegateOp() {
public void apply (PlaceManagerDelegate delegate) {
delegate.placeBecameEmpty();
}
});
// log.info("Game room empty. Going away. [game=" + where() + "].");
// if we're in play then move to game over
@@ -891,6 +884,20 @@ public class GameManager extends PlaceManager
}
}
@Override // from GameManager
protected void checkShutdownInterval ()
{
// PlaceManager will attempt to set up an idle shutdown interval when it is first created
// (which as a GameManager we want) and if bodies actually enter the place and then it once
// again becomes empty. In the latter case (a game has started and finished and everyone
// has now left) we do not want a shutdown interval because we shut ourselves down
// immediately in that circumstance. So we only set up a shutdown interval in the pre-game
// state.
if (_gameobj.state == GameObject.PRE_GAME) {
super.checkShutdownInterval();
}
}
/**
* Called after the no-show delay has expired following the delivery of notifications to all
* players that the game is ready. <em>Note:</em> this is not called for party games. Those