question

Shaiv Kamat avatar image
Shaiv Kamat asked

method of querying all ConnectedPlayers userData

(C# server)

It might be easier if I go over my use case, I'm trying to create a simple text based game with anywhere from 100-10,000 players per server. The game is very simple, the clients will update their own userData at set intervals (players have 50seconds to input, then the server has 10seconds to process), this is repeated for as many rounds as there are in a specific gamemode (predefined, 3-7).

At the end of each user input phase the server will query through all connected players to get their userData to cache for later use in the game.

I wanted to know if there was a way to batch all of the queries (will paginate in the 1000s of users) so that I can send off fewer overall queries and just have multiple players data returned per operation.

Player DataCustom Game Servers
10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

Sorry, no. PlayFab does not support batching queries, and I believe you are referring to the Server/GetUserData API when you were talking about having the server query the player data, is that right? As a matter of fact, PlayFab does not recommend iterating players especially when the player number is huge. Therefore, a better way to implement this functionality would be using an external data cache service like Redis.

10 |1200

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

Shaiv Kamat avatar image
Shaiv Kamat answered

@Citrus Yan Thanks for the quick response!

Aside from Redis (Im looking into it), is there a way within playFab for a ConnectedPlayer to directly send input to the server it is connected to? If so I could just have a listener on the server, similar to how a player connects, and store the input for the next round. ( I can rely on the players to send the data to the server rather than updating their own private fields and having the server read those)

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.

Citrus Yan avatar image Citrus Yan commented ·

PlayFab does provide a custom server hosting service, which should fulfill your requirements. Please check out this doc to learn about more: Multiplayer Servers

1 Like 1 ·
Shaiv Kamat avatar image Shaiv Kamat Citrus Yan commented ·

Most of the custom game server samples I can find on PlayFab seem to involve UNET in some form, UNET has been depreciated and will eventually be replaced. Can you suggest and alternative to handle networkRequests and Responses between a custom server and the client? (For reference I was looking at the PlayFab Sample Custom Game Server)

1 Like 1 ·
Citrus Yan avatar image Citrus Yan Shaiv Kamat commented ·

Unity is currently developing a new network system: Evolving multiplayer games beyond UNet, you can wait for the new system or work with UNet for now. Moreover, there are many other network systems such as Mirror for you to choose, here is a discussion about alternatives for UNet you may find helpful:)

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.