diff --git a/Torch.Server/TorchServer.cs b/Torch.Server/TorchServer.cs index 08cb75c..21aa84e 100644 --- a/Torch.Server/TorchServer.cs +++ b/Torch.Server/TorchServer.cs @@ -121,8 +121,7 @@ namespace Torch.Server _hasRun = true; Log.Info("Starting server."); MySandboxGame.ConfigDedicated = DedicatedInstance.DedicatedConfig.Model; - - DedicatedInstance.SaveConfig(); + _uptime = Stopwatch.StartNew(); base.Start(); } @@ -136,7 +135,6 @@ namespace Torch.Server base.Stop(); Log.Info("Server stopped."); - Config.Save(); State = ServerState.Stopped; IsRunning = false; CanRun = true; diff --git a/Torch.Server/ViewModels/ConfigDedicatedViewModel.cs b/Torch.Server/ViewModels/ConfigDedicatedViewModel.cs index 0c37e49..7838e5e 100644 --- a/Torch.Server/ViewModels/ConfigDedicatedViewModel.cs +++ b/Torch.Server/ViewModels/ConfigDedicatedViewModel.cs @@ -35,6 +35,7 @@ namespace Torch.Server.ViewModels { Validate(); + _config.SessionSettings = _sessionSettings; // Never ever _config.IgnoreLastSession = true; _config.Save(path); diff --git a/Torch.Server/Views/TorchUI.xaml.cs b/Torch.Server/Views/TorchUI.xaml.cs index 1524afe..0017178 100644 --- a/Torch.Server/Views/TorchUI.xaml.cs +++ b/Torch.Server/Views/TorchUI.xaml.cs @@ -72,6 +72,7 @@ namespace Torch.Server private void BtnStart_Click(object sender, RoutedEventArgs e) { + _server.DedicatedInstance.SaveConfig(); Task.Run(() => _server.Start()); }