Sign In Register

How can we help you today?

Start a new topic
Answered

Leaderboard account details

Hi.
In our game , We store a few additional profile data when registering new user.We want to show those data when getting leader board records. Actually I know We can sending additional data to leader board by attributes in events . But I think its not an optimized solution.Because for example you have to store same image url every time submitting new score . What if I want to change player image url ? I have to update all image url in all leader board for that particular player.I think the best approach is to store image ulr in profile collection and get back that on leader board . I know How to do store but how to get them back when getting leader board data?

Any solution for this?

Thanks for your answers


Best Answer

Hi Aboozar,


You are probably better off storing the link on the entry itself as supplemental data. If you could use a static link for the image and allow the user to change the image whenever they wanted that would work as the link would remain the same. The only other solution would be to do the LeaderboardDataRequest in Cloud Code using a SparkRequest. Then go through the entries in the response, find the image url for the playerId in the entry and add that to each entry object and set it to scriptData in the response and then handle it client side


Thanks,

Liam

1 Comment

Answer

Hi Aboozar,


You are probably better off storing the link on the entry itself as supplemental data. If you could use a static link for the image and allow the user to change the image whenever they wanted that would work as the link would remain the same. The only other solution would be to do the LeaderboardDataRequest in Cloud Code using a SparkRequest. Then go through the entries in the response, find the image url for the playerId in the entry and add that to each entry object and set it to scriptData in the response and then handle it client side


Thanks,

Liam

Login to post a comment