Ejemplo n.º 1
0
 /// <summary>
 /// Runs the exit logic
 /// </summary>
 private static void Exit()
 {
     LunaLog.Normal("Exiting... Please give LMP 5 seconds to close the files correctly");
     ServerContext.Shutdown();
     QuitEvent.Set();
     Thread.Sleep(5000);
 }
Ejemplo n.º 2
0
 //Gracefully shut down
 private static async void CatchExit(object sender, ConsoleCancelEventArgs args)
 {
     ServerContext.Shutdown();
     QuitEvent.Set();
     args.Cancel = true;
     await Task.Delay(5000);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Runs the exit logic
        /// </summary>
        private static void Exit()
        {
            LunaLog.Normal("Exiting... Please wait until all threads are finished");

            ServerContext.Shutdown("Server is shutting down");
            CancellationTokenSrc.Cancel();

            Task.WaitAll(TaskContainer.ToArray());

            QuitEvent.Set();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Runs the restart logic
        /// </summary>
        public static void Restart()
        {
            //Perform Backups
            BackupSystem.PerformBackups();
            LunaLog.Normal("Restarting...  Please wait until all threads are finished");

            ServerContext.Shutdown("Server is restarting");
            CancellationTokenSrc.Cancel();

            Task.WaitAll(TaskContainer.ToArray());
            QuitEvent.Set();

            //Start new server
            string serverExePath = Common.PlatformIsWindows() ? Path.Combine(startdir, "Server.exe") : Path.Combine(startdir, "Server");

            Process.Start(new ProcessStartInfo {
                FileName = serverExePath
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Runs the restart logic
        /// </summary>
        public static void Restart()
        {
            //Perform Backups
            BackupSystem.PerformBackups(CancellationTokenSrc.Token);
            LunaLog.Normal("Restarting...  Please wait until all threads are finished");

            ServerContext.Shutdown("Server is restarting");
            CancellationTokenSrc.Cancel();

            Task.WaitAll(TaskContainer.ToArray());
            QuitEvent.Set();

            //Start new server
            var serverExePath    = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Server.exe";
            var newProcLmpServer = new ProcessStartInfo {
                FileName = serverExePath
            };

            Process.Start(newProcLmpServer);
        }