// 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);
        }
Exemplo n.º 2
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;
        }