public void Stop() { const string ulteriusFileName = "Ulterius Server.exe"; if (_ulteriusInstance != null) { _ulteriusInstance?.Kill(); WardenManager.Flush(_ulteriusInstance.Id); } _ulteriusInstance = null; EndProcessTree(ulteriusFileName); }
private void UlteriusInstanceOnOnStateChange(object sender, StateEventArgs stateEventArgs) { if (stateEventArgs.Id == _ulteriusInstance.Id && stateEventArgs.State == ProcessState.Dead) { //Kill the entire tree. _ulteriusInstance.Kill(); WardenManager.Flush(_ulteriusInstance.Id); if (Respawn()) { Console.WriteLine("Rainway restarted!"); } } }