com.threerings.parlor.server
Class ParlorManager

java.lang.Object
  extended by com.threerings.parlor.server.ParlorManager
All Implemented Interfaces:
ParlorCodes, ParlorProvider, com.threerings.presents.data.InvocationCodes, com.threerings.presents.server.InvocationProvider

public class ParlorManager
extends Object
implements ParlorCodes, ParlorProvider

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.


Field Summary
 
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(com.threerings.presents.server.InvocationManager invmgr)
           
 
Method Summary
 void cancel(com.threerings.presents.data.ClientObject caller, int inviteId, com.threerings.presents.client.InvocationService.InvocationListener listener)
          Handles a ParlorService.cancel(int, com.threerings.presents.client.InvocationService.InvocationListener) request.
 void cancelInvite(com.threerings.crowd.data.BodyObject source, int inviteId)
          Requests that an outstanding invitation be cancelled.
 int invite(com.threerings.crowd.data.BodyObject inviter, com.threerings.crowd.data.BodyObject invitee, GameConfig config)
          Issues an invitation from the inviter to the invitee for a game as described by the supplied config object.
 void invite(com.threerings.presents.data.ClientObject caller, com.threerings.util.Name invitee, GameConfig config, ParlorService.InviteListener listener)
          Handles a ParlorService.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) request.
 void respond(com.threerings.presents.data.ClientObject caller, int inviteId, int code, Object arg, com.threerings.presents.client.InvocationService.InvocationListener listener)
          Handles a ParlorService.respond(int, int, java.lang.Object, com.threerings.presents.client.InvocationService.InvocationListener) request.
 void respondToInvite(com.threerings.crowd.data.BodyObject source, int inviteId, int code, Object arg)
          Effects a response to an invitation (accept, refuse or counter), made by the specified source user with the specified arguments.
 void startSolitaire(com.threerings.presents.data.ClientObject caller, GameConfig config, com.threerings.presents.client.InvocationService.ConfirmListener listener)
          Handles a ParlorService.startSolitaire(com.threerings.parlor.game.data.GameConfig, com.threerings.presents.client.InvocationService.ConfirmListener) request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParlorManager

@Inject
public ParlorManager(com.threerings.presents.server.InvocationManager invmgr)
Method Detail

invite

public void invite(com.threerings.presents.data.ClientObject caller,
                   com.threerings.util.Name invitee,
                   GameConfig config,
                   ParlorService.InviteListener listener)
            throws com.threerings.presents.server.InvocationException
Description copied from interface: ParlorProvider
Handles a ParlorService.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) request.

Specified by:
invite in interface ParlorProvider
Throws:
com.threerings.presents.server.InvocationException

respond

public void respond(com.threerings.presents.data.ClientObject caller,
                    int inviteId,
                    int code,
                    Object arg,
                    com.threerings.presents.client.InvocationService.InvocationListener listener)
Description copied from interface: ParlorProvider
Handles a ParlorService.respond(int, int, java.lang.Object, com.threerings.presents.client.InvocationService.InvocationListener) request.

Specified by:
respond in interface ParlorProvider

cancel

public void cancel(com.threerings.presents.data.ClientObject caller,
                   int inviteId,
                   com.threerings.presents.client.InvocationService.InvocationListener listener)
Description copied from interface: ParlorProvider
Handles a ParlorService.cancel(int, com.threerings.presents.client.InvocationService.InvocationListener) request.

Specified by:
cancel in interface ParlorProvider

startSolitaire

public void startSolitaire(com.threerings.presents.data.ClientObject caller,
                           GameConfig config,
                           com.threerings.presents.client.InvocationService.ConfirmListener listener)
                    throws com.threerings.presents.server.InvocationException
Description copied from interface: ParlorProvider
Handles a ParlorService.startSolitaire(com.threerings.parlor.game.data.GameConfig, com.threerings.presents.client.InvocationService.ConfirmListener) request.

Specified by:
startSolitaire in interface ParlorProvider
Throws:
com.threerings.presents.server.InvocationException

invite

public int invite(com.threerings.crowd.data.BodyObject inviter,
                  com.threerings.crowd.data.BodyObject invitee,
                  GameConfig config)
           throws com.threerings.presents.server.InvocationException
Issues an invitation from the inviter to the invitee for a game as described by the supplied config object.

Parameters:
inviter - the player initiating the invitation.
invitee - the player being invited.
config - the configuration of the game being proposed.
Returns:
the invitation identifier for the newly created invitation record.
Throws:
com.threerings.presents.server.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.

respondToInvite

public void respondToInvite(com.threerings.crowd.data.BodyObject source,
                            int inviteId,
                            int code,
                            Object arg)
Effects a response to an invitation (accept, refuse or counter), made by the specified source user with the specified arguments.

Parameters:
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.

cancelInvite

public void cancelInvite(com.threerings.crowd.data.BodyObject source,
                         int inviteId)
Requests that an outstanding invitation be cancelled.

Parameters:
source - the body object of the user that is making the request.
inviteId - the unique id of the invitation to be cancelled.


Copyright © 2011. All Rights Reserved.