question

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

Is it required to call ShutdownMultiplayerServer, or is it enough to just shutdown the exe?

In legacy matchmaking/servers, I shutdown the server after the session is finished by calling:

Process.GetCurrentProcess().CloseMainWindow();  

Environment.Exit(0);

Is this sufficient for servers 2.0? or do I need to call ShutdownMultiplayerServer?

What would happen if I shut down the exe without calling ShutdownMultiplayerServer and vice versa?

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

·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

ShutdownMultiplayerServer should only be called by external tools. Calling that API calls the OnShutdown method of the GSDK, which your application needs to handle. In Unity, we shutdown our servers in Thunderhead (Servers 2.0) by calling Application.Quit() (the equivalent of Alt+F4) when all players have exited/disconnected from the server OR in the OnShutdown method.

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.

Brent Batas (Lisk) avatar image Brent Batas (Lisk) commented ·

Thanks! This seems like the correct answer - feel free to submit it as an answer instead of a comment so I can accept it.

1 Like 1 ·

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.