I am hosting a UE4 dedicated game server linux build and can't get it to 'deactivate'.
I understand from reading the docs and relevant posts that I have to either include logic in the server code that manages graceful shutdown or I can use the API call from anywhere else. So, I added to the MpsAllocator from the samples to handle a shutdown request like so:
static async Task ShutdownServer() { var req = new PlayFab.MultiplayerModels.ShutdownMultiplayerServerRequest(); req.BuildId = ReadBuildIDFromInput(); var regions = await GetRegions(req.BuildId); string region = ReadRegionFromInput(regions); req.SessionId = Guid.NewGuid().ToString(); req.Region = region; var res = await PlayFabMultiplayerAPI.ShutdownMultiplayerServerAsync(req); if (res.Error != null) { Console.WriteLine(res.Error.ErrorMessage); } else { PrettyPrintJson(res.Result); } }
This seems to execute without errors and my project dashboard also shows a successful execution of the call, however, the server always stays 'Active'. From my understanding, as long as it stays in this state, it will consume the VM hours.
The only way to shut it down so far seems to be removing it entirely from the region list, but this takes time, changes its' address and just does not seem right to me.
Is this working as intended or am I missing something?