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 vincentpiedeloup · Sep 17, 2020 at 04:19 PM · CloudScriptLeaderboards and StatisticsFriends

Cloud script Friends GetPlayerStatistics vs GetFriendLeaderboard considering request limit

In our game, we use leaderboards to store multiple statistics (35/40)

When asking for results, I have some issues.

For the Friend ranking, i use a CloudScript function to process some stats, to make it simple, let's says I need to know how many friend are better and worst than us.
I tried 2 ways of implementing this, trying to minimize the server time.

- First I tried to get the GetFriendLeaderboard for each ranking, but after some, I got a "too many request" error.

- Then, I tried asking for friend list, then for each friend, getting the GetPlayerStatistics, filtering data and storing result in an array. It works, but what will append when the friend list grow.

Is there a way to get GetFriendLeaderboard but with a list of leaderboard, even without sort, to get all stats in one request.

Or anything else to minimize the requests (I need the value of all statistics for all friends)

Comment
vincentpiedeloup

People who like this

1 Show 0
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

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Sarah Zhang · Sep 18, 2020 at 06:22 AM

>> Is there a way to get GetFriendLeaderboard but with a list of leaderboard, even without sort, to get all stats in one request?

Yes, there is a way to get the friends’ statistics in the GetFriendsList API call. You just need to use the request body like this.

{ "ProfileConstraints": { "ShowStatistics": true }}

Besides, as the API reference said. “If ProfileConstraints are non-null, this determines which properties of the resulting player profiles to return. For API calls from the client, only the allowed client profile properties for the title may be requested. These allowed properties are configured in the Game Manager "Client Profile Options" tab in the "Settings" section.”

So, if you want to request friends’ Profiles on clients, you need to do the corresponding settings before. You can navigate to [Game Manager]->[Settings]->[Client Profile Options] to check the [Statistics] option box to allow clients access Statistics.

Comment

People who like this

0 Show 1 · 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 vincentpiedeloup · Sep 21, 2020 at 06:07 AM 0
Share

Thanks, that's exactly what i need :)

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

    1 Person is following this question.

    avatar image

    Related Questions

    "Internal Server Error" in GetFriendLeaderboard API 0 Answers

    Tags does not show in GetFriendLeaderboard 1 Answer

    GetFriendLeaderboardAroundPlayer not returning Facebook friends. 2 Answers

    How can I get the PlayFabId of a player by its DisplayName in CloudScript? 2 Answers

    Multiple friend / user group leaderboards 1 Answer

    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