Skip to main content
namespace ML.SDK
Class | Static

CloudVariables


namespace ML.SDK
{
static class CloudVariables
}

Summary

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.

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.

Properties

PropertyDesciption
IsEnabledIs use of cloud variables enabled for this world?
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.
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.
UserVariablesThe variable bank belonging to the current local user.

Static Methods

MethodDescription
RequestToPublish()Create a request for client to publish the variable changes to the server as soon as possible. Note that the client automatically performs this action every three minutes, however, you can call this function to request an immediate save to server.Calling this function more than once in a 3-minute interval will not yield any effect.This is a useful function to be called at the end of match to save the scores of the player, since there is high probability of some users leaving the game immediately after finishing the match.
GetScoreBoard(string, bool, int, int)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.
GetUserVariableSummary(string, VariableSubject)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.
PushEvent(string, Object, string, string, bool)Create a new event.
PushEvent(string, Object, string, bool)Create a new event.