• Sign Up Login
  • Features
    • Game Services
    • Real-time Analytics
    • LiveOps
    • Add-ons
  • Game Services
  • Real-time Analytics
  • LiveOps
  • Add-ons
  • Games
  • Pricing
  • Blog
  • Support
    • Docs
    • Forums
    • Contact
  • Docs
  • Forums
  • Contact
  • Sign Up Login
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by alxcyl · Jun 27, 2016 at 11:15 AM · Leaderboards and Statistics

How to get player Leaderboard information

I have a Leaderboard that resets automatically everyday. I need to retrieve the following information (from the client app) for the Leaderboard feature in the game I am working on:

  1. The client's rank and score today
  2. The client's rank and score yesterday
  3. The #1 player's rank and score today
  4. The #1 player's rank and score in the previous leaderboards

Looking at the Leaderboard API documentation, it seems that I lack the ability to get these information directly.

For example: If I want to retrieve the player's rank and score, I would need to call GetLeaderboard() and check every entry if it's the player's ID. If the player isn't in the first 100, I need to call GetLeaderboard() again and again until I find the player. I thought I could use GetPlayerStatistics() but it only includes the score and not the rank.

Is there a way to retrieve those information from the client?

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 alxcyl · Jun 27, 2016 at 12:14 PM 0
Share

Weird that I can't edit my own question. Anyway, #3 isn't an issue anymore.

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jun 27, 2016 at 02:54 PM

Yes, you can use GetLeaderboardAroundPlayer to retrieve a leaderboard listing centered on the any player - and if you don't specify a PlayFabId, it'll be for the current player.

Currently, the previous scores (for older versions of the leaderboard) are available via S3, for tools that you write for use internally. If you need to have multiple days (for a reset-every-day) leaderboard, you may want to consider using two leaderboards, and a local tool to reset the leaderboard every other day, so that you always have two days' worth of data available.

Comment
alxcyl

People who like this

1 Show 2 · 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 alxcyl · Jun 28, 2016 at 03:13 AM 0
Share

Thanks. Could you point me to the documentation regarding the 2nd part? I can't seem to find it in the documentation page.

avatar image Brendan ♦♦ alxcyl · Jun 28, 2016 at 03:27 AM 0
Share

Sure thing! It's in the PlayerStatisticVersion info you get back from GetPlayerStatisticVersions. There more info on this in the tutorial on using resetting statistics, here: https://api.playfab.com/docs/using-version-statistics

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

    No one has followed this question yet.

    Related Questions

    Leaderboard caching 1 Answer

    How can i remove Player statistic and leaderboard? 1 Answer

    Found a discrepancy in GetLeaderboardAroundPlayer - might be an issue 2 Answers

    Calling GetCharacterLeaderboard multiple times and not confusing the results?,Calling GetCharacterLeaderboard multiple times and not mistake the result? 2 Answers

    How do I view leaderboard from website? 1 Answer

    • PlayFab

      • Features
      • Games
      • Pricing
      • Blog
    • Engineers

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

      • Forums
      • Videos
      • Contact
      • Service Health
      • Terms of Service
    • Social

      • Facebook
      • Twitter
      • LinkedIn
      • YouTube
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • About Microsoft
    • Jobs
    • Accessibility
    • Diversity & inclusion
    • Security
    • Company news
    • © Microsoft 2019
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Post an idea
    • Create an article
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges