Search Unity

Question Who has latest logic

Discussion in 'Cloud Save' started by cryogee, Aug 10, 2022.

  1. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    Hi,

    I'm thinking of implementing following logic to know if we have to pull data from server or push data from client

    a A Local and Server "Updated" counter which increments every time we push something to server/cloud save

    iPhone - Device A
    Player plays the game. After Level Over data is pushed to cloud save and local and server counter is incremented

    iPad - Device B
    Player opens the game. Game compares server counter with local and sees server is more recent so updates local with server data

    What does Unity team think of such multi device - fetch or not conflict resolution? If you can share what was your approach for such conflict, that would be helpful.
     
  2. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    282
    Hi Cryogee.
    In your scenario is Device A and Device B owned by the same user? If yes then the solution may be the following:
    You would need to authenticate your player using the Authentication SDK. The user would need to sign in to one of the following platforms.

    Once signed into a platform on Device A, on completing the level you can save data for the specific signed in player. When the player loads the application on Device B proceeds to sign in with the same information used on Device A you can then fetch the saved data and compare.

    Let me know if this helps. Best of luck.
    Seb