Beispiel #1
0
        // Token: 0x06001446 RID: 5190 RVA: 0x000567B0 File Offset: 0x000549B0
        private void SetTeamExperience(TeamIndex teamIndex, ulong newExperience)
        {
            if (newExperience > TeamManager.hardExpCap)
            {
                newExperience = TeamManager.hardExpCap;
            }
            this.teamExperience[(int)teamIndex] = newExperience;
            uint num  = this.teamLevels[(int)teamIndex];
            uint num2 = TeamManager.FindLevelForExperience(newExperience);

            if (num != num2)
            {
                ReadOnlyCollection <TeamComponent> teamMembers = TeamComponent.GetTeamMembers(teamIndex);
                for (int i = 0; i < teamMembers.Count; i++)
                {
                    CharacterBody component = teamMembers[i].GetComponent <CharacterBody>();
                    if (component)
                    {
                        component.OnLevelChanged();
                    }
                }
                this.teamLevels[(int)teamIndex] = num2;
                this.teamCurrentLevelExperience[(int)teamIndex] = TeamManager.GetExperienceForLevel(num2);
                this.teamNextLevelExperience[(int)teamIndex]    = TeamManager.GetExperienceForLevel(num2 + 1U);
                if (num < num2)
                {
                    GlobalEventManager.OnTeamLevelUp(teamIndex);
                }
            }
            if (NetworkServer.active)
            {
                base.SetDirtyBit(1U << (int)teamIndex);
            }
        }