Jeff Posey avatar image
Jeff Posey asked

Filtering Leaderboard to only those with Display Names

Hello, I've been searching for the answer in forums and documentation but failing to find it, so, it's time to post!

I've seen questions about how to filter leaderboards by region. I'm not worried about that yet.

What I'm dealing with seems pretty basic and would be common. I allow players to create PlayFab accounts with as little friction as possible on mobile (using Device ID). Most players will not have a Display Name. Once they Link Facebook or Google accounts, I set their Display Name to the name from that account.

I want to make the leaderboards more of an "opt-in" once you've linked an account and gotten a name. Otherwise, I am currently having to request blocks of leaderboard entries and then ignore them locally if they don't have a display name. This is definitely not ideal and creates a sparse list.

I'd prefer this to be a feature with a simple setting in the PlayFab dashboard Leaderboard Settings to require display names, but it's OK if I need to write or edit server code or Cloud Script to make this happen. I just don't see where to do it yet.


Leaderboards and Statistics
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.

Jeff Posey avatar image Jeff Posey commented ·

Should I just have additional copies of my Statistics for leaderboards so that when I update them from the client, I can choose not to update the leaderboard copy of the statistic if I don't have a display name?

For example:

Statistics: HighScore, HighScore_Leaderboard_Global

When I get a new high score, I update HighScore statistic, and then I only update HighScore_Leaderboard_Global if I have a Display Name. Then when creating and requesting leaderboards I use the leaderboard copies.

Is that the best solution? I would need to update the leaderboard copies of the statistics after setting a Display Name, so you start showing on the leaderboard immediately after that, without having to play again or get new high scores first.

0 Likes 0 ·

1 Answer

Citrus Yan avatar image
Citrus Yan answered

First of all, usually it’s not recommended to allow client to post player statistics because that may allow the clients to cheat, which may jeopardize you game. Therefore, you should consider posting statistics on the server side instead, CloudScript can do that job .

Now, regarding your solution, I think you can also save the statistics as Player Data for those players whose don’t have a Display Name yet, and update the actual statistic for them when their Display Names are set. This approach only needs the use of one Statistic Name, saving slots for future uses.

10 |1200

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

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.