Data Conflict Resolution

In some situations you will need to resolve conflicts in different version of user's data.

Here are some scenarios where local data on the device can get out of sync with remote data on the server:

  1. Same user is playing on multiple devices. By storing user data in the cloud, you can allow them play your game on multiple devices without loosing progress, but you will need to make sure all devices have the latest set of data.

  2. User was making progress in the game while being offline.

These situations will result in some devices having obsolete version of user's data, or remote storage version is out of date.

To keep track of which save is the most current, MKNet is using User Pref Metadata that is updated by the server on every update.

On game start, you can retrieve latest UserPrefMetadata object from the server and compare it with your local version. If they are out of sync, you will need to run some logic in your game to decide which version will take priority.

Possible ways to resolve conflicts: #
  1. Server data is deemed most relevant and local data overwritten silently
  2. Local data is deemed most relevant and server data overwritten silently
  3. User is presented with the choice through game UI
Related API Endpoints #

Loading API spec...