Hi guys, I had a question about retrieving a player's leaderboard position change via PlayFab. So given this question & answer, it seems like the below approach would be the best way to do what I'm after.
When posting a score I would need to use PlayFab cloud script to do the following.
1. UpdatePlayerStatistic (store new leaderboard score) 2. GetLeaderboardAroundPlayer (grab associated leaderboard to get player position) 3. GetUserInternalData (grab previously-stored leaderboard player position - if any) 4. UpdateUserInternalData (store new previous leaderboard position if position changed)
When grabbing a leaderboard I would need to use PlayFab cloud script to do the following.
1. GetUserInternalData (grab the previous leaderboard score for leaderboard we want - if any) 2. GetLeaderboardAroundPlayer( grab leaderboard )
3. return custom object with previous score & associated leaderboard entrys.
Does this seem like the right approach? Given this approach, would I only be charged for cloud script execution time? I'm trying to make sure I do this as efficiently as possible but it's looking like, just to post a score to get what I'm after I have to execute 4 PlayFab server functions.
Ultimately I'm looking to understand if my approach is correct and if there are any potential red flags here. Also, cost is a bit of a concern of mine, given that leaderboards will be quite a big often used feature of my game.
Thanks in advance!