Exemple #1
0
        public void Reset()
        {
            Profiler.LmpReferenceTime.Start();

            Debug.Log($"[LMP]: KSP installed at {KspPath}");
            Debug.Log($"[LMP]: LMP installed at {AssemblyPath}");

            if (!SettingsSystem.CurrentSettings.DisclaimerAccepted && HighLogic.LoadedScene == GameScenes.MAINMENU)
            {
                Enabled = false;
                DisclaimerWindow.Singleton.Display = true;
            }

            if (!CompatibilityChecker.IsCompatible() || !InstallChecker.IsCorrectlyInstalled())
            {
                Enabled = false;
                return;
            }

            SetupDirectoriesIfNeeded();
            UniverseSyncCache.Singleton.ExpireCache();
            NetworkMain.StartNetworkSystem();

            //Register events needed to bootstrap the workers.
            GameEvents.onHideUI.Add(() => { ShowGui = false; });
            GameEvents.onShowUI.Add(() => { ShowGui = true; });

            SystemsHandler.KillAllSystems();

            HandleCommandLineArgs();
            Debug.Log($"[LMP]: LunaMultiPlayer {VersionInfo.FullVersionNumber} Initialized!");
        }
        public void Reset()
        {
            _mainThreadId = Thread.CurrentThread.ManagedThreadId;

            LunaLog.Log($"[LMP]: KSP installed at {Client.KspPath}");
            LunaLog.Log($"[LMP]: LMP installed at {AssemblyPath}");

            if (!SettingsSystem.CurrentSettings.DisclaimerAccepted && HighLogic.LoadedScene == GameScenes.MAINMENU)
            {
                Enabled = false;
                DisclaimerDialog.SpawnDialog();
            }

            if (!CompatibilityChecker.IsCompatible() || !InstallChecker.IsCorrectlyInstalled())
            {
                Enabled = false;
                return;
            }

            SetupDirectoriesIfNeeded();
            UniverseSyncCache.ExpireCache();
            NetworkMain.StartNetworkSystem();

            //Register events needed to bootstrap the workers.
            GameEvents.onHideUI.Add(() => { ShowGui = false; });
            GameEvents.onShowUI.Add(() => { ShowGui = true; });

            SystemsHandler.KillAllSystems();

            HandleCommandLineArgs();
            LunaLog.Log($"[LMP]: LunaMultiPlayer {VersionInfo.FullVersionNumber} Initialized!");
            LunaLog.ProcessLogMessages();
        }