question

James McGhee avatar image
James McGhee asked

Server Discovery and Entity Groups

Short Version:

Can we fetch or have passed in on the command line at start the connection info for a server from the server in question. We need this so that the server can report its self to a server discovery system of sorts.

Some Details:

The discovery system is based on Entity Group and in particular Entity Object. In short each server represents a session belonging to some group of players. The group of players is defined as a Entity Group. The group is used to persist session data such that when all players are off line the server can clean up and shut down. This means the server needs to spin back up when any player asks to join it and that the group needs to serve as a 'discovery' mechnism ... that is the server needs to know the group it belongs to (pass group ID in on command line should do) and the server needs to update the group's Entity Object with its state e.g. address & if its ready to connect to or not.

Question:

So what are our options with the PlayFab SDK for sorting out the connection info of a server from within the server?

entitiesmultiplayer
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

You can store the Server Instance connection information in the Entity Group Objects. And when using Cloud Script/Azure function to initiate server instance via API RequestMultiplayerServer, you may let the function specify the “InitialPlayers” (list of string)on your own for any data you want (Group ID), which can be retrieved by gsdk. After the instance is initiated, Group Id can be cached in the server.

Meanwhile, as PlayFab MPS service is designed for session-based game, your scenario can be a long-time running server. Please understand that if the instance runs for long time, there can be issues. Moreover, a better workaround solution for your scenario is to have an external agent server, which will handle the server instance creation and maintain a cached database for mapping the group entity with server instance.

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.

James McGhee avatar image James McGhee commented ·

We actually plan on forcing servers to restart at 12 or 24hrs up time (TBD) so that wont be an issue for us and these users will nearly always be in a live session with each other so sessions are more likely to be between 1 and 6hrs in length though will be returned to multiple times by that group or subsets of it.

We where looking to avoid having an agent and it sounds like we might be able to ... I need to look into Cloud Script and initializing the server, if that can determine the connection info to the server (which I assume it would) and can feed that in on command line start of the server app then we are good to go ... its just a matter of having it feed groupId, address and port as command line arguments.

or perhaps it would be better to let the Cloud Script update the group with connection info and feed the group ID into the server on command line. In either case I think the answer is 'go understand Cloud Script and use that'

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.