com.threerings.parlor.game.server
Class GameManager

java.lang.Object
  extended by com.threerings.crowd.server.PlaceManager
      extended by com.threerings.parlor.game.server.GameManager
All Implemented Interfaces:
SpeakHandler.SpeakerValidator, ParlorCodes, GameCodes, PlayManager, InvocationCodes, ChangeListener, MessageListener
Direct Known Subclasses:
CardGameManager, PuzzleManager

public class GameManager
extends PlaceManager
implements ParlorCodes, GameCodes, PlayManager

The game manager handles the server side management of a game. It manipulates the game state in accordance with the logic of the game flow and generally manages the whole game playing process.

The game manager extends the place manager because games are implicitly played in a location, the players of the game implicitly bodies in that location.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.crowd.server.PlaceManager
PlaceManager.DelegateOp, PlaceManager.MessageHandler
 
Field Summary
protected  GameAI[] _AIs
          If AIs are present, contains their configuration, or null at human player indexes.
protected  Interval _aiTicker
          The interval for the AI tick.
protected  int _committedState
          The state of the game that has been propagated to our subscribers.
protected  GameConfig _gameconfig
          A reference to our game config.
protected  RepeatCallTracker _gameEndTracker
          TEMP: debugging the pending rating double release bug.
protected  GameObject _gameobj
          A reference to our game object.
protected  Interval _noShowInterval
          The interval used to check for no-shows.
protected  ArrayIntSet _pendingOids
          The list of players that have arrived in the room, but are not ready to play.
protected  int _playerCount
          The number of players in the game.
protected  int[] _playerOids
          The oids of our player and AI body objects.
protected  boolean _postponedStart
          Whether we have already postponed the start of the game.
protected  List<Tuple<String,String>> _startmsgs
          If non-null, contains bundles and messages that should be sent as system messages once the game has started.
protected  NamedAttributeListener _stateListener
          Listens for game state changes.
protected  Interval _tickInterval
          The interval for the game manager tick.
protected static long AI_TICK_DELAY
          The frequency with which we dispatch AI game ticks.
protected static long DEFAULT_NOSHOW_DELAY
          The default value returned by getNoShowTime().
protected static long TICK_DELAY
          The delay in milliseconds between ticking of all game managers.
 
Fields inherited from class com.threerings.crowd.server.PlaceManager
_bodyUpdater, _config, _deathListener, _delegates, _dispatcher, _dispatcherFinders, _injector, _invmgr, _locator, _marshallers, _msghandlers, _occInfo, _occListener, _omgr, _plobj, _registry, _shutdownInterval
 
Fields inherited from interface com.threerings.parlor.data.ParlorCodes
ALREADY_AT_TABLE, BANNED_FROM_TABLE, GAME_ALREADY_STARTED, INVALID_TABLE_POSITION, INVITATION_ACCEPTED, INVITATION_COUNTERED, INVITATION_REFUSED, INVITEE_NOT_ONLINE, MUST_BE_CREATOR, NO_SELF_BOOT, NO_SUCH_TABLE, NOT_AT_TABLE, PARLOR_GROUP, TABLE_POSITION_OCCUPIED
 
Fields inherited from interface com.threerings.parlor.game.data.GameCodes
GAME_CHAT_TYPE, GAME_MESSAGE_BUNDLE, PLAYER_KNOCKED_OUT, WINNERS_AND_LOSERS
 
Fields inherited from interface com.threerings.presents.data.InvocationCodes
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR
 
Constructor Summary
GameManager()
           
 
Method Summary
 int addPlayer(Name player)
          Adds the given player to the game at the first available player index.
 boolean addPlayerAt(Name player, int pidx)
          Adds the given player to the game at the specified player index.
 boolean allPlayersReady()
          Returns true if all (non-AI) players have delivered their playerReady(com.threerings.crowd.data.BodyObject) notifications, false if they have not.
protected  void announcePlayerGameOver(int pidx)
          Announce to everyone in the game that a player's game has ended.
protected  void assignWinners(boolean[] winners)
          Assigns the final winning status for each player to their respect player index in the supplied array.
protected  void bodyLeft(int bodyOid)
           
 boolean cancelGame()
          Sets the state of the game to GameObject.CANCELLED.
protected  void checkForNoShows()
          Called after the no-show delay has expired following the delivery of notifications to all players that the game is ready.
protected  void checkShutdownInterval()
           
 BodyObject checkWritePermission(ClientObject client, int playerId)
          Make sure that the given caller is a player or an agent and can write to the data of the given playerId.
protected  void didInit()
           
protected  void didShutdown()
           
protected  void didStartup()
           
 void endGame()
          Called when the game is known to be over.
 void endPlayerGame(int pidx)
          Ends the game for the given player.
protected  void gameDidEnd()
          Called after the game has transitioned to the GameObject.GAME_OVER state.
protected  void gameDidStart()
          Called after the game start notification was dispatched.
protected  void gameWasCancelled()
          Called to let the manager know that the game was cancelled (and may be about to be shutdown if there's no one in the room).
protected  void gameWillEnd()
          Called when the game is about to end, but before the game end notification has been delivered to the players.
protected  void gameWillReset()
          Called when the game is about to reset, but before the board has been re-initialized or any other clearing out of game data has taken place.
protected  void gameWillStart()
          Called when the game is about to start, but before the game start notification has been delivered to the players.
 GameConfig getGameConfig()
          Returns the configuration object for the game being managed by this manager.
 int getGameId()
          Returns the unique numeric identifier for our managed game.
 int getMatchType()
          A convenience method for getting the game type.
protected  long getNoShowTime()
          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.
 BodyObject getPlayer(int playerIdx)
          Returns the user object for the player with the specified index or null if the player at that index is not online.
 int getPlayerCount()
          Returns the number of players in the game.
 Name getPlayerDisplayName(int index)
          Returns the name that should be shown in the client for the player with the specified index or null if no player exists at that index.
protected  String getPlayerGameOverMessage(int pidx)
          Gets the untranslated string to show when a player's game has ended.
 int getPlayerIndex(Name username)
          Returns the player index of the given user in the game, or -1 if the player is not involved in the game.
 Name getPlayerName(int index)
          Returns the name of the player with the specified index or null if no player exists at that index.
 int getPlayerOid(int index)
          Returns the user object oid of the player with the specified index.
 int getPlayerPersistentId(BodyObject body)
          Convenience for getting the persistent id from a body.
 int getPlayerPersistentId(Name name)
          Returns the persistent user id for the supplied player name.
 int getPlayerSlots()
          Returns the number of players allowed in this game.
 int getPresentPlayerIndex(int bodyOid)
          Get the player index of the specified oid, or -1 if the oid is not a player or is a player that is not presently in the game.
 int getSessionId()
          Returns the unique session identifier for this game session.
protected  void handlePartialNoShow()
          This is called when some, but not all, players failed to show up for a game.
 boolean isActivePlayer(int pidx)
          Returns whether the player at the specified player index is actively playing the game
 boolean isAgent(ClientObject client)
          Return true if the given client is a server-side agent in this place.
 boolean isAI(int pidx)
          Returns whether the player at the specified player index is an AI.
 boolean isPlayer(ClientObject client)
          Return true if the given client is a player in this place.
protected  boolean needsAITick()
          Derived classes that need their AIs to be ticked periodically should override this method and return true.
protected  boolean needsNoShowTimer()
          Returns true if this game requires a no-show timer.
 void occupantInRoom(BodyObject caller)
          Called by the client when an occupant has arrived in the game room and has loaded their bits.
protected  void placeBecameEmpty()
          When a game room becomes empty, we cancel the game if it's still in progress and close down the game room.
protected  void playerGameDidEnd(int pidx)
          Called when a player has been marked as knocked out but before the knock-out status update has been sent to the players.
 boolean playerIsReady(int pidx)
          Returns true if the player at the specified slot is ready (or if there is meant to be no player in that slot), false if there is meant to be a player in the specified slot and they have not yet reported that they are ready.
 void playerReady(BodyObject caller)
          Called by the client when the player is ready for the game to start.
protected  void playersAllHere()
          Called when all players have arrived in the game room.
protected  void playerWasAdded(Name player, int pidx)
          Called when a player was added to the game.
protected  void playerWasRemoved(Name player, int pidx)
          Called when a player was removed from the game.
protected  void playerWasReplaced(int pidx, Name oldPlayer, Name newPlayer)
          Called when a player has been replaced via a call to replacePlayer(int, com.threerings.util.Name).
 boolean removePlayer(Name player)
          Removes the given player from the game.
 void replacePlayer(int pidx, Name player)
          Replaces the player at the specified index and calls playerWasReplaced(int, com.threerings.util.Name, com.threerings.util.Name) to let derived classes and delegates know what's going on.
protected  void reportPlayerKnockedOut(int pidx)
          Report to the knocked-out player's room that they were knocked out.
protected  void reportWinnersAndLosers()
          Report winner and loser oids to each room that any of the winners/losers is in.
 void resetGame()
          Called when the game is to be reset to its starting state in preparation for a new game without actually ending the current game.
 void setAI(int pidx, GameAI ai)
          Sets the specified player as an AI with the specified configuration.
 boolean shouldConcludeGame()
          Returns whether game conclusion antics such as rating updates should be performed when an in-play game is ended.
protected  boolean shouldEndGame()
          Called when a player leaves the game in order to determine whether the game should be ended based on its current state, which will include updated player status for the player in question.
protected  void startAITicker()
          Starts our AI ticker if it is not already started.
 boolean startGame()
          This is called when the game is ready to start (all players involved have delivered their "am ready" notifications).
protected  boolean startWithoutHumans()
           
protected  void stateDidChange(int state, int oldState)
          Called when the game state changes.
protected  void stopAITicker()
          Stops our AI ticker if it's running.
 void systemMessage(String msgbundle, String msg)
          Sends a system message to the players in the game room.
 void systemMessage(String msgbundle, String msg, boolean waitForStart)
          Sends a system message to the players in the game room.
protected  void tick(long tickStamp)
          Gives game managers an opportunity to perform periodic processing that is not driven by events generated by the player.
protected  void tickAI(int pidx, GameAI ai)
          Called by tickAIs() to tick each AI in the game.
protected  void tickAIs()
          Called by the AI ticker if we're registered as an AI game.
 
Methods inherited from class com.threerings.crowd.server.PlaceManager
addDelegate, addDispatcher, addOccupantInfo, addProvider, applyToDelegates, applyToOccupants, bodyEntered, bodyUpdated, bodyWillEnter, bodyWillLeave, cancelShutdowner, checkPermissions, createPlaceObject, createSpeakHandler, getAccessController, getConfig, getLocation, getPlaceObject, getPlaceObjectClass, idleUnloadPeriod, init, isValidSpeaker, messageReceived, permissionsFailed, ratifyBodyEntry, registerMessageHandler, shouldCreateSpeakService, shouldDeclareEmpty, shutdown, startup, toString, toString, updateOccupantInfo, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_stateListener

protected NamedAttributeListener _stateListener
Listens for game state changes.


_gameconfig

protected GameConfig _gameconfig
A reference to our game config.


_gameobj

protected GameObject _gameobj
A reference to our game object.


_playerCount

protected int _playerCount
The number of players in the game.


_playerOids

protected int[] _playerOids
The oids of our player and AI body objects.


_pendingOids

protected ArrayIntSet _pendingOids
The list of players that have arrived in the room, but are not ready to play.


_AIs

protected GameAI[] _AIs
If AIs are present, contains their configuration, or null at human player indexes.


_startmsgs

protected List<Tuple<String,String>> _startmsgs
If non-null, contains bundles and messages that should be sent as system messages once the game has started.


_committedState

protected int _committedState
The state of the game that has been propagated to our subscribers.


_gameEndTracker

protected RepeatCallTracker _gameEndTracker
TEMP: debugging the pending rating double release bug.


_noShowInterval

protected Interval _noShowInterval
The interval used to check for no-shows.


_postponedStart

protected boolean _postponedStart
Whether we have already postponed the start of the game.


_tickInterval

protected Interval _tickInterval
The interval for the game manager tick.


_aiTicker

protected Interval _aiTicker
The interval for the AI tick.


DEFAULT_NOSHOW_DELAY

protected static final long DEFAULT_NOSHOW_DELAY
The default value returned by getNoShowTime().

See Also:
Constant Field Values

TICK_DELAY

protected static final long TICK_DELAY
The delay in milliseconds between ticking of all game managers.

See Also:
Constant Field Values

AI_TICK_DELAY

protected static final long AI_TICK_DELAY
The frequency with which we dispatch AI game ticks.

See Also:
Constant Field Values
Constructor Detail

GameManager

public GameManager()
Method Detail

getGameConfig

public GameConfig getGameConfig()
Returns the configuration object for the game being managed by this manager.


getGameId

public int getGameId()
Returns the unique numeric identifier for our managed game. See GameConfig.getGameId().


getMatchType

public int getMatchType()
A convenience method for getting the game type.


addPlayer

public int addPlayer(Name player)
Adds the given player to the game at the first available player index. This should only be called before the game is started, and is most likely to be used to add players to party games.

Parameters:
player - the username of the player to add to this game.
Returns:
the player index at which the player was added, or -1 if the player could not be added to the game.

addPlayerAt

public boolean addPlayerAt(Name player,
                           int pidx)
Adds the given player to the game at the specified player index. This should only be called before the game is started, and is most likely to be used to add players to party games.

Parameters:
player - the username of the player to add to this game.
pidx - the player index at which the player is to be added.
Returns:
true if the player was added successfully, false if not.

removePlayer

public boolean removePlayer(Name player)
Removes the given player from the game. This is most likely to be used to allow players involved in a party game to leave the game early-on if they realize they'd rather not play for some reason.

Parameters:
player - the username of the player to remove from this game.
Returns:
true if the player was successfully removed, false if not.

replacePlayer

public void replacePlayer(int pidx,
                          Name player)
Replaces the player at the specified index and calls playerWasReplaced(int, com.threerings.util.Name, com.threerings.util.Name) to let derived classes and delegates know what's going on.


getPlayer

public BodyObject getPlayer(int playerIdx)
Returns the user object for the player with the specified index or null if the player at that index is not online.


setAI

public void setAI(int pidx,
                  GameAI ai)
Sets the specified player as an AI with the specified configuration. It is assumed that this will be set soon after the player names for all AIs present in the game. (It should be done before human players start trickling into the game.)

Parameters:
pidx - the player index of the AI.
ai - the AI configuration.

getPlayerName

public Name getPlayerName(int index)
Returns the name of the player with the specified index or null if no player exists at that index.


getPlayerDisplayName

public Name getPlayerDisplayName(int index)
Returns the name that should be shown in the client for the player with the specified index or null if no player exists at that index. This may be different than their username as returned by getPlayerName(int), which is the player's unique name in the server.


getPlayerIndex

public int getPlayerIndex(Name username)
Returns the player index of the given user in the game, or -1 if the player is not involved in the game.


getPresentPlayerIndex

public int getPresentPlayerIndex(int bodyOid)
Get the player index of the specified oid, or -1 if the oid is not a player or is a player that is not presently in the game.


getPlayerOid

public int getPlayerOid(int index)
Returns the user object oid of the player with the specified index.


getPlayerPersistentId

public int getPlayerPersistentId(Name name)
Returns the persistent user id for the supplied player name.


getPlayerPersistentId

public int getPlayerPersistentId(BodyObject body)
Convenience for getting the persistent id from a body.


getPlayerCount

public int getPlayerCount()
Returns the number of players in the game.


getPlayerSlots

public int getPlayerSlots()
Returns the number of players allowed in this game.


isAI

public boolean isAI(int pidx)
Returns whether the player at the specified player index is an AI.


isActivePlayer

public boolean isActivePlayer(int pidx)
Returns whether the player at the specified player index is actively playing the game


getSessionId

public int getSessionId()
Returns the unique session identifier for this game session.


systemMessage

public void systemMessage(String msgbundle,
                          String msg)
Sends a system message to the players in the game room.


systemMessage

public void systemMessage(String msgbundle,
                          String msg,
                          boolean waitForStart)
Sends a system message to the players in the game room.

Parameters:
waitForStart - if true, the message will not be sent until the game has started.

startGame

public boolean startGame()
This is called when the game is ready to start (all players involved have delivered their "am ready" notifications). It calls gameWillStart(), sets the necessary wheels in motion and then calls gameDidStart(). Derived classes should override one or both of the calldown functions (rather than this function) if they need to do things before or after the game starts.

Returns:
true if the game was started, false if it could not be started because it was already in play or because all players have not yet reported in.

endPlayerGame

public void endPlayerGame(int pidx)
Ends the game for the given player.


endGame

public void endGame()
Called when the game is known to be over. This will call some calldown functions to determine the winner of the game and then transition the game to the GameObject.GAME_OVER state.


cancelGame

public boolean cancelGame()
Sets the state of the game to GameObject.CANCELLED.

Returns:
true if the game was cancelled, false if it was already over or cancelled.

shouldConcludeGame

public boolean shouldConcludeGame()
Returns whether game conclusion antics such as rating updates should be performed when an in-play game is ended. Derived classes may wish to override this method to customize the conditions under which the game is concluded.


resetGame

public void resetGame()
Called when the game is to be reset to its starting state in preparation for a new game without actually ending the current game. It calls gameWillReset() followed by the standard game start processing (gameWillStart() and gameDidStart()). Derived classes should override these calldown functions (rather than this function) if they need to do things before or after the game resets.


occupantInRoom

public void occupantInRoom(BodyObject caller)
Called by the client when an occupant has arrived in the game room and has loaded their bits. Most games will simply call playerReady(com.threerings.crowd.data.BodyObject) but games that wish to delay their actual start until players take some action must report ASAP with a call to occupantInRoom(com.threerings.crowd.data.BodyObject) to let the server know that they have arrived and will later be calling playerReady(com.threerings.crowd.data.BodyObject) when they are ready for the game to actually start.


playerReady

public void playerReady(BodyObject caller)
Called by the client when the player is ready for the game to start. This method is dispatched dynamically by PlaceManager.messageReceived(com.threerings.presents.dobj.MessageEvent).


allPlayersReady

public boolean allPlayersReady()
Returns true if all (non-AI) players have delivered their playerReady(com.threerings.crowd.data.BodyObject) notifications, false if they have not.


playerIsReady

public boolean playerIsReady(int pidx)
Returns true if the player at the specified slot is ready (or if there is meant to be no player in that slot), false if there is meant to be a player in the specified slot and they have not yet reported that they are ready.


isPlayer

public boolean isPlayer(ClientObject client)
Description copied from interface: PlayManager
Return true if the given client is a player in this place.

Specified by:
isPlayer in interface PlayManager

isAgent

public boolean isAgent(ClientObject client)
Description copied from interface: PlayManager
Return true if the given client is a server-side agent in this place.

Specified by:
isAgent in interface PlayManager

checkWritePermission

public BodyObject checkWritePermission(ClientObject client,
                                       int playerId)
Description copied from interface: PlayManager
Make sure that the given caller is a player or an agent and can write to the data of the given playerId.

Specified by:
checkWritePermission in interface PlayManager
Returns:
the resolved player object to write to

needsNoShowTimer

protected boolean needsNoShowTimer()
Returns true if this game requires a no-show timer. The default implementation returns true for non-party games and false for party games. Derived classes may wish to change or augment this behavior.


getNoShowTime

protected long getNoShowTime()
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.


needsAITick

protected boolean needsAITick()
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 periodic ticking which is why ticking is disabled by default.

See Also:
tickAIs()

playerWasAdded

protected void playerWasAdded(Name player,
                              int pidx)
Called when a player was added to the game. Derived classes may override this method to perform any game-specific actions they desire, but should be sure to call super.playerWasAdded().

Parameters:
player - the username of the player added to the game.
pidx - the player index of the player added to the game.

playerWasRemoved

protected void playerWasRemoved(Name player,
                                int pidx)
Called when a player was removed from the game. Derived classes may override this method to perform any game-specific actions they desire, but should be sure to call super.playerWasRemoved().

Parameters:
player - the username of the player removed from the game.
pidx - the player index of the player before they were removed from the game.

playerWasReplaced

protected void playerWasReplaced(int pidx,
                                 Name oldPlayer,
                                 Name newPlayer)
Called when a player has been replaced via a call to replacePlayer(int, com.threerings.util.Name).


reportPlayerKnockedOut

protected void reportPlayerKnockedOut(int pidx)
Report to the knocked-out player's room that they were knocked out.


didInit

protected void didInit()
Overrides:
didInit in class PlaceManager

didStartup

protected void didStartup()
Overrides:
didStartup in class PlaceManager

didShutdown

protected void didShutdown()
Overrides:
didShutdown in class PlaceManager

bodyLeft

protected void bodyLeft(int bodyOid)
Overrides:
bodyLeft in class PlaceManager

placeBecameEmpty

protected void placeBecameEmpty()
When a game room becomes empty, we cancel the game if it's still in progress and close down the game room.

Overrides:
placeBecameEmpty in class PlaceManager

playersAllHere

protected void playersAllHere()
Called when all players have arrived in the game room. By default, this starts up the game, but a manager may wish to override this and start the game according to different criterion.


checkShutdownInterval

protected void checkShutdownInterval()
Overrides:
checkShutdownInterval in class PlaceManager

checkForNoShows

protected void checkForNoShows()
Called after the no-show delay has expired following the delivery of notifications to all players that the game is ready. Note: this is not called for party games. Those games have a human who decides when to start the game.


handlePartialNoShow

protected void handlePartialNoShow()
This is called when some, but not all, players failed to show up for a game. The default implementation simply cancels the game.


startWithoutHumans

protected boolean startWithoutHumans()
Returns:
true if we should start the game even without any humans. Default implementation always returns false.

gameWillStart

protected void gameWillStart()
Called when the game is about to start, but before the game start notification has been delivered to the players. Derived classes should override this if they need to perform some pre-start activities, but should be sure to call super.gameWillStart().


stateDidChange

protected void stateDidChange(int state,
                              int oldState)
Called when the game state changes. This happens after the attribute change event has propagated.

Parameters:
state - the new game state.
oldState - the previous game state.

gameDidStart

protected void gameDidStart()
Called after the game start notification was dispatched. Derived classes can override this to put whatever wheels they might need into motion now that the game is started (if anything other than transitioning the game to GameObject.IN_PLAY is necessary), but should be sure to call super.gameDidStart().


startAITicker

protected void startAITicker()
Starts our AI ticker if it is not already started.


stopAITicker

protected void stopAITicker()
Stops our AI ticker if it's running.


tickAIs

protected void tickAIs()
Called by the AI ticker if we're registered as an AI game.


tickAI

protected void tickAI(int pidx,
                      GameAI ai)
Called by tickAIs() to tick each AI in the game.


announcePlayerGameOver

protected void announcePlayerGameOver(int pidx)
Announce to everyone in the game that a player's game has ended.


getPlayerGameOverMessage

protected String getPlayerGameOverMessage(int pidx)
Gets the untranslated string to show when a player's game has ended.


playerGameDidEnd

protected void playerGameDidEnd(int pidx)
Called when a player has been marked as knocked out but before the knock-out status update has been sent to the players. Any status information that needs be updated in light of the knocked out player can be updated here.


shouldEndGame

protected boolean shouldEndGame()
Called when a player leaves the game in order to determine whether the game should be ended based on its current state, which will include updated player status for the player in question. The default implementation returns true if the game is in play and there is only one player left. Derived classes may wish to override this method in order to customize the required end-game conditions.


assignWinners

protected void assignWinners(boolean[] winners)
Assigns the final winning status for each player to their respect player index in the supplied array. This will be called by endGame() when the game is over. The default implementation marks no players as winners. Derived classes should override this method in order to customize the winning conditions.


gameWillEnd

protected void gameWillEnd()
Called when the game is about to end, but before the game end notification has been delivered to the players. Derived classes should override this if they need to perform some pre-end activities, but should be sure to call super.gameWillEnd().


gameDidEnd

protected void gameDidEnd()
Called after the game has transitioned to the GameObject.GAME_OVER state. Derived classes should override this to perform any post-game activities, but should be sure to call super.gameDidEnd().


gameWasCancelled

protected void gameWasCancelled()
Called to let the manager know that the game was cancelled (and may be about to be shutdown if there's no one in the room). In the base framework a game will only be canceled if no one shows up, so gameWillStart(), etc. will never have been called and thus gameWillEnd(), etc. will not be called. However, if a game chooses to cancel itself for whatever reason, no effort will be made to call endGame() and the game ending call backs so that game can override this method to do anything it needs. Note that didShutdown() will be called in every case and that's generally the best place to free resources so this method may not be needed.


reportWinnersAndLosers

protected void reportWinnersAndLosers()
Report winner and loser oids to each room that any of the winners/losers is in.


gameWillReset

protected void gameWillReset()
Called when the game is about to reset, but before the board has been re-initialized or any other clearing out of game data has taken place. Derived classes should override this if they need to perform some pre-reset activities.


tick

protected void tick(long tickStamp)
Gives game managers an opportunity to perform periodic processing that is not driven by events generated by the player.