Skip to main content

CloudVariables

Provides access to Cloud Variables. You can use cloud variables to store persistent information about the user. Generally, the values pushed to cloud variable are stored in the server. In local mode, variables are stored locally.

Members

Static Properties

NameDescription
CloudVariables.IsEnabledIs use of cloud variables enabled for this world?
CloudVariables.ServerVariablesThe variable bank which belongs to the current server. Most of the time world level cloud variables are read-only unless the current user is server admin.
CloudVariables.UserVariablesThe variable bank belonging to the current local user.
CloudVariables.WorldVariablesThe variable bank belongs to the current world. Most of the time world level cloud variables are read-only unless the current user is world creator.

Static Methods

NameDescription
CloudVariables.GetScoreBoard(variableName, descending=true, skip=0, limit=INF)Get score board associated with a variable name. The score board is generated based on previously assigned variables to users. A user with an assigned variable matching the name provided included in the score board if the variable type is number. You can specify where and how much of scoreboard to retrieve by assigning skip and limit parameters.
CloudVariables.GetUserVariableSummary(variableName, subject)Returns the summary about a variable that assigned to the specified subject. The summary is generated by going through all the variables instances assigned to the subject and collecting summary information. An example of summary usage is to get the total number of golds being distributed to users in server, given that the multiple worlds in the server can give gold to player for various reasons.
CloudVariables.RequestToPublish()Create a request for client to publish the variable changes to the server as soon as possible.

Extra Detail

Note that the cloud variables might not be available for each world. Make sure to check IsEnabled property to ensure that cloud variables are initialized.