ok, I can get PlayFab IDs via this call: https://docs.microsoft.com/en-us/rest/api/playfab/server/play-stream/get-players-in-segment?view=playfab-rest
But, what if I also want to get rank/score posted ?
The get players in segment API can give you the playfab ids, but you can't get scores and rankings for all players in this way, you can only call Get Leaderboard Around User API with PlayFab ID to get the rank and score of a specified player.
In addition, you can call GetLeaderboard API in cloud script to get PlayFab IDs of the entries inside a specitic leaderboard. The rank and score can also be found in the PlayerLeaderboardEntry in the API result. However, the get leaderboard API has a limit on the number of players. You can only get the accurate ranking and data of the first 1000 players. The ranking of players beyond 1000 is not completely accurate.
Thanks for your suggestion.
I had solution in my mind, but don't know if that's the correct way:
Can we implement our own leaderboards, like saving user's scores in TitleData as json and then fetching and sorting it on client end to get the ranks, though it will invoke UpdateTitleData calls multiple times but that would be called via azure function. What are your thoughts on this ?
Title Data is best suited for Global Constant/Static Data and is not suitable or reliable as Global Variables. So we do not recommend using Title Data to implement a custom leaderboard.
ok, got the point. But, most of the games can require to save/update data that would be shared among users (global variables), let alone custom leaderboard. What's the best way to implement such storage, that can be updated frequently and accessed across users?
13 People are following this question.