question

teemu77 avatar image
teemu77 asked

Entity groups workflow in a game with an authoritative custom server

I'm having a hard time wrapping my head around the right workflow for Entity Groups (used for guilds/clans in my instance) . My game is running in Unity alongside a custom authoritative server in .NET Core. My initial thought is to have the client send a message to my custom server when they're attempting to create a guild and have the server communicate it to PlayFab, and then send information back to the client once it's received from PlayFab's end.

Would I be able to skip the back and forth communication with my server and have the client communicate directly with PlayFab? The server would still need to know about the player's guild state, so I'm not sure how secure it would be to have that information sent from the Client after it receives a response from PlayFab.

The other option I suppose would be to log in each player to PlayFab on the server side as well, so that groups can be created on that side. Side note that currently my server doesn't keep track of logins directly and I'm not sure how viable that is. As it is, PlayFab only handles registrations and logins on the client side and then sends the Session Ticket of users to my server.

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.

1 Answer

·
Seth Du avatar image
Seth Du answered

Yes, you can let the clients directly call entity API to modify groups. Entities, including Groups and title player accounts, have specific policies and there are many actions can only be done by members with Admin Role in a group.

>>create a guild

If you want to avoid abusive uses of certain API, you can move it to Azure Function, which is billed via executions. Long time running hosted servers won’t be required. To prevent clients from calling this API, you can edit the API Access Policy, via Admin APIs –GetPolicy and UpdatePolicy

>>log in each player to PlayFab on the server side I am not sure of the scenario because server API can perform almost all player data actions, besides of login/link accounts. However, if you want to log into a player account, you can link an ID via LinkServerCustomId API, so that LoginWithServerCustomId can be called to log into player accounts on server.

2 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.

teemu77 avatar image teemu77 commented ·

Thanks for the reply!

I guess the biggest concern I have is whether I should be calling the Group modification requests on the client or the server. I think it would make the most sense to do it on the server, but it seems that I can't access the PlayFabGroupsAPI (at least the CreateGroupAsync) without being logged in. And like you said, logging each client in seems a little unnecessary as I'm already authenticating their session with the ticket I receive from the client as they log into PlayFab there.

I'd prefer not to use Azure Functions.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ teemu77 commented ·

>>Group modification

If it means members modification, I believe this action can be performed on the clients, because common players should use invitation/application system and only players with admin roles can accept/reject requests.

Meanwhile if it is Objects, you need to modify the permission and make them only writable to admin role.

If using Azure Function to execute Entity API, an entity token is necessary, and it only returns from GetEntityToken API on the server. Since Azure Function is serverless, you can assume there are multiple Azure VM instances handling these executions, while players/developers cannot decide which instance to go. However, it still has chances that players use the same instance at a short interval. You can store the entity token as a static global variable for re-use and add a null-check to decide if GetEntityToken call is required during this execution.

Using a server-less service should be more cost-efficient than hosting a 24-7 running server as long as your game is near-time and asynchronous.

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.