com.threerings.parlor.server
Class PlayManagerDelegate

java.lang.Object
  extended by com.threerings.crowd.server.PlaceManagerDelegate
      extended by com.threerings.parlor.server.PlayManagerDelegate
Direct Known Subclasses:
GameManagerDelegate

public class PlayManagerDelegate
extends PlaceManagerDelegate

The base class for any delegate that wishes to service both GameManager games and AVRGameManager games -- or, in fact, any PlaceManager that implements PlayManager.


Field Summary
protected  PlayManager _gmgr
          A reference to our manager.
 
Fields inherited from class com.threerings.crowd.server.PlaceManagerDelegate
_invmgr, _omgr, _plmgr
 
Constructor Summary
PlayManagerDelegate()
           
 
Method Summary
 void didInit(PlaceConfig config)
           
protected  boolean isAgent(ClientObject occupant)
          Returns true if the supplied occupant is an agent, false if not.
protected  boolean isPlayer(ClientObject occupant)
          Returns true if the supplied occupant is a player, false if not.
protected  void verifyIsPlayer(ClientObject caller)
          Checks that the caller in question is a player if the game is not a party game.
protected  void verifyIsPlayerOrAgent(ClientObject caller)
          Checks that the caller in question is a player if the game is not a party game or an agent for games that use server-side code.
protected  BodyObject verifyWritePermission(ClientObject caller, int playerId)
          Make sure that the given caller is a player or an agent and can write to the data of the given playerId.
 
Methods inherited from class com.threerings.crowd.server.PlaceManagerDelegate
addDispatcher, addProvider, bodyEntered, bodyLeft, bodyUpdated, didShutdown, didStartup, init, placeBecameEmpty, where
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_gmgr

protected PlayManager _gmgr
A reference to our manager.

Constructor Detail

PlayManagerDelegate

public PlayManagerDelegate()
Method Detail

didInit

public void didInit(PlaceConfig config)
Overrides:
didInit in class PlaceManagerDelegate

isPlayer

protected boolean isPlayer(ClientObject occupant)
Returns true if the supplied occupant is a player, false if not.


isAgent

protected boolean isAgent(ClientObject occupant)
Returns true if the supplied occupant is an agent, false if not.


verifyIsPlayer

protected void verifyIsPlayer(ClientObject caller)
                       throws InvocationException
Checks that the caller in question is a player if the game is not a party game.

Throws:
InvocationException

verifyIsPlayerOrAgent

protected void verifyIsPlayerOrAgent(ClientObject caller)
                              throws InvocationException
Checks that the caller in question is a player if the game is not a party game or an agent for games that use server-side code.

Throws:
InvocationException

verifyWritePermission

protected BodyObject verifyWritePermission(ClientObject caller,
                                           int playerId)
                                    throws InvocationException
Make sure that the given caller is a player or an agent and can write to the data of the given playerId.

Returns:
the resolved player object to write to
Throws:
InvocationException