Sign In Register

How can we help you today?

Start a new topic
Answered

Weekly Tournament / Leaderboard rewards

Hi,


How could I implement a Leaderboard based tournament, say weekly/daily, that at the end of the week/day gives rewards based on the player rank / partition ?


Leaderboards doesn't have any Cloud Code callback or script that is invoked when reset (or before they will reset) so I don't know how to check the "end" of the tournament and access the leaderboard data in a safe way.


I can schedule an event using Spark Scheduler or configure a script that run every day, but I don' have guarantee that when I start reading the leaderboard, that results are still there..


The other approach I though would be to create a runtime collection that store the weekly score/data for the players (other than set the score in the board) and schedule a script at the end of the week that determine the results using the data inside the collection rather than accessing the leaderboard data itself. 


Other thing I was wondering is how to assign the reward. It would be better to directly credits the currency and rely on Message API to notify the online users or store the rewards in different collection, using Message API to notify them, and let the user consume the rewards ?


Thank

Cristian




Best Answer

Hi,

You can achieve this without using cloud code and just with achievements and leaderboards. If you have a leaderboard setup that calculates daily you can configure an achievement for it so that it triggers when a player achieves a New Global Rank of 1 (or any rank of your choosing) and your virtual good/currency award will be applied.


Thanks


3 people have this question

I'm currently trying to implement this, was there any answer to this question?

I saw that in Could Code under System. There is a script called Every Day. I guess that the scripts get called at the same time when daily leaderboard getting reset. So I presume that we can do reward logic there for daily reward.

 

Answer

Hi,

You can achieve this without using cloud code and just with achievements and leaderboards. If you have a leaderboard setup that calculates daily you can configure an achievement for it so that it triggers when a player achieves a New Global Rank of 1 (or any rank of your choosing) and your virtual good/currency award will be applied.


Thanks

Login to post a comment