question

doodahprod@hotmail.com avatar image
doodahprod@hotmail.com asked

Collect non authentified user statistics

Hello,

I divided my user data in two group, the private data which can be read only by the auth user, and the public data which can be read by any user. I would like to use one of theses public data as a leaderboard, so I moved it from UserData to UserStatistics.

Here, my problem is the client Api call for GetUserStatistics can only get the authentified user data. I would like to be able to get any user statistics.

Is there a way to achieve this without making a custom CloudScript for this purpose ?

Thanks for your help.

10 |1200

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

brendan avatar image
brendan answered

Any user statistic in our service can be queried as a leaderboard using the leaderboard API calls. It sounds like the issue you're describing is that you cannot query a leaderboard around a different user - is that correct? Could you describe the specifics of the game behavior you're looking to build? In most cases, what you're describing is usually accomplished with a friend leaderboard or the Client/GetLeaderboardAroundPlayer call, which takes a PlayFabId as an input parameter, so that you can get a leaderboard centered around another player.

10 |1200

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

doodahprod@hotmail.com avatar image
doodahprod@hotmail.com answered

Hello brendanv,

Among the public data I would like to get, there is some used for leaderboards and some not use for them. Also, a important feature is that theses data can be accessed by any user in my application without necessary being friend. As I'm doing a mobile game, I would like to be able to optimize the servers call.

This is why I'm looking for a way to call the server only once to retrieve a set of data, including some stored as UserData and some used a UserStatistics (as theses ones are also used for leaderboards). If I could do it performing one simple call instead of performing two calls (one for data and one for statistics) this would be perfect.

Is that more clear what I'm trying to accomplish?

Thanks

10 |1200

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

brendan avatar image
brendan answered

Yes and no. I understand that this is the specific implementation you're targeting, but I'm interested in getting more details about the in-game behavior - what the player experience is. The reason I'm asking is because there's a world of difference between something like a Gamercard, where the experience is that you click on a player, the client queries for the data you need, and then you show the player the info for that person, versus a multi-column leaderboard, where you want to query data/stats about a bunch of users all at once. A scenario like the latter is not supportable, as it would mean generating far too many queries all at once (though to be clear, we'll be providing columns for leaderboards in an upcoming update). So the actual use case is always important to understand.

With that said, you are correct - you would currently need to make two calls to aggregate this data - one to get the user data, and one to get the 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.

doodahprod@hotmail.com avatar image
doodahprod@hotmail.com answered

Hello brendanv,

This is the exact behavior I would like to accomplish :

  1. A random user profile is presented to the authentified user
  2. A set of public data can be viewed, including UserData and UserStatistics, as some of the data are used to create different leaderboard, let's call them "points"
  3. Authentified user can give "points" to the random user profile presented, but cannot modify any of the UserData
  4. Authentified user can add this random profile as friend

 Note that users should not necessary be friend to view other players data and statistics. In addition to that, user can at anytime see a generic leaderboard showing only the users statistics, and not all the publics data.

10 |1200

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

brendan avatar image
brendan answered

Got it, thanks. In that case, I would definitely go with the Cloud Script approach. That way you can query both user data and statistics in one pass, and then later (in another script) do the update. The write process absolutely has to go through a script, since there's no way for a player to write to another player's stats or user data, as that would create serious security issues for that data (a hacked client could send whatever it wanted to).

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.