|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.presents.client.BasicDirector
com.threerings.parlor.client.ParlorDirector
public class ParlorDirector
The parlor director manages the client side of the game configuration and matchmaking processes. It is also the entity that is listening for game start notifications which it then dispatches the client entity that will actually create and display the user interface for the game that started.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.threerings.presents.client.InvocationReceiver |
|---|
com.threerings.presents.client.InvocationReceiver.Registration |
| 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 | |
|---|---|
ParlorDirector(ParlorContext ctx)
Constructs a parlor director and provides it with the parlor context that it can use to access the client services that it needs to provide its own services. |
|
| Method Summary | |
|---|---|
void |
addGameReadyObserver(GameReadyObserver observer)
Adds the specified observer to the list of entities that are notified when we receive a game ready notification. |
void |
clientDidLogoff(com.threerings.presents.client.Client client)
|
void |
gameIsReady(int gameOid)
Dispatched to the client when a game in which they are a participant is ready for play. |
Invitation |
invite(com.threerings.util.Name invitee,
GameConfig config,
InvitationResponseObserver observer)
Requests that the named user be invited to a game described by the supplied game config. |
void |
receivedInvite(int remoteId,
com.threerings.util.Name inviter,
GameConfig config)
Called by the invocation services when another user has invited us to play a game. |
void |
receivedInviteCancellation(int remoteId)
Called by the invocation services when an outstanding invitation has been cancelled by the inviting user. |
void |
receivedInviteResponse(int remoteId,
int code,
Object arg)
Called by the invocation services when another user has responded to our invitation by either accepting, refusing or countering it. |
void |
removeGameReadyObserver(GameReadyObserver observer)
Removes the specified observer from the list of entities that are notified when we receive a game ready notification. |
void |
setInvitationHandler(InvitationHandler handler)
Sets the invitation handler, which is the entity that will be notified when we receive incoming invitation notifications and when invitations have been cancelled. |
void |
startSolitaire(GameConfig config,
com.threerings.presents.client.InvocationService.ConfirmListener listener)
Requests that the specified single player game be started. |
| Methods inherited from class com.threerings.presents.client.BasicDirector |
|---|
clientDidLogon, clientObjectDidChange, clientWillLogon, isAvailableInStandalone, setAvailableInStandalone |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ParlorDirector(ParlorContext ctx)
ctx - the parlor context in use by the client.| Method Detail |
|---|
public void setInvitationHandler(InvitationHandler handler)
handler - our new invitation handler.public void addGameReadyObserver(GameReadyObserver observer)
public void removeGameReadyObserver(GameReadyObserver observer)
public Invitation invite(com.threerings.util.Name invitee,
GameConfig config,
InvitationResponseObserver observer)
invitee - the user to invite.config - the configuration of the game to which the user is being invited.observer - the entity that will be notified if this invitation is accepted, refused or
countered.
public void startSolitaire(GameConfig config,
com.threerings.presents.client.InvocationService.ConfirmListener listener)
config - the configuration of the single player game to be started.listener - a listener to be informed of failure if the game cannot be started.public void clientDidLogoff(com.threerings.presents.client.Client client)
clientDidLogoff in interface com.threerings.presents.client.SessionObserverclientDidLogoff in class com.threerings.presents.client.BasicDirectorpublic void gameIsReady(int gameOid)
ParlorReceiver
gameIsReady in interface ParlorReceivergameOid - the object id of the game object.
public void receivedInvite(int remoteId,
com.threerings.util.Name inviter,
GameConfig config)
ParlorReceiver
receivedInvite in interface ParlorReceiverremoteId - the unique indentifier for this invitation (used
when countering or responding).inviter - the username of the inviting user.config - the configuration information for the game to which
we've been invited.
public void receivedInviteResponse(int remoteId,
int code,
Object arg)
ParlorReceiver
receivedInviteResponse in interface ParlorReceiverremoteId - the indentifier for the invitation on question.code - the response code, either ParlorCodes.INVITATION_ACCEPTED or ParlorCodes.INVITATION_REFUSED or ParlorCodes.INVITATION_COUNTERED.arg - in the case of a refused invitation, a string
containing a message provided by the invited user explaining the
reason for refusal (the empty string if no explanation was
provided). In the case of a countered invitation, a new game config
object with the modified game configuration.public void receivedInviteCancellation(int remoteId)
ParlorReceiver
receivedInviteCancellation in interface ParlorReceiverremoteId - the indentifier of the cancelled invitation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||