SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::entities::UserVariable Class Referenceabstract

A custom value attached to a user, kept in sync between client and server. More...

#include <Variable.h>

Inheritance diagram for sfs3::entities::UserVariable:
[legend]

Public Member Functions

virtual bool isPrivate ()=0
 Indicates whether this User Variable is private or not.
Public Member Functions inherited from sfs3::entities::Variable
std::string name ()
virtual const VarDatavalue ()
 Returns the value of this variable, whatever its type.
virtual std::optional< bool > boolValue ()
virtual std::optional< uint8_t > byteValue ()
virtual std::optional< int16_t > shortValue ()
virtual std::optional< int32_t > intValue ()
virtual std::optional< int64_t > longValue ()
virtual std::optional< float > floatValue ()
virtual std::optional< double > doubleValue ()
virtual std::optional< std::string > stringValue ()
virtual std::shared_ptr< SFSObjectsfsObjectValue ()
virtual std::shared_ptr< SFSArraysfsArrayValue ()
virtual std::optional< SFSVector2vector2Value ()
virtual std::optional< SFSVector3vector3Value ()
virtual void setNull ()
 Clears the value of this variable.
virtual void setValue (VarData value)
 Sets the value of this variable.
virtual bool isNull ()
virtual std::string toString ()

Detailed Description

A custom value attached to a user, kept in sync between client and server.

SFSUserVariable is the standard implementation of this interface.

See also
SFSUserVariable
requests::SetUserVariablesRequest

Member Function Documentation

◆ isPrivate()

virtual bool sfs3::entities::UserVariable::isPrivate ( )
pure virtual

Indicates whether this User Variable is private or not.

A private User Variable is visible only to its owner; any changes made to the variable will be transmitted to the owner only.

NOTE: setting this flag by hand on a User Variable returned by the API has no effect on the server and can disrupt the working of the API. You can set it only on a User Variable you create yourself.

Returns
whether or not the variable is private

Implemented in sfs3::entities::SFSUserVariable.


The documentation for this class was generated from the following file: