com.threerings.parlor.client
Interface ParlorService

All Superinterfaces:
InvocationService
All Known Implementing Classes:
ParlorMarshaller

public interface ParlorService
extends InvocationService

Provides an interface to the various parlor invocation services. Presently these services are limited to the various matchmaking mechanisms. It is unlikely that client code will want to make direct use of this class, instead they would make use of the programmatic interface provided by the ParlorDirector.


Nested Class Summary
static interface ParlorService.InviteListener
          Used to communicate responses to invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) requests.
 
Nested classes/interfaces inherited from interface com.threerings.presents.client.InvocationService
InvocationService.ConfirmListener, InvocationService.InvocationListener, InvocationService.ResultListener
 
Method Summary
 void cancel(int inviteId, InvocationService.InvocationListener listener)
          You probably don't want to call this directly, but want to call Invitation.cancel().
 void invite(Name invitee, GameConfig config, ParlorService.InviteListener listener)
          You probably don't want to call this directly, but want to generate your invitation request via ParlorDirector.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.InvitationResponseObserver).
 void respond(int inviteId, int code, Object arg, InvocationService.InvocationListener listener)
          You probably don't want to call this directly, but want to call one of Invitation.accept(), Invitation.refuse(java.lang.String), or Invitation.counter(com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.InvitationResponseObserver).
 void startSolitaire(GameConfig config, InvocationService.ConfirmListener listener)
          Requests to start a single player game with the specified game configuration.
 

Method Detail

invite

void invite(Name invitee,
            GameConfig config,
            ParlorService.InviteListener listener)
You probably don't want to call this directly, but want to generate your invitation request via ParlorDirector.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.InvitationResponseObserver). Requests that an invitation be delivered to the named user, requesting that they join the inviting user in a game, the details of which are specified in the supplied game config object.

Parameters:
invitee - the username of the user to be invited.
config - a game config object detailing the type and configuration of the game to be created.
listener - will receive and process the response.

respond

void respond(int inviteId,
             int code,
             Object arg,
             InvocationService.InvocationListener listener)
You probably don't want to call this directly, but want to call one of Invitation.accept(), Invitation.refuse(java.lang.String), or Invitation.counter(com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.InvitationResponseObserver). Requests that an invitation response be delivered with the specified parameters.

Parameters:
inviteId - the unique id previously assigned by the server to this invitation.
code - the response code to use in responding to the invitation.
arg - the argument associated with the response (a string message from the player explaining why the response was refused in the case of an invitation refusal or an updated game configuration object in the case of a counter-invitation, or null in the case of an accepted invitation).
listener - will receive and process the response.

cancel

void cancel(int inviteId,
            InvocationService.InvocationListener listener)
You probably don't want to call this directly, but want to call Invitation.cancel(). Requests that an outstanding invitation be cancelled.

Parameters:
inviteId - the unique id previously assigned by the server to this invitation.
listener - will receive and process the response.

startSolitaire

void startSolitaire(GameConfig config,
                    InvocationService.ConfirmListener listener)
Requests to start a single player game with the specified game configuration.