Sign In Register

How can we help you today?

Start a new topic
Answered

Adding/updating leaderboard entries from cloud code

Hi all,


What is the recommended way to update entries in a players leaderboard from cloud code? The use case here is for managing a global leaderboard of players and their level. The players level is controlled strictly from cloud code as xp is awarded from completing tasks.


Also, can a leaderboard set to be accessible by cloud code only?


Thanks,

- Toby


Best Answer

Hi Toby, 


Sorry for not getting to this sooner.


The best way to do this right now is to use Spark.sendRequest or Spark.sendRequestAs and use this to make the postScore request on behalf of the user you wish.


I'm not 100% sure what you mean about setting the leaderboards to be accessible by cloud code only but you can make any request you want using sendRequest or sendRequestAs and return the information to whatever engine you wish using scriptData.


Shane

1 Comment

Answer

Hi Toby, 


Sorry for not getting to this sooner.


The best way to do this right now is to use Spark.sendRequest or Spark.sendRequestAs and use this to make the postScore request on behalf of the user you wish.


I'm not 100% sure what you mean about setting the leaderboards to be accessible by cloud code only but you can make any request you want using sendRequest or sendRequestAs and return the information to whatever engine you wish using scriptData.


Shane