Constructor
new JoinRoomRequest(targetRoom, passwordopt, roomIdToLeaveopt, asSpectatoropt)
Creates a new instance of the JoinRoomRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
targetRoom | number | | The id or name or SFSRoom object of the Room to be joined. | ||
password | string | <optional> | null | The password of the Room, in case it is password protected. |
roomIdToLeave | number | <optional> | null | 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 | boolean | <optional> | false | If true, Room is joined as a Spectator (in Game Rooms only). |