Exemple #1
0
 protected override void OnActivate()
 {
     base.OnActivate();
     if (!Utilities.CommandLineArgumentExists("+connect_lobby"))
     {
         return;
     }
     MBGameManager.StartNewGame((MBGameManager) new MultiplayerGameManager());
 }
Exemple #2
0
        protected override void DoLoadingForGameManager(
            GameManagerLoadingSteps gameManagerLoadingStep,
            out GameManagerLoadingSteps nextStep)
        {
            nextStep = GameManagerLoadingSteps.None;
            switch (gameManagerLoadingStep)
            {
            case GameManagerLoadingSteps.PreInitializeZerothStep:
                nextStep = GameManagerLoadingSteps.FirstInitializeFirstStep;
                break;

            case GameManagerLoadingSteps.FirstInitializeFirstStep:
                MBGameManager.LoadModuleData(false);
                MBDebug.Print("Game creating...");
                MBGlobals.InitializeReferences();
                Game.CreateGame((TaleWorlds.Core.GameType) new MultiplayerGame(), (GameManagerBase)this).DoLoading();
                nextStep = GameManagerLoadingSteps.WaitSecondStep;
                break;

            case GameManagerLoadingSteps.WaitSecondStep:
                MBGameManager.StartNewGame();
                nextStep = GameManagerLoadingSteps.SecondInitializeThirdState;
                break;

            case GameManagerLoadingSteps.SecondInitializeThirdState:
                nextStep = Game.Current.DoLoading() ? GameManagerLoadingSteps.PostInitializeFourthState : GameManagerLoadingSteps.SecondInitializeThirdState;
                break;

            case GameManagerLoadingSteps.PostInitializeFourthState:
                bool flag = true;
                foreach (MBSubModuleBase subModule in Module.CurrentModule.SubModules)
                {
                    flag = flag && subModule.DoLoading(Game.Current);
                }
                nextStep = flag ? GameManagerLoadingSteps.FinishLoadingFifthStep : GameManagerLoadingSteps.PostInitializeFourthState;
                break;

            case GameManagerLoadingSteps.FinishLoadingFifthStep:
                nextStep = GameManagerLoadingSteps.None;
                break;
            }
        }
 public void SetLoadingParameters(MBGameManager gameLoader) => this._gameLoader = gameLoader;