internal static void Shutdown()
 {
     SaveTask.Save();
     Logger.Init("Server is now shutting down...");
     Thread.Sleep(4000);
     Environment.Exit(0);
 }
示例#2
0
        public static void Test(string input)
        {
            int minuteDelay = 10;

            WorldServer.Instance.OnClients(x => x.Character.Notification("Pour des raisons de maintenance, le serveur va être redémarré dans " + minuteDelay + " minutes. Merci de votre compréhension."));

            ActionTimer action = new ActionTimer((minuteDelay * 60000) / 2,
                                                 new Action(() => {
                WorldServer.Instance.OnClients(x => x.Character.Notification("Pour des raisons de maintenance, le serveur va être redémarré dans "
                                                                             + minuteDelay / 2
                                                                             + " minutes. Merci de votre compréhension."));
            }),
                                                 false);

            action.Start();


            action = new ActionTimer(minuteDelay * 60000,
                                     new Action(() => {
                SaveTask.Save();
                Environment.Exit(0);
            }),
                                     false);

            action.Start();
        }
示例#3
0
 public void OnConnectionToAuthLost()
 {
     logger.Error("Connection to AuthServer was lost.. Server is shutting down.");
     SaveTask.Save();
     WorldServer.Instance.DisconnectAll();
     Thread.Sleep(3000);
     Environment.Exit(0);
 }
 public static void Stop(string input)
 {
     WorldServer.Instance.SetServerStatus(ServerStatusEnum.STOPING);
     logger.Gray("Server now Offline");
     foreach (WorldClient client in WorldServer.Instance.GetOnlineClients())
     {
         client.Disconnect();
     }
     logger.Gray("Each client disconnected");
     SaveTask.Save();
     logger.Gray("Server Saved");
     logger.Gray("You can now quit the application");
 }
 public static void SaveWorld(string input)
 {
     SaveTask.Save();
 }
 static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
 {
     SaveTask.Save();
     Thread.Sleep(1000);
     Environment.Exit(1);
 }