Esempio n. 1
0
        protected override void Cleanup()
        {
            setting.isServerTrackerOn = false;

            if (setting.ShutdownReason == VgcApis.Models.Datas.Enums.ShutdownReasons.Abort)
            {
                return;
            }

            VgcApis.Libs.Sys.FileLogger.Info("Services.Servers.Cleanup");
            VgcApis.Libs.Sys.FileLogger.Info("Services.StopTracking");

            lazyServerTrackingTimer?.Timeout();
            lazyServerTrackingTimer?.Release();

            VgcApis.Libs.Sys.FileLogger.Info("Services.SaveSettings");
            serverSaver.DoItNow();
            serverSaver.Quit();

            // let it go
            var cores = coreServList;

            VgcApis.Misc.Utils.RunInBackground(() =>
            {
                VgcApis.Libs.Sys.FileLogger.Info("Stop cores quiet begin.");
                foreach (var core in cores)
                {
                    core.GetCoreCtrl().StopCoreQuiet();
                }
                VgcApis.Libs.Sys.FileLogger.Info("Stop cores quiet done.");
            });
        }
Esempio n. 2
0
        protected override void Cleanup()
        {
            VgcApis.Libs.Sys.FileLogger.Info("Servers.Cleanup() begin");

            setting.isServerTrackerOn = false;
            if (setting.ShutdownReason == VgcApis.Models.Datas.Enums.ShutdownReasons.Abort)
            {
                VgcApis.Libs.Sys.FileLogger.Info("Servers.Cleanup() abort");
                return;
            }


            VgcApis.Libs.Sys.FileLogger.Info("Servers.Cleanup() stop tracking");
            lazyServerTrackingTimer?.Timeout();
            lazyServerTrackingTimer?.Release();

            VgcApis.Libs.Sys.FileLogger.Info("Servers.Cleanup() save data");
            lazyServerSettingsRecorder?.Dispose();
            SaveServersSettingsWorker();
        }