Package sfs3.client.requests
Class JoinRoomRequest
java.lang.Object
sfs3.client.requests.BaseRequest
sfs3.client.requests.JoinRoomRequest
- All Implemented Interfaces:
sfs3.client.requests.IClientRequest
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class sfs3.client.requests.BaseRequest
AddBuddy, AdminMessage, AutoJoin, BanUser, BanUsersFromRoom, BlockBuddy, CallExtension, ChangeRoomCapacity, ChangeRoomName, ChangeRoomPassword, ClusterInviteUsers, ClusterJoinOrCreate, CreateRoom, CreateSFSGame, FindRooms, FindUsers, GameServerConnectionRequired, GenericMessage, GetRoomList, GoOnline, Handshake, InitBuddyList, InvitationReply, InviteUser, JoinRoom, JoinRoomInvite, KEY_ERROR_CODE, KEY_ERROR_PARAMS, KickUser, LeaveRoom, Login, Logout, ManualDisconnection, ModeratorMessage, ObjectMessage, PingPong, PlayerToSpectator, PrivateMessage, PublicMessage, QuickJoinGame, QuickJoinOrCreateRoom, RemoveBuddy, SetBuddyVariables, SetRoomVariables, SetUserPosition, SetUserVariables, sfso, SpectatorToPlayer, SubscribeRoomGroup, targetController, UdpInit, UnsubscribeRoomGroup -
Constructor Summary
ConstructorsConstructorDescriptionJoinRoomRequest(Object id, String pass) JoinRoomRequest(Object id, String pass, Integer roomIdToLeave) JoinRoomRequest(Object id, String pass, Integer roomIdToLeave, boolean asSpectator) Creates a new JoinRoomRequest instance. -
Method Summary
Methods inherited from class sfs3.client.requests.BaseRequest
getId, getRequest, getTargetController, getTransportType, setId, setTargetController, setTransportType
-
Field Details
-
KEY_ROOM
- See Also:
- Internal
-
KEY_USER_LIST
- See Also:
- Internal
-
KEY_ROOM_NAME
- See Also:
- Internal
-
KEY_ROOM_ID
- See Also:
- Internal
-
KEY_PASS
- See Also:
- Internal
-
KEY_ROOM_TO_LEAVE
- See Also:
- Internal
-
KEY_AS_SPECTATOR
- See Also:
- Internal
-
-
Constructor Details
-
JoinRoomRequest
Creates a new JoinRoomRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.- Parameters:
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-trueto join the Room as a spectator (in Game Rooms only).- See Also:
-
JoinRoomRequest
- See Also:
-
JoinRoomRequest
- See Also:
-
JoinRoomRequest
- See Also:
-
-
Method Details
-
validate
- Throws:
SFSValidationException- Internal
-
execute
- Internal
-