switchSpectator()

Availability:

SmartFoxServer Basic / Pro

Usage:

smartFox.switchSpectator(roomId <integer>)

Description:

Turns a spectator into a player in a game room.

Parameters:

roomId   (optional) the id of the room in which you want to make the switch. By default the client API use the current room.
You can pass this extra parameter if you're keeping the user logged in more than one room at the same time.

Returns:

Fires the onSpectatorSwitched event

Example:

smartFox.switchSpectator()

See also:

onRoomVariablesUpdate