private void Window_Loaded(object sender, RoutedEventArgs e) { if (Process.GetProcessesByName(nameof(NitroxServer)).Any()) { MessageBox.Show("Nitrox сервер уже запущен. Пожалуйста, закройте его перед запуском нового сервера."); Environment.Exit(1); } Executor = ConsoleExecutor.Execute(typeof(Server).Assembly.Location); Executor.OutputReceived += (o, args) => WriteLog(args.Text); Executor.ErrorReceived += (o, args) => WriteLog(args.Text); }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (Process.GetProcessesByName("NitroxServer").Any()) { MessageBox.Show("Nitrox server has already been started. Please close it before starting a new server."); Environment.Exit(1); } Executor = ConsoleExecutor.Execute(typeof(Server).Assembly.Location); Executor.OutputReceived += (o, args) => WriteLog(args.Text); Executor.ErrorReceived += (o, args) => WriteLog(args.Text); }