private void BrowseResourceDirectoryClicked() { if (!File.Exists(Settings.ServerHostPath)) { NotificationService.ShowNotification("Improper or no GT-MP server directory selected.", true); return; } ServerHostingHelper.OpenResourcesDirectory(Settings.ServerHostPath); }
private void EditServerSettingsXmlClicked() { if (!File.Exists(Settings.ServerHostPath)) { NotificationService.ShowNotification("Improper or no GT-MP server directory selected.", true); return; } if (!ServerHostingHelper.OpenSettingsFile(Settings.ServerHostPath)) { NotificationService.ShowNotification("settings.xml file does not exist.", true); return; } }
private async Task StopServer() { if (!File.Exists(Settings.ServerHostPath)) { NotificationService.ShowNotification("Improper or no GT-MP server directory selected.", true); return; } if (!IsRunning || _isShuttingDownServer) { return; } _isShuttingDownServer = true; ServerOutput += "Sending shutdown event." + Environment.NewLine; await ServerHostingHelper.ShutDownConsoleProcess(_serverProcess); if (_serverProcess == null) { return; } if (!_serverProcess.HasExited) { _serverProcess.Kill(); } _serverProcess.Close(); _serverProcess.Dispose(); _serverProcess = null; RaisePropertyChanged(nameof(IsRunning)); ServerOutput += "Server stopped." + Environment.NewLine; _isShuttingDownServer = false; }