question

renatodarrigo avatar image
renatodarrigo asked

Get country code from leaderboard entry

Is there a way to get the country code for each of the leaderboard entries so I can show the flag in a "global" ranking alongside with the entry display name?

Leaderboards and Statistics
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Sure, you could use the Geo info we return as part of the player login to get the player's country, and set that as a Tag on the player account (AddPlayerTag). Then, set ShowTags to true in the ProfileConstraints when you query the leaderboard.

3 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.

renatodarrigo avatar image renatodarrigo commented ·

Will try! Thanks a lot!

0 Likes 0 ·
renatodarrigo avatar image renatodarrigo commented ·

Seems it only works on Server API. I need this on Client.

0 Likes 0 ·
brendan avatar image brendan renatodarrigo commented ·

To be specific, I meant you would set that in a Cloud Script call, so that you can make sure you're setting only the Tags that you really want to (Tags should not be set by a client authoritative action, as players could then set any Tag they wanted to - potentially cheating your title, depending on how you use them).

0 Likes 0 ·

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.