New saving system with proper waiting for file flush

Command context for servers now supports Respond()
Chat manager now treats the steam ID Sync.MyId as a local destination, and processes the event accordingly.
Save makes better use of Task<>
Restart actually waits for save
PlayerCollectionExtension uses a dictionary lookup for TryGetBySteamId
Shutting the UI window properly closes Torch
Torch Dispose renamed to Destroy, VRage Dispose marked as obsolete (do not use)
This commit is contained in:
Westin Miller
2017-12-02 21:19:09 -08:00
parent 897f75c069
commit d07caea0f6
17 changed files with 348 additions and 166 deletions

View File

@@ -84,17 +84,26 @@ quit";
public void Run()
{
_server = new TorchServer(_config);
_server.Init();
if (!_config.NoGui)
try
{
var ui = new TorchUI(_server);
if (_config.Autostart)
_server.Init();
if (!_config.NoGui)
{
var ui = new TorchUI(_server);
if (_config.Autostart)
_server.Start();
ui.ShowDialog();
}
else
_server.Start();
ui.ShowDialog();
}
else
_server.Start();
finally
{
if (_server.IsRunning)
_server.Stop();
_server.Destroy();
}
}
private TorchConfig InitConfig()