Click or drag to resize

SFSRoomVariable Class

The SFSRoomVariable object represents a SmartFoxServer Room Variable entity on the client.
Inheritance Hierarchy
SystemObject
  Sfs2X.Entities.VariablesBaseVariable
    Sfs2X.Entities.VariablesSFSRoomVariable

Namespace:  Sfs2X.Entities.Variables
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: 1.8.0.0 (1.8.0)
Syntax
C#
public class SFSRoomVariable : BaseVariable, 
	RoomVariable, Variable

The SFSRoomVariable type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyIsPersistent
Indicates whether this Room Variable is persistent or not.
Public propertyIsPrivate
Indicates whether this Room Variable is private or not.
Public propertyName
Indicates the name of this variable.
(Inherited from BaseVariable.)
Public propertyType
Indicates the type of this variable.
(Inherited from BaseVariable.)
Public propertyValue
Returns the untyped value of this variable.
(Inherited from BaseVariable.)
Top
Methods
  NameDescription
Public methodGetBoolValue
Retrieves the value of a boolean variable.
(Inherited from BaseVariable.)
Public methodGetDoubleValue
Retrieves the value of a double precision variable.
(Inherited from BaseVariable.)
Public methodGetIntValue
Retrieves the value of an integer variable.
(Inherited from BaseVariable.)
Public methodGetSFSArrayValue
Retrieves the value of a SFSArray variable.
(Inherited from BaseVariable.)
Public methodGetSFSObjectValue
Retrieves the value of a SFSObject variable.
(Inherited from BaseVariable.)
Public methodGetStringValue
Retrieves the value of a string variable.
(Inherited from BaseVariable.)
Public methodIsNull
Indicates if the variable is null.
(Inherited from BaseVariable.)
Public methodToString
Returns a string that contains the Room Variable name, type, value and isPrivate flag.
(Overrides ObjectToString.)
Top
Remarks
This is a custom value attached to a Room object that gets automatically synchronized between client and server on every change.

Room Variables are particularly useful to store custom Room data such as a game status and other Room-level informations. Room Variables can be set by means of the SetRoomVariablesRequest request; they support the data types listed in the class (also nested). A Room Variable can also be null.

Room Variables also support a number of specific flags:

  • Private: a private Room Variable can only be modified by its creator.
  • Persistent: a persistent Room Variable will continue to exist even if its creator has left the Room (but will be deleted when the creator will get disconnected).
  • Global: a global Room Variable will fire update events not only to all users in the Room, but also to all users in the Group to which the Room belongs (NOTE: this flag is not available on the client-side because clients are not allowed to create global Room Variables).
See Also