question

mfdemir3 avatar image
mfdemir3 asked

Get Player Data of players around a user by ELO

Hi, I'm trying to build a system that finds players who has a close ELO with given user and retrieve their Player Data. I'm trying to build this system for something like finding a village to attack in Clash of Clans. I've thought about using GetLeaderboardsAroundPlayer but it seems like it doesn't return Player Data of the players around. Can you help me about the solution?

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.

mfdemir3 avatar image mfdemir3 commented ·

I know that I can call GetUserData using the PlayfabIDs of returned players from GetLeaderboardsAroundPlayer. But I need a specific PlayerData attribute of all returned players for the algorithm to choose which one to attack. But as far as I know I can't call GetUserData in a for loop because of the limits. So I need a different solution.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

No, there is no call that would return all the player data for all the players around a given player. The problem is that such a call would be very expensive. We currently provide the player profile for all players in the leaderboard data. What you should do is track on the relevant elements you want to use in deciding which other player to attach in profile elements (like statistics), so that you can make that decision without reading player data. Then you would only need to read the player data of the one player being attacked.

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.

mfdemir3 avatar image mfdemir3 commented ·

Adding required elements to statistics will work for me. Thanks!

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.