createRoom()
Availability:
SmartFoxServer Lite / Basic / Pro
Usage:
smartFox.createRoom(roomObj <propList>, roomId <integer>)
Description:
Dynamically create a new room in the current zone.
The roomId parameter is optional and only needed for advanced tasks, when using multiple room at the same time.
Parameters:
A proplist with the following properties:name | the room name | |||||||
password | a password for the room (optional) | |||||||
maxUsers | the max. number of users for that room | |||||||
maxSpectators | the max. number of spectator slots (only for game rooms ) | |||||||
isGame | a boolean, true if the game is a game room | |||||||
exitCurrentRoom | a boolean value. It can be used when creating a new game room. By default when a new game rooms is launched, its creator is auto-joined inside the room leaving the one he was in before. If you don't want to leave the old room you should set this property to false. |
|||||||
uCount | a boolean, indicating if the new room will receive the uCount update
messages. The uCount messages are updates about the number of users in each room of the zone. If you're not handling them in the current room it is reccomended to turn it off. |
|||||||
vars | a list of room variables (see below) | |||||||
extension | an optional proplist. Specifies which extension should be dynamically attached to the room. The extension must be a Room-level extension. The object should contain the following properties:
|
name | variable name | |
val | variable value | |
priv | boolean, true if the variable is private | |
persistent | boolean, true if the variable is persistent |
Returns:
Nothing.
Example:
room = [#name:"Room name", #password:"", #maxUsers:100, #isGame:false, #exitCurrentRoom:true, #uCount:false, #vars:[[#name:"energy", #val:100, #priv:false, #persistent:false]], #extension:[:]] smartFox.createRoom(room)
See also:
onRoomAdded(), onCreateRoomError()