Package sfs3.client.requests
Class PlayerToSpectatorRequest
java.lang.Object
sfs3.client.requests.BaseRequest
sfs3.client.requests.PlayerToSpectatorRequest
- All Implemented Interfaces:
sfs3.client.requests.IClientRequest
Turns the current user from player to spectator in a Game Room.
If the operation is successful, all the users in the target Room are notified with the playerToSpectator event. The operation could fail if no spectator slots are available in the Game Room at the time of the request; in this case the playerToSpectatorError event is dispatched to the requester's client.
- See Also:
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionPlayerToSpectatorRequest(Room targetRoom) Creates a new PlayerToSpectatorRequest instance. -
Method Summary
Methods inherited from class sfs3.client.requests.BaseRequest
getId, getRequest, getTargetController, getTransportType, setId, setTargetController, setTransportType
-
Field Details
-
KEY_ROOM_ID
- See Also:
- Internal
-
KEY_USER_ID
- See Also:
- Internal
-
-
Constructor Details
-
PlayerToSpectatorRequest
Creates a new PlayerToSpectatorRequest instance. The instance must be passed to the SmartFox.send() method for the request to be performed.- Parameters:
targetRoom- The Room object corresponding to the Room in which the player should be turned to spectator. Ifnull, the last Room joined by the user is used.- See Also:
-
PlayerToSpectatorRequest
public PlayerToSpectatorRequest()- See Also:
-
-
Method Details
-
validate
- Throws:
SFSValidationException- Internal
-
execute
- Internal
-