question

alcomsoftstr avatar image
alcomsoftstr asked

Leaderboard with Location info

Hi

I use PlayFabClientAPI.GetLeaderboard. but not see Locations. Locations always null. In Client Profile Options checked Locations

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

William Gikandi avatar image William Gikandi commented ·

How to I use this to get other statistics? E.g.

If I fetch a leaderboard ranked on how much Gold each user has, how do I simultaneiously get how much Silver a player on the returned leaderboard list has?

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

I would have to assume the ProfileConstraints was not set correctly. I signed in using your test user, and queried the user above from that other profile using GetPlayerProfile (since that player has no statistics defined at the moment, and so isn't on any leaderboard) and got this back:

{
    "code": 200,
    "status": "OK",
    "data": {
        "PlayerProfile": {
            "PublisherId": "DDBCD590133F4184",
            "TitleId": "E249",
            "PlayerId": "7AEE75AF31B1AC4D",
            "Locations": [
                {
                    "ContinentCode": "EU",
                    "CountryCode": "RU",
                    "Latitude": 55.7386,
                    "Longitude": 37.6068
                }
            ]
        }
    }
}

So I can confirm that the location data is returned. Can you try checking the ProfileConstraints you used?

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

alcomsoftstr avatar image alcomsoftstr commented ·

No. Locations need in Leaderboard. In description:

"IF 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."

I configured in the game manager "Client profile options", but it's not worked. I added in PlayFabClientAPI.GetLeaderboard

                ProfileConstraints = new PlayerProfileViewConstraints()
                {
                    ShowLocations = true
                }

and everything worked! :) Thanks, but need change descriptions or fix bug.

0 Likes 0 ·
Anthony Demanuele avatar image Anthony Demanuele alcomsoftstr commented ·

I'm having the same issue a new title. I've set the Client Profile to allow access to 'Locations' but I still get a null. How did you change Profile Constraints?

0 Likes 0 ·
Andy avatar image Andy ♦♦ Anthony Demanuele commented ·

Can you share the id of the new title you're working on? Also, if you can share the request payload, that would help diagnose your issue.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.