Пример #1
0
 // Token: 0x06001050 RID: 4176 RVA: 0x00047A9B File Offset: 0x00045C9B
 static GameModeConVar()
 {
     GameModeCatalog.availability.CallWhenAvailable(delegate
     {
         PreGameController.GameModeConVar.instance.runPrefabComponent = GameModeCatalog.FindGameModePrefabComponent(PreGameController.GameModeConVar.instance.GetString());
     });
 }
Пример #2
0
            // Token: 0x06001B0E RID: 6926 RVA: 0x0007F090 File Offset: 0x0007D290
            protected override string RebuildValue()
            {
                if (!Run.instance)
                {
                    return(null);
                }
                Run run = GameModeCatalog.FindGameModePrefabComponent(Run.instance.name);

                if (run == null)
                {
                    return(null);
                }
                return(run.name);
            }
Пример #3
0
 // Token: 0x06001051 RID: 4177 RVA: 0x00047AD4 File Offset: 0x00045CD4
 public override void SetString(string newValue)
 {
     GameModeCatalog.availability.CallWhenAvailable(delegate
     {
         Run exists = GameModeCatalog.FindGameModePrefabComponent(newValue);
         if (!exists)
         {
             Debug.LogFormat("GameMode \"{0}\" does not exist.", new object[]
             {
                 newValue
             });
             return;
         }
         this.runPrefabComponent = exists;
     });
 }
        // Token: 0x060019BC RID: 6588 RVA: 0x0007ACE4 File Offset: 0x00078EE4
        public static RunReport Generate([NotNull] Run run, GameResultType resultType)
        {
            RunReport runReport = new RunReport();

            runReport.gameModeIndex  = GameModeCatalog.FindGameModeIndex(run.gameObject.name);
            runReport.seed           = run.seed;
            runReport.snapshotTime   = Run.FixedTimeStamp.now;
            runReport.gameResultType = resultType;
            runReport.ruleBook.Copy(run.ruleBook);
            runReport.playerInfos = new RunReport.PlayerInfo[PlayerCharacterMasterController.instances.Count];
            for (int i = 0; i < runReport.playerInfos.Length; i++)
            {
                runReport.playerInfos[i] = RunReport.PlayerInfo.Generate(PlayerCharacterMasterController.instances[i]);
            }
            runReport.ResolveLocalInformation();
            return(runReport);
        }
Пример #5
0
        // Token: 0x0600102E RID: 4142 RVA: 0x00047134 File Offset: 0x00045334
        private void Awake()
        {
            this.networkRuleChoiceMaskComponent = base.GetComponent <NetworkRuleChoiceMask>();
            this.networkRuleBookComponent       = base.GetComponent <NetworkRuleBook>();
            this.ruleBookBuffer            = new RuleBook();
            this.serverAvailableChoiceMask = new RuleChoiceMask();
            this.unlockedChoiceMask        = new RuleChoiceMask();
            this.choiceMaskBuffer          = new RuleChoiceMask();
            if (NetworkServer.active)
            {
                this.NetworkgameModeIndex = GameModeCatalog.FindGameModeIndex(PreGameController.GameModeConVar.instance.GetString());
                this.runSeed = RoR2Application.rng.nextUlong;
            }
            bool isInSinglePlayer = RoR2Application.isInSinglePlayer;

            for (int i = 0; i < this.serverAvailableChoiceMask.length; i++)
            {
                RuleChoiceDef choiceDef = RuleCatalog.GetChoiceDef(i);
                this.serverAvailableChoiceMask[i] = (isInSinglePlayer ? choiceDef.availableInSinglePlayer : choiceDef.availableInMultiPlayer);
            }
            NetworkUser.OnPostNetworkUserStart += this.GenerateRuleVoteController;
        }
Пример #6
0
        private void ResolveChoiceMask()
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'System.Void RoR2.PreGameController::ResolveChoiceMask()' called on client");
                return;
            }
            RuleChoiceMask ruleChoiceMask          = new RuleChoiceMask();
            RuleChoiceMask ruleChoiceMask2         = new RuleChoiceMask();
            Run            gameModePrefabComponent = GameModeCatalog.GetGameModePrefabComponent(this.gameModeIndex);

            if (gameModePrefabComponent)
            {
                gameModePrefabComponent.OverrideRuleChoices(ruleChoiceMask, ruleChoiceMask2);
            }
            for (int i = 0; i < this.choiceMaskBuffer.length; i++)
            {
                RuleChoiceDef choiceDef = RuleCatalog.GetChoiceDef(i);
                this.choiceMaskBuffer[i] = (ruleChoiceMask[i] || (!ruleChoiceMask2[i] && this.serverAvailableChoiceMask[i] && this.unlockedChoiceMask[i] && !choiceDef.excludeByDefault));
            }
            this.networkRuleChoiceMaskComponent.SetRuleChoiceMask(this.choiceMaskBuffer);
            this.EnforceValidRuleChoices();
        }