GooglePlayGames.BasicApi.SavedGame
Summary
Enumerations |
|
|---|---|
ConflictResolutionStrategy{
|
enum An enum for the different strategies that can be used to resolve saved game conflicts (i.e. |
SavedGameRequestStatus{
|
enum An enum for the different statuses that can be returned by the saved game client. |
SelectUIStatus{
|
enum An enum for the different UI statuses that can be returned by the saved game client. |
Functions |
|
|---|---|
ConflictCallback(IConflictResolver resolver, ISavedGameMetadata original, byte[] originalData, ISavedGameMetadata unmerged, byte[] unmergedData)
|
delegate void
A delegate that is invoked when we encounter a conflict during execution of ISavedGameClient.OpenWithAutomaticConflictResolution.
|
Structs |
|
|---|---|
|
GooglePlayGames. |
A struct representing the mutation of saved game metadata. |
Interfaces |
|
|---|---|
|
GooglePlayGames. |
An interface that allows developers to resolve metadata conflicts that may be encountered while opening saved games. |
|
GooglePlayGames. |
The main entry point for interacting with saved games. |
|
GooglePlayGames. |
Interface representing the metadata for a saved game. |
Enumerations
ConflictResolutionStrategy
ConflictResolutionStrategy
An enum for the different strategies that can be used to resolve saved game conflicts (i.e.
conflicts produced by two or more separate writes to the same saved game at once).
| Properties | |
|---|---|
UseLastKnownGood
|
The use last known good snapshot to resolve conflicts automatically. |
UseLongestPlaytime
|
Choose which saved game should be used on the basis of which one has the longest recorded play time. In other words, in the case of a conflicting write, the saved game with the longest play time will be considered cannonical. If play time has not been provided by the developer, or in the case of two saved games with equal play times, UseOriginal will be used instead. |
UseManual
|
Manual resolution, no automatic resolution is attempted. |
UseMostRecentlySaved
|
The use most recently saved snapshot to resolve conflicts automatically. |
UseOriginal
|
Choose the version of the saved game that existed before any conflicting write occurred. Consider the following case:
In this situation, we can resolve the conflict by declaring either keeping Y as the canonical version of the saved game (i.e. choose "original" aka UseOriginal), or by overwriting it with conflicting value, Z (i.e. choose "unmerged" aka UseUnmerged). |
UseUnmerged
|
See the documentation for UseOriginal |
SavedGameRequestStatus
SavedGameRequestStatus
An enum for the different statuses that can be returned by the saved game client.
| Properties | |
|---|---|
AuthenticationError
|
A error related to authentication. This is probably due to the user being signed out before the request could be issued. |
BadInputError
|
The request failed because it was given bad input (e.g. a filename with 200 characters). |
InternalError
|
An unexpected internal error. Check the log for error messages. |
TimeoutError
|
The request failed due to a timeout. |
SelectUIStatus
SelectUIStatus
An enum for the different UI statuses that can be returned by the saved game client.
| Properties | |
|---|---|
AuthenticationError
|
An error related to authentication. This error could be due to the user being signed out before the request could be issued. |
BadInputError
|
The request failed due to invalid input. For example, the filename exceeded the 200 character limit.. |
InternalError
|
An unexpected internal error. Check the log for error messages. |
SavedGameSelected
|
The user selected a saved game. |
TimeoutError
|
There was a timeout while displaying the UI. |
UserClosedUI
|
The user closed the UI without selecting a saved game. |
Functions
ConflictCallback
delegate void ConflictCallback( IConflictResolver resolver, ISavedGameMetadata original, byte[] originalData, ISavedGameMetadata unmerged, byte[] unmergedData )
A delegate that is invoked when we encounter a conflict during execution of ISavedGameClient.OpenWithAutomaticConflictResolution.
The caller must resolve the conflict using the passed IConflictResolver. All passed metadata is open. If ISavedGameClient.OpenWithAutomaticConflictResolution was invoked with prefetchDataOnConflict set to true, the originalData and unmergedData will be equal to the binary data of the "original" and "unmerged" saved game respectively (and null otherwise). Since conflict files may be generated by other clients, it is possible that neither of the passed saved games were originally written by the current device. Consequently, any conflict resolution strategy should not rely on local data that is not part of the binary data of the passed saved games - this data will not be present if conflict resolution occurs on a different device. In addition, since a given saved game may have multiple conflicts, this callback must be designed to handle multiple invocations.