Interface ISavedGameClient
Namespace: EasyMobile
Assembly: cs.temp.dll.dll
Syntax
public interface ISavedGameClient
Methods
DeleteSavedGame(SavedGame)
Deletes the specified saved game. This will delete the data of the saved game locally and on the cloud.
Declaration
void DeleteSavedGame(SavedGame savedGame)
Parameters
Type | Name | Description |
---|---|---|
SavedGame | savedGame | The saved game to delete. |
FetchAllSavedGames(Action<SavedGame[], String>)
Retrieves all known saved games. All returned saved games are not open, and must be opened before they can be used for read or write operations. On Android/Google Play Games Services platform, this method uses the data source specified in the module settings.
Declaration
void FetchAllSavedGames(Action<SavedGame[], string> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Action<SavedGame[], System.String> | callback | The callback that is invoked when this operation finishes. If the operation succeeds, the saved game array will be non-empty and the error string will be null. Otherwise, an empty array will be returned and the string will contain the error description. Note that the returned saved games (if any) will NOT be "Open". This callback will always execute on the game thread. |
OpenWithAutomaticConflictResolution(String, Action<SavedGame, String>)
Opens the saved game with the specified name, or creates a new one if none exists. If the saved game has outstanding conflicts, they will be resolved automatically using the conflict resolution strategy specified in the module settings. The saved game returned by this method will be open, which means it can be used for Read and Write operations. On Android/Google Play Games Services platform, this method uses the data source specified in the module settings.
Declaration
void OpenWithAutomaticConflictResolution(string name, Action<SavedGame, string> callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the saved game, must consist of only non-URL reserved characters (i.e. a-z, A-Z, 0-9, or the symbols "-", ".", "_", or "~") and has between 1 and 100 characters in length (inclusive). |
System.Action<SavedGame, System.String> | callback | The callback that is invoked when this operation finishes. If the operation succeeds, a non-null, opened saved game will be returned and the error string will be null. Otherwise, the returned saved game will be null and the string contains the error description. This callback will always execute on the game thread. |
OpenWithManualConflictResolution(String, Boolean, SavedGameConflictResolver, Action<SavedGame, String>)
Opens the saved game with the specified name, or creates a new one if none exists. If the saved game has outstanding conflicts, they will be resolved manually using the passed conflict resolving function. The completed callback will be invoked once all pending conflicts are resolved, or an error occurs. The saved game returned by this method will be open, which means it can be used for Read and Write operations. On Android/Google Play Games Services platform, this method uses the data source specified in the module settings. Use this method if you want to implement a custom conflict resolution strategy.
Declaration
void OpenWithManualConflictResolution(string name, bool prefetchDataOnConflict, SavedGameConflictResolver resolverFunction, Action<SavedGame, string> completedCallback)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the saved game, must consist of only non-URL reserved characters (i.e. a-z, A-Z, 0-9, or the symbols "-", ".", "_", or "~") and has between 1 and 100 characters in length (inclusive). |
System.Boolean | prefetchDataOnConflict | If set to |
SavedGameConflictResolver | resolverFunction | The function that will be invoked if one or more conflict is encountered while executing this method. Note that more than one conflict may be present and that this function might be executed more than once to resolve multiple conflicts. This function is always executed on the game thread. |
System.Action<SavedGame, System.String> | completedCallback |
ReadSavedGameData(SavedGame, Action<SavedGame, Byte[], String>)
Reads the binary data of the specified saved game, which must be opened (i.e. IsOpen returns true).
Declaration
void ReadSavedGameData(SavedGame savedGame, Action<SavedGame, byte[], string> callback)
Parameters
Type | Name | Description |
---|---|---|
SavedGame | savedGame | The saved game to read data. It must be opened or the operation will fail. |
System.Action<SavedGame, System.Byte[], System.String> | callback | The callback that is invoked when the read finishes. If the operation succeeds, the byte array will contain the saved game binary data, and the string error will be null. Otherwise, the returned array will be null and the string will contain the error description. In case the saved game has just been opened and has no data written yet, both the byte array and the error string will be null. This callback always executes on the game thread. |
ShowSelectSavedGameUI(String, UInt32, Boolean, Boolean, Action<SavedGame, String>)
On Android/Google Play Games Services platform, this method shows the select saved game UI with the indicated configuration. If the user selects a saved game in that UI, it will be returned in the passed callback. This saved game will be unopened and must be passed to OpenWithAutomaticConflictResolution(String, Action<SavedGame, String>) or OpenWithManualConflictResolution(String, Boolean, SavedGameConflictResolver, Action<SavedGame, String>) before it can be used for read or write operations.
Declaration
void ShowSelectSavedGameUI(string uiTitle, uint maxDisplayedSavedGames, bool showCreateSaveUI, bool showDeleteSaveUI, Action<SavedGame, string> callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | uiTitle | The user-visible title of the displayed selection UI. |
System.UInt32 | maxDisplayedSavedGames | The maximum number of saved games the UI may display. This value must be greater than 0. |
System.Boolean | showCreateSaveUI | If set to |
System.Boolean | showDeleteSaveUI | If set to |
System.Action<SavedGame, System.String> | callback | The callback that is invoked when an error occurs or if the user finishes interacting with the UI. If the user selected a saved game, this will be passed into the callback, and the error message will be null. This returned saved game will NOT be open, and must be opened before it can be used for Read and Write operations. If the user backs out of the UI without selecting a saved game, or some error occurs, this callback will receive a null saved game and an error message. This callback will always execute on the game thread. |
WriteSavedGameData(SavedGame, Byte[], SavedGameInfoUpdate, Action<SavedGame, String>)
Declaration
void WriteSavedGameData(SavedGame savedGame, byte[] data, SavedGameInfoUpdate infoUpdate, Action<SavedGame, string> callback)
Parameters
Type | Name | Description |
---|---|---|
SavedGame | savedGame | |
System.Byte[] | data | |
SavedGameInfoUpdate | infoUpdate | |
System.Action<SavedGame, System.String> | callback |
WriteSavedGameData(SavedGame, Byte[], Action<SavedGame, String>)
Declaration
void WriteSavedGameData(SavedGame savedGame, byte[] data, Action<SavedGame, string> callback)
Parameters
Type | Name | Description |
---|---|---|
SavedGame | savedGame | |
System.Byte[] | data | |
System.Action<SavedGame, System.String> | callback |