question

Brian Davis avatar image
Brian Davis asked

Are leaderboard updates tied to a device

I've been trying to integrate PlayFab into my app, and after hitting a few bumps along the way, things are looking good. However, I've noticed some odd things with the leaderboard that happen when testing my Unity app in the editor.

Use case: App is opened and a guest login is achieved through LoginWithCustomID and the PC's device ID. Works great. Guest now plays the game and scores 500 pts. The leaderboard is updated and shows user Guest's score of 500.

Guest now logs out of the app. The app isn't closed. Player Brian logs in using LoginWithEmailAddress. Brian plays the game and scores 750 points. The leaderboard is updated a second time. The leaderboard at this point should have two items. However, the leaderboard only shows one item, Brian, with 750 points. The guest's score is no longer shown.

To update the leaderboard, I'm using PlayFabClientAPI.UpdatePlayerStatistics. Also, the users are remembered on the device. No errors are shown. Each user also has a displayname associated with their account, including guests.

Any thoughts as to why I don't see two items in the leaderboard?

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.

Brian Davis avatar image Brian Davis commented ·

Incidentaly, when I say "guest now logs out", I realize there is no logout per se'. I'm using PlayFabClientAPI.ForgetAllCredentials to attempt this process.

Also, I have checked the players that are created and can verify that both Guest and Brian exist in the database.

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

Most of the client API will generate PlayStream Events where we can track PlayFab and players’ behavior. I will highly recommend you to monitor the generated events during your reproduction. If you still have any question, please share your Title ID, along with these 2 players’ PlayFab ID so that I can dig into it. Also, try to output the caller ID before each API is made via:

print(PlayFabSettings.staticPlayer.PlayFabId);

Moreover, I am not sure if it is for debugging, but let clients be able to update statistics is not a good scenario because there can be abusive uses or hacks from the players. We will recommend to handle those updates on server side, for example, via Cloud Script/Azure Function. Verification steps are necessary, at least the timestamp should be check to avoid cheating.

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.

Brian Davis avatar image Brian Davis commented ·

So, first off, this was just intended for a quick and dirty statistic test. I wanted to do a cloudscript version, but i haven't gotten that far yet. The basic "hello world" example is much too simple, and finding a real world example that demonstrates using player IDs to call server API functions is elusive.

Second, i realize the abusive nature problem from two standpoints. One stems from flat out dishonesty, and the other from apparently not being able to delete a statistic (am i missing something?) Hitting the 25 stat limit could be achieved very quickly from an abusive user.

0 Likes 0 ·
Brian Davis avatar image Brian Davis Brian Davis commented ·

After doing some searches, I see that deleting stats has been essentially "coming soon" for ages now (4+ years) and a fix has apparently been in private review for over half a year. I'll accept the idea that this is apparently a very hard thing to do, although I really don't see how. That said.... No one has ever really asked why stats weren't allowed to be deleted in the first place. Please, no guesses from the community here. I'm genuinely curious as to why this decision was made, and why it is apparently so difficult to implement. I mean, I get that deleting items from a database can possibly leave lingering traces (e.g. links to stats via generated queries) and a "DELETE STAT_NAME FROM TABLE" is probably too simplified, but again... why wasn't it done in the first place prior to Microsoft's acquistion?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Brian Davis commented ·

If you have specific needs on increasing the limit of Statistics, I will suggest upgrading your title to the new pricing, because in the development mode of new pricing title, there will be 300 statistics available as it is the new limit. Besides, according to the roadmap, all legacy free tier titles will eventually transfer to the new pricing on the Oct. 2020.

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.