_server.setRoomVariables()
Availability:
SmartFoxServer PRO 1.4.0
Usage:
_server.setRoomVariables(room, who, varList, setOwnership, sendUpdate)
Description:
Set one or more Room Variables from the server side
Properties:
| room | the Room where the variables should be set |
|||||||||||||
| who | the User who wants to perform the action (null for Server owned variables) | |||||||||||||
| varList | a list of objects representing each variable. Each object has the following properties:
|
|||||||||||||
| setOwnership | an optional boolean flag. By deafult is set to true. Set it to false to avoid to change the ownership of the variable(s) | |||||||||||||
| sendUpdate | an optional boolean flag. By deafult is set to true. Set it to false to avoid sending an update to all clients in the room where the variables were changed. |
Returns:
nothing
Example:
Example #1
var rVars = []
rVars.push( {name:"bestTime", val:100, priv:true} )
rVars.push( {name:"bestLap", val:120} )
// Set the variables
_server.setRoomVariables(roomObj, userObj, rVars)
var rVars = []
rVars.push( {name:"highscore", val:12000, priv:true} )
// Set the variables
_server.setRoomVariables(roomObj, null, rVars)
See also: