|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.parlor.client.Invitation
public class Invitation
The invitation class is used to track information related to outstanding invitations generated by or targeted to this client.
| Field Summary | |
|---|---|
protected boolean |
_cancelled
A flag indicating that we were requested to cancel this invitation before we even heard back with an acknowledgement that it was received by the server. |
protected ParlorContext |
_ctx
Provides access to client services. |
protected InvitationResponseObserver |
_observer
The entity to notify when we receive a response for this invitation. |
protected ParlorService |
_pservice
Provides access to parlor services. |
GameConfig |
config
The configuration of the game to be created. |
int |
inviteId
The unique id for this invitation (as assigned by the server). |
Name |
opponent
The name of the other user involved in this invitation. |
| 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 | |
|---|---|
Invitation(ParlorContext ctx,
ParlorService pservice,
Name opponent,
GameConfig config,
InvitationResponseObserver observer)
Constructs a new invitation record. |
|
| Method Summary | |
|---|---|
void |
accept()
Accepts this invitation. |
void |
cancel()
Cancels this invitation. |
void |
counter(GameConfig config,
InvitationResponseObserver observer)
Counters this invitation with an invitation with different game configuration parameters. |
void |
inviteReceived(int inviteId)
Called in response to a successful ParlorService.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) request. |
protected void |
receivedResponse(int code,
Object arg)
Called by the parlor director when we receive a response to an invitation initiated by this client. |
void |
refuse(String message)
Refuses this invitation. |
void |
requestFailed(String reason)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int inviteId
public Name opponent
public GameConfig config
protected ParlorContext _ctx
protected ParlorService _pservice
protected InvitationResponseObserver _observer
protected boolean _cancelled
| Constructor Detail |
|---|
public Invitation(ParlorContext ctx,
ParlorService pservice,
Name opponent,
GameConfig config,
InvitationResponseObserver observer)
| Method Detail |
|---|
public void accept()
public void refuse(String message)
message - the message to deliver to the inviting user
explaining the reason for the refusal or null if no message is to
be provided.public void cancel()
public void counter(GameConfig config,
InvitationResponseObserver observer)
config - the updated game configuration.observer - the entity that will be notified if this
counter-invitation is accepted, refused or countered.public void inviteReceived(int inviteId)
ParlorService.InviteListenerParlorService.invite(com.threerings.util.Name, com.threerings.parlor.game.data.GameConfig, com.threerings.parlor.client.ParlorService.InviteListener) request.
inviteReceived in interface ParlorService.InviteListenerpublic void requestFailed(String reason)
requestFailed in interface InvocationService.InvocationListener
protected void receivedResponse(int code,
Object arg)
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||