The RoomVariable class is used to represent variables maintained on the Server side and automatically updated to the clients.
Namespace: Sfs2X.Entities.VariablesAssembly: SmartFox2 (in SmartFox2.dll) Version: 0.9.14.0
Syntax
| C# |
|---|
public class SFSRoomVariable : SFSUserVariable, RoomVariable, UserVariable |
Remarks
They are particularly useful to "attach" any custom data to each Room such as the current game status and other Room-specific properties etc...
RoomVariables support basic data types and nested complex objects:
- Null
- Bool
- Int
- Double
- String
- SFSObject
- SFSArray
- Private: a private variable can only be modified by its creator
- Persistent: a persistent variable will continue to exist even if its creator has left the room.
- Global: a global variable will fire updates not only to all Users in the Room but also to all Users in the Room Group
Inheritance Hierarchy
System..::..Object
Sfs2X.Entities.Variables..::..SFSUserVariable
Sfs2X.Entities.Variables..::..SFSRoomVariable
Sfs2X.Entities.Variables..::..SFSUserVariable
Sfs2X.Entities.Variables..::..SFSRoomVariable