question

brule avatar image
brule asked

UserData count limit with GetUserDataRequest

Hi.
Is there a limit on the number of items (not the size of the Key/Value pair) in the result dictionary GetUserDataResult.Data when I do a GetUserDataRequest() ?

When a player finish a specific level, he can drop something for every other player who will succeed the level later to see. For that to work, I had the stuff stored not in the player data but in a "fake" playfab player which is the level(with a specific TitleDisplayName so I can get its playfabID). This fake level player have one playerData key/value per true player who finish the level (or more if the player redo the level).

It works very well with our 50 test users but now I'm wondering what will happen if I have 1k/10k/100k players. Will I get a "GetUserDataResult.Data" collection with 1k/10k/100k key/value inside it in one single request ? Will it return something empty / return an error / return a capped collection ?

Is there a way to limit the result count of data inside the request (make a request for the first 100 data, another for the next 100 ...) OR get a specific size of collection of randomly picked data ?

Thanks!
Tom

10 |1200

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

1 Answer

·
Made Wang avatar image
Made Wang answered

There is no explicit limit to the amount of Player data that GetUserDataRequest can obtain at one time. But requesting a lot of Player Data every time is not recommended, it will cause a lot of data reads, and may cause unnecessary overhead if your title is already in live mode. Refer to Pricing Meters - PlayFab | Microsoft Docs.

Refer to GetUserData. You can pass the key you need in Keys[] of the request body, so that the API will only return the corresponding value.

You can also store all Keys, select them randomly, and pass the random result in Keys[] of the request body to get the corresponding value. This random feature needs to be implemented by yourself.

In addition, the fake player's data is more like a global data, it is recommended to use an external database to achieve this requirement.

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.