public static void Shutdown() { Header("Closing down " + PrettyVersion); Logging.WriteLine("Perfroming secure shutdown."); Logging.WriteLine("Saving all cached data."); Logging.Write("Stoping background server updater"); try { ServerStatusUpdater.Dispose(); Logging.WriteSimpleLine(" - Completed!"); } catch (Exception Error) { Logging.WriteSimpleLine(" - Incomplete!"); Logging.LogError(Error.ToString()); Logging.WriteLine("Could not stop background server updater!", ConsoleColor.Red); Logging.WriteLine("Press any key to shut down ...", ConsoleColor.Red); Console.ReadKey(true); Environment.Exit(1); return; } Thread.Sleep(5000); Logging.WriteLine(EmuName + " has successfully shutdown."); Thread.Sleep(1000); Environment.Exit(0); }
public void Dispose() { try { _serverStatusUpdater.Dispose(); } catch (Exception exception) { if (_logManager != null) { _logManager.Log("Error in disposing SaharaServer: " + exception.Message, LogType.Error); _logManager.Log(exception.StackTrace, LogType.Error); } } finally { Environment.Exit(0); } }