question

kurtloeffler avatar image
kurtloeffler asked

Externally hosted game servers?

Is it possible to host game servers externally, such as my own machine or my own AWS ec2 instance? I cant find any information about doing it and don't see anything apis that would be used to do this.

What I would like to do is when a game server starts up, have it let the PlayFab know that its running with some information like ip, port, gametype, etc, and then send heartbeat requests every minute or so after that to let the PlayFab system know its still alive.

On the Server API page it says "Provides functionality to allow external (developer-controlled) servers..." which seems like what I want, but I don't see how to achieve it. If its not possible out of the box, could something like this be done through cloudscript?

On a related note I'm also not seeing any way to retrieve a list of servers to display a server browser. I want a server browser as well as matchmaking. I would like the option to let end users host their own dedicated servers.

I know I could write my own master server for server management fairly easily but if I could inject server into PlayFab I could utilize matchmaking have servers show up in the management console.

10 |1200

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

brendan avatar image
brendan answered

Externally hosted servers are now available in PlayFab. Please see this tutorial for more info: https://api.playfab.com/docs/external-server-hosting

10 |1200

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

brendan avatar image
brendan answered

Our server hosting is only necessary if you want to use our matchmaker and game wrangler (which spins up and down servers as needed, and pulls the log files and output files from servers when sessions complete). If you run your own servers, they can absolutely use the Server API via any of our SDKs (or by rolling your own with the SDK Generator, or just calling the Web API endpoints directly).

We will be offering a package later this quarter which will allow you to host servers in any hosting service you like (including your own EC2 account), though we will not be able to control spin-up/down of servers in that model, so you would need to manage server availability directly. We'll post more information on that as soon as it is available.

For our own server hosting, you can get a list of available servers via the GetCurrentGames API call. But please note that listing servers is a completely distinct issue from player-hosted servers. The primary issue there would be that it is not safe to distribute any server which makes use of calls to the Server API, as that does require the Secret Key. The Secret Key for your title must be kept protected by your team as it provides the user with the ability to make any changes desired to the title, and its user accounts.

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.

kurtloeffler avatar image kurtloeffler commented ·

Thanks, I completely overlooked GetCurrentGames. Could you point me in the direction of apis used to let PlayFab know about the existence an externally hosted game server? I really can't find that anywhere.

0 Likes 0 ·
brendan avatar image brendan kurtloeffler commented ·

What I was saying was that we'll be making that available later this quarter. When we do, we'll add the API methods that support telling us about external servers.

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.