Search Unity

Question Leaderboard reset event (cloud code)

Discussion in 'Leaderboards' started by Brogan89, Apr 28, 2023.

  1. Brogan89

    Brogan89

    Joined:
    Jul 10, 2014
    Posts:
    244
    My end goal is to have a weekly leaderboard.

    I'm wanting to be able to set up some cloud code which can listen for the leaderboard reset event get the results and distribute rewards to the player's cloud save data.

    I guess an alternative would be to have the client check their result upon returning to the app and updating the rewards client side... but I feel like doing this on the cloud is a better solution. That way I don't need to archive leaderboards.
     
  2. IainUnity3D

    IainUnity3D

    Unity Technologies

    Joined:
    Oct 5, 2022
    Posts:
    36
    Hi there!

    So this is a great use case folks have been asking us about. We don't currently have a way to trigger something when a leaderboard resets but we hope will be able to provide a way to solve for this later in the year.

    One approach you can do right now, is to not use automatic resets on a leaderboard and instead use a Cloud Code function invoke a Leaderboard Reset and to check who should get a reward and update data stored in Cloud Save for those players.

    You could also use Leaderboard Archives and have game clients call a Cloud Code function to check if a player is ranked highly on the previous leaderboard and if they got their reward already (using Cloud Save both to store the reward and to record that they were given a reward).

    There isn't currently a fully server authoritative way to do something like this, but that something we actually hope to have a solution for that in Cloud Save very soon!
     
    Last edited: May 2, 2023
    Brogan89 likes this.
  3. o-m-g

    o-m-g

    Joined:
    Oct 27, 2022
    Posts:
    14
    Hi There, is this functionality available yet?