|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.parlor.server.ParlorManager
public class ParlorManager
The parlor manager is responsible for the parlor services in aggregate. This includes maintaining the registry of active games, handling the necessary coordination for the matchmaking services and anything else that falls outside the scope of an actual in-progress game.
| Nested Class Summary | |
|---|---|
protected static class |
ParlorManager.Invitation
The invitation record is used by the parlor manager to keep track of pending invitations. |
| Field Summary | |
|---|---|
protected IntMap<ParlorManager.Invitation> |
_invites
The table of pending invitations. |
protected BodyLocator |
_locator
Used to look body objects up by name. |
protected static int |
_nextInviteId
A counter used to generate unique identifiers for invitation records. |
protected PlaceRegistry |
_plreg
The place registry with which we operate. |
| 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.presents.data.InvocationCodes |
|---|
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR |
| Constructor Summary | |
|---|---|
ParlorManager(InvocationManager invmgr)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Inject protected PlaceRegistry _plreg
@Inject protected BodyLocator _locator
protected IntMap<ParlorManager.Invitation> _invites
protected static int _nextInviteId
| Constructor Detail |
|---|
@Inject public ParlorManager(InvocationManager invmgr)
| Method Detail |
|---|
public void invite(ClientObject caller,
Name invitee,
GameConfig config,
ParlorService.InviteListener listener)
throws InvocationException
ParlorProviderParlorService.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) request.
invite in interface ParlorProviderInvocationException
public void respond(ClientObject caller,
int inviteId,
int code,
Object arg,
InvocationService.InvocationListener listener)
ParlorProviderParlorService.respond(int, int, java.lang.Object, com.threerings.presents.client.InvocationService.InvocationListener) request.
respond in interface ParlorProvider
public void cancel(ClientObject caller,
int inviteId,
InvocationService.InvocationListener listener)
ParlorProviderParlorService.cancel(int, com.threerings.presents.client.InvocationService.InvocationListener) request.
cancel in interface ParlorProvider
public void startSolitaire(ClientObject caller,
GameConfig config,
InvocationService.ConfirmListener listener)
throws InvocationException
ParlorProviderParlorService.startSolitaire(com.threerings.parlor.game.data.GameConfig, com.threerings.presents.client.InvocationService.ConfirmListener) request.
startSolitaire in interface ParlorProviderInvocationException
public int invite(BodyObject inviter,
BodyObject invitee,
GameConfig config)
throws InvocationException
inviter to the invitee for a game as
described by the supplied config object.
inviter - the player initiating the invitation.invitee - the player being invited.config - the configuration of the game being proposed.
InvocationException - thrown if the invitation was not able to be processed for
some reason (like the invited player has requested not to be disturbed). The explanation
will be provided in the message data of the exception.
public void respondToInvite(BodyObject source,
int inviteId,
int code,
Object arg)
source - the body object of the user that is issuing this response.inviteId - the identifier of the invitation to which we are responding.code - the response code (either ParlorCodes.INVITATION_ACCEPTED, ParlorCodes.INVITATION_REFUSED or ParlorCodes.INVITATION_COUNTERED).arg - the argument that goes along with the response: an explanatory message in the
case of a refusal (the empty string, not null, if no message was provided) or the new game
configuration in the case of a counter-invitation.
public void cancelInvite(BodyObject source,
int inviteId)
source - the body object of the user that is making the request.inviteId - the unique id of the invitation to be cancelled.protected void processAcceptedInvitation(ParlorManager.Invitation invite)
protected void createGameManager(GameConfig config)
throws InstantiationException,
InvocationException
InstantiationException
InvocationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||