Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by smumair06 · Jun 20 at 04:16 AM ·

All entries in a leaderboard

Comment

People who like this

0 Show 1
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image smumair06 · Jun 20 at 04:18 AM 0
Share

I would like to get PlayFab IDs of all the entries inside a specific leaderboard. Can we do that via segments? If yes, can anyone guide me how to do that ?

3 Replies

· Add your reply
  • Sort: 
avatar image

Answer by smumair06 · Jun 20 at 04:25 AM

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 ?

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Xiao Zha · Jun 20 at 10:19 AM

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.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by smumair06 · Jun 20 at 12:27 PM

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 ?

Comment

People who like this

0 Show 3 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Xiao Zha · Jun 21 at 01:31 AM 0
Share

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.

avatar image smumair06 Xiao Zha · Jun 21 at 05:40 AM 0
Share

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?

avatar image Xiao Zha smumair06 · Jun 21 at 06:23 AM 0
Share

Title Data is cached, and changes may take up to fifteen minutes to refresh in those caches. So in your case, you may need to use an external database to achieve this function.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    13 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges