Sign In Register

How can we help you today?

Start a new topic
Answered

Can I create (setup) leaderboards by cloud code or any API instead of click the web UI?

Hi


I need to create 200+ LBs with different filter values.

And for some calculation reasons, I cannot use Partition.


Is there any way to create them without clicking the web UIs?

Thanks


Jo


Best Answer
Hey Jo,

There is no way out of the box to do this, but i might have a workaround which will allow you to do this.
So, you have the ability to get a JSON document with your game's config using the REST api, there is a doc about that here. And you can use this to post information back into the game's config too, thereby updating your leaderboards.

So the process would be as follows.
1. Use SparkHttp to get the JSON form with your game's config.
2. Build a leaderboard array with the leaderboards you want to insert.
3. Insert the leaderboard in to the JSON form.
4. Push the updated JSON form back to the game using the REST api and SparkHttp.

Does this sound like a solution?
Sean

 


Answer
Hey Jo,

There is no way out of the box to do this, but i might have a workaround which will allow you to do this.
So, you have the ability to get a JSON document with your game's config using the REST api, there is a doc about that here. And you can use this to post information back into the game's config too, thereby updating your leaderboards.

So the process would be as follows.
1. Use SparkHttp to get the JSON form with your game's config.
2. Build a leaderboard array with the leaderboards you want to insert.
3. Insert the leaderboard in to the JSON form.
4. Push the updated JSON form back to the game using the REST api and SparkHttp.

Does this sound like a solution?
Sean

 

Hi 


Thanks for help.

It seems to work!


Jo

Hi!

I'm making a game with user-generated levels, where each level is supposed to have its own leaderboard. Is it feasible for GameSparks to handle 100.000 leaderboards. If so, I'd imagine this workaround-method wouldn't work once the JSON gets too big. Is there any other way of creating leaderboards on the fly?

Login to post a comment