_server.switchSpectator()

Availability:

SmartFoxServer PRO 1.4.0

Usage:

_server.switchSpectator(user, roomId, broadcastAll)

Description:

Switch a spectator into a player, if possible (game rooms only). This method is the equivalent of the switchSpectator() function of the client side API.

Properties:

user   the user to switch
roomId   the id of the room where the switch should be done
broadcastAll   (optional) boolean flag. If true the onSpectatorSwitched() event will be fired. By default

Returns:

Nothing

Example:

// Switch a user into a player
_server.switchSpectator(theUser, theRoomId)

See also: