CloudOnce v2.7.5
Unified Game Services API
|
Stores and retrieves key-value pairs. Serializes and deserializes GameData to/from the cloud and the local disk. In case of conflicts it uses ConflictResolver to figure out what data to keep and what to discard. More...
Static Public Member Functions | |
static void | InitDataManager () |
Loads any stored local data as part of the initialization. | |
static void | SetCurrencyValues (string key, Dictionary< string, CurrencyValue > currencyValues) |
Set values for a currency. More... | |
static void | SetBool (string key, bool value, PersistenceType persistenceType) |
Used to set a bool that will be stored in the cloud. More... | |
static void | SetInt (string key, int value, PersistenceType persistenceType) |
Used to set an int that will be stored in the cloud. More... | |
static void | SetUInt (string key, uint value, PersistenceType persistenceType) |
Used to set a uint that will be stored in the cloud. More... | |
static void | SetFloat (string key, float value, PersistenceType persistenceType) |
Used to set a float that will be stored in the cloud. More... | |
static void | SetDouble (string key, double value, PersistenceType persistenceType) |
Used to set a double that will be stored in the cloud. More... | |
static void | SetString (string key, string value, PersistenceType persistenceType) |
Used to set a string that will be stored in the cloud. PersistenceType.Latest will be used in case of data conflict. More... | |
static void | SetLong (string key, long value, PersistenceType persistenceType) |
Used to set a long that will be stored in the cloud. More... | |
static void | SetDateTime (string key, DateTime value, PersistenceType persistenceType) |
Used to set a DateTime that will be stored in the cloud. More... | |
static void | SetDecimal (string key, decimal value, PersistenceType persistenceType) |
Used to set a decimal that will be stored in the cloud. More... | |
static Dictionary< string, CurrencyValue > | GetCurrencyValues (string key) |
Get values for a currency. More... | |
static bool | GetBool (string key, bool defaultValue) |
Returns the value of a specified bool. More... | |
static int | GetInt (string key, int defaultValue) |
Returns the value of a specified int. More... | |
static uint | GetUInt (string key, uint defaultValue) |
Returns the value of a specified uint. More... | |
static float | GetFloat (string key, float defaultValue) |
Returns the value of a specified float. More... | |
static double | GetDouble (string key, double defaultValue) |
Returns the value of a specified double. More... | |
static string | GetString (string key, string defaultValue) |
Returns the value of a specified string. More... | |
static long | GetLong (string key, long defaultValue) |
Returns the value of a specified long. More... | |
static DateTime | GetDateTime (string key, DateTime defaultValue) |
Returns the value of a specified DateTime. More... | |
static decimal | GetDecimal (string key, decimal defaultValue) |
Returns the value of a specified decimal. More... | |
static void | RefreshCloudValues () |
Refreshes all the cloud preferences created by the user. Is used after merging the local data with data from the cloud. | |
static void | ResetSyncableCurrency (string key) |
Will completely reset the specified SyncableCurrency. More... | |
static bool | ResetCloudPref (string key) |
Resets a CloudPref to its default value. More... | |
static bool | DeleteCloudPref (string key) |
Deletes a specific cloud variable from local cache and the cloud. More... | |
static string[] | ResetAllData () |
WARNING! Resets all cloud variables back to their default values both locally and in the cloud! Should only be used while developing, not in production builds. Values are not saved automatically after the reset, and will go back to previously saved values if the game is restarted before saving. More... | |
static void | DeleteAllCloudVariables () |
WARNING! Deletes all cloud variables both locally and in the cloud (if logged into a cloud save service)! Should only be used while developing, not in production builds. | |
static string[] | ClearStowawayVariablesFromGameData () |
Used after clearing cloud data, to make sure that unwanted variables don't get re-saved to the cloud. | |
static void | SaveToDisk () |
Goes through all the cloud preferences created by the user, and stores them all in PlayerPrefs as one serialized string. | |
static void | LoadFromDisk () |
Loads data stored in PlayerPrefs. | |
static string | SerializeLocalData () |
Used by cloud save providers to serialize the local GameData for storing it in the cloud. More... | |
static string[] | MergeLocalDataWith (string otherData) |
Used by cloud save providers when GameData it downloaded from the cloud needs to be merged with the existing local GameData. More... | |
static string[] | ReplaceLocalDataWith (string otherData) |
Only to be used when player has switched to a different account. More... | |
static string[] | GetRandomKeysFromGameData () |
This method is only for simulating OnNewCloudValues in the Unity editor. More... | |
Static Public Attributes | |
const string | DevStringKey = "CloudOnceDevString" |
Properties | |
static bool | IsLocalDataDirty [get, set] |
Whether or not any of the local data has been changed since the last upload to the cloud. | |
static Dictionary< string, IPersistent > | CloudPrefs [get] |
Stores all the registered cloud preferences created by the user. | |
Stores and retrieves key-value pairs. Serializes and deserializes GameData to/from the cloud and the local disk. In case of conflicts it uses ConflictResolver to figure out what data to keep and what to discard.
|
inlinestatic |
Deletes a specific cloud variable from local cache and the cloud.
key | The unique identifier for the cloud variable you want to delete. |
true
if the cloud variable is found and deleted, false
if the specified key doesn't exist.
|
inlinestatic |
Returns the value of a specified bool.
key | The unique identifier for the bool. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
Get values for a currency.
key | The ID for the currency. Is unique to a specific currency. |
Dictionary
containing device IDs and currency values for each.
|
inlinestatic |
Returns the value of a specified DateTime.
key | The unique identifier for the DateTime. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
Returns the value of a specified decimal.
key | The unique identifier for the decimal. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
Returns the value of a specified double.
key | The unique identifier for the double. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
Returns the value of a specified float.
key | The unique identifier for the float. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
Returns the value of a specified int.
key | The unique identifier for the int. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
Returns the value of a specified long.
key | The unique identifier for the long. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
This method is only for simulating OnNewCloudValues in the Unity editor.
|
inlinestatic |
Returns the value of a specified string.
key | The unique identifier for the string. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
Returns the value of a specified uint.
key | The unique identifier for the uint. |
defaultValue | Value to return if key does not exist. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
WARNING! Resets all cloud variables back to their default values both locally and in the cloud! Should only be used while developing, not in production builds. Values are not saved automatically after the reset, and will go back to previously saved values if the game is restarted before saving.
|
inlinestatic |
Resets a CloudPref to its default value.
|
inlinestatic |
Will completely reset the specified SyncableCurrency.
key | The unique identifier for the SyncableCurrency you want to reset. |
|
inlinestatic |
|
inlinestatic |
Used to set a bool that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this bool. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Set values for a currency.
key | The ID for the currency. Is unique to a specific currency. |
currencyValues | Dictionary containing device IDs and currency values for each. |
|
inlinestatic |
Used to set a DateTime that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this DateTime. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Used to set a decimal that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this decimal. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Used to set a double that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this double. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Used to set a float that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this float. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Used to set an int that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this int. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Used to set a long that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this long. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Used to set a string that will be stored in the cloud. PersistenceType.Latest will be used in case of data conflict.
key | Must be a unique identifier for this specific value. |
value | The value for this string. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |
|
inlinestatic |
Used to set a uint that will be stored in the cloud.
key | Must be a unique identifier for this specific value. |
value | The value for this uint. |
persistenceType | The persistence type to use in case of a data conflict (ignored if value has been set before). |