SpectatorToPlayerRequest

Turns the User from Spectator to Player in a Game Room.


If the operation is successful, all the Users in the target Room are notified through the SFSEvent.SPECTATOR_TO_PLAYER event. The operation may fail if no Player slots are available in the target Game Room at the time of the request; in this case the SFSEvent.SPECTATOR_TO_PLAYER_ERROR event is dispatched to the requester client.

Constructor

new SpectatorToPlayerRequest(targetRoomopt)

Creates a new instance of the SpectatorToPlayerRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
targetRoomSFSRoom<optional>
nullThe object representing the Room in which the Spectator should be turned to Player; if null, the last Room joined by the User is used.