Dispose Server on Exit

This commit is contained in:
glax 2024-03-01 11:25:31 +01:00
parent beadca1648
commit e86a49d5f6
2 changed files with 4 additions and 6 deletions

View File

@ -46,13 +46,9 @@ public class API : IDisposable
});
t.Start();
}
catch (OperationCanceledException)
catch (Exception e)
{
}
catch (HttpListenerException e)
{
this.logger.LogError(e, null);
this.logger.LogError(e, e.ToString());
}
}
}

View File

@ -179,6 +179,7 @@ public class Tracker : IDisposable
public void Dispose()
{
this._logger.LogInformation("Stopping...");
this.api.Dispose();
_running = false;
lock (_updateInfoThread)
{
@ -195,5 +196,6 @@ public class Tracker : IDisposable
this._logger.LogInformation("Exporting Player-States...");
foreach (Player player in this._players)
player.ShuttingDownSaveSessions();
this._logger.LogInformation("Done. Bye.");
}
}