question

Brent Batas (Lisk) avatar image
Brent Batas (Lisk) asked

How to tell custom game server to shutdown?

In the Custom Game Server documentation, it says:

It is also important to make certain that your server build exits once the last player leaves the session, for two reasons. First, the game server hosting service in PlayFab does not terminate game server instances explicitly. Second, the log file(s), as well as any other output files specified, are collected in S3 by our game server hosting service only when the instance ends. 

How do you make your server build exit? Do you just call something like Application.Shutdown or Application.Exit?

I searched through the Server API and Admin API but couldn't find anything that sounded like what I need.

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

1 Answer

·
brendan avatar image
brendan answered

Anything that causes the executable to cease would work. If you're using Unity, I'd recommend Application.Quit(). If you're just running something like straight C# code, you could just return 0 from your Main function.

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.