Click or drag to resize

SFSUserVariable Class

The SFSUserVariable object represents a SmartFoxServer User Variable entity on the client.
Inheritance Hierarchy
SystemObject
  Sfs2X.Entities.VariablesBaseVariable
    Sfs2X.Entities.VariablesSFSUserVariable

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

The SFSUserVariable type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyIsPrivate
Indicates whether this User 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 methodStatic membernewPrivateVariable
Creates a new private User Variable.
Public methodToString
Returns a string that contains the User Variable name, type, value and IsPrivate flag.
(Overrides ObjectToString.)
Top
Remarks
This is a custom value attached to a User object that gets automatically synchronized between client and server on every change.

User Variables are particularly useful to store custom user data that must be "visible" to the other users, such as a profile, a score, a status message, etc. User Variables can be set by means of the SetUserVariablesRequest request; they support the data types listed in the class (also nested). A User Variable can also be null.

User Variables can be 'private' (starting from SFS2X v2.12 with client API v1.7): this flag allows to limit the visibility of variables to their owner only. In other words User Variables marked as private are not sent to other users, even if located in the same Room.

See Also