|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsfs2x.client.requests.BaseRequest
sfs2x.client.requests.JoinRoomRequest
public class JoinRoomRequest
Joins the current user in a Room.
If the operation is successful, the current user receives a roomJoin event; otherwise the roomJoinError event is fired. This usually happens when the Room is full, or the password is wrong in case of password protected Rooms.
Depending on the Room configuration defined upon its creation (see the RoomSettings.events setting), when the current user joins it, the following events might be fired: userEnterRoom, dispatched to the other users inside the Room to warn them that a new user has arrived; userCountChange, dispatched to all clients which subscribed the Group to which the Room belongs, to update the count of users inside the Room.
Example
RoomSettings.getEvents(),
SFSEvent.ROOM_JOIN,
SFSEvent.ROOM_JOIN_ERROR,
SFSEvent.USER_ENTER_ROOM,
SFSEvent.USER_COUNT_CHANGE| Field Summary | |
|---|---|
static java.lang.String |
KEY_AS_SPECTATOR
*Private* |
static java.lang.String |
KEY_PASS
*Private* |
static java.lang.String |
KEY_ROOM
*Private* |
static java.lang.String |
KEY_ROOM_ID
*Private* |
static java.lang.String |
KEY_ROOM_NAME
*Private* |
static java.lang.String |
KEY_ROOM_TO_LEAVE
*Private* |
static java.lang.String |
KEY_USER_LIST
*Private* |
| Fields inherited from class sfs2x.client.requests.BaseRequest |
|---|
AddBuddy, AdminMessage, AutoJoin, BanUser, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, CreateRoom, CreateSFSGame, FindRooms, FindUsers, GenericMessage, GetRoomList, GoOnline, Handshake, InitBuddyList, InvitationReply, InviteUser, JoinRoom, KEY_ERROR_CODE, KEY_ERROR_PARAMS, KickUser, LeaveRoom, Login, Logout, ManualDisconnection, ModeratorMessage, ObjectMessage, PingPong, PlayerToSpectator, PrivateMessage, PublicMessage, QuickJoinGame, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserVariables, SpectatorToPlayer, SubscribeRoomGroup, UnsubscribeRoomGroup |
| Constructor Summary | |
|---|---|
JoinRoomRequest(java.lang.Object id)
|
|
JoinRoomRequest(java.lang.Object id,
java.lang.String pass)
|
|
JoinRoomRequest(java.lang.Object id,
java.lang.String pass,
java.lang.Integer roomIdToLeave)
|
|
JoinRoomRequest(java.lang.Object id,
java.lang.String pass,
java.lang.Integer roomIdToLeave,
boolean asSpectator)
Creates a new JoinRoomRequest instance. |
|
| Method Summary | |
|---|---|
void |
execute(SmartFox sfs)
*Private* |
void |
validate(SmartFox sfs)
*Private* |
| Methods inherited from class sfs2x.client.requests.BaseRequest |
|---|
getId, getMessage, getTargetController, isEncrypted, setEncrypted, setId, setTargetController |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String KEY_ROOM
public static final java.lang.String KEY_USER_LIST
public static final java.lang.String KEY_ROOM_NAME
public static final java.lang.String KEY_ROOM_ID
public static final java.lang.String KEY_PASS
public static final java.lang.String KEY_ROOM_TO_LEAVE
public static final java.lang.String KEY_AS_SPECTATOR
| Constructor Detail |
|---|
public JoinRoomRequest(java.lang.Object id,
java.lang.String pass,
java.lang.Integer roomIdToLeave,
boolean asSpectator)
id - The id or the name of the Room to be joined.pass - The password of the Room, in case it is password protected.roomIdToLeave - The id of a previously joined Room that the user should leave when joining the new Room.
By default, the last joined Room is left; if a negative number is passed, no previous Room is left.asSpectator - true to join the Room as a spectator (in Game Rooms only).SmartFox.send(sfs2x.client.requests.IRequest)
public JoinRoomRequest(java.lang.Object id,
java.lang.String pass,
java.lang.Integer roomIdToLeave)
public JoinRoomRequest(java.lang.Object id,
java.lang.String pass)
public JoinRoomRequest(java.lang.Object id)
| Method Detail |
|---|
public void validate(SmartFox sfs)
throws sfs2x.client.exceptions.SFSValidationException
sfs2x.client.exceptions.SFSValidationExceptionpublic void execute(SmartFox sfs)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||