Example #1
0
 // Token: 0x06001C5C RID: 7260 RVA: 0x0008F8FC File Offset: 0x0008DAFC
 public void Update(EndOfMatchData data)
 {
     this.Data = data;
     this.Data.TimeInGameMinutes++;
     if (this.Data.TimeInGameMinutes < 60)
     {
         this.PlayTime = "Less than 1 min";
     }
     else
     {
         this.PlayTime = string.Format("{0} min", Mathf.CeilToInt((float)(this.Data.TimeInGameMinutes / 60)));
     }
     this.Kills      = string.Format("{0}", Mathf.Max(0, this.Data.PlayerStatsTotal.GetKills()));
     this.Headshots  = string.Format("{0}", Mathf.Max(0, this.Data.PlayerStatsTotal.Headshots));
     this.Smackdowns = string.Format("{0}", Mathf.Max(0, this.Data.PlayerStatsTotal.MeleeKills));
     this.Nutshots   = string.Format("{0}", Mathf.Max(0, this.Data.PlayerStatsTotal.Nutshots));
     this.Deaths     = this.Data.PlayerStatsTotal.Deaths.ToString();
     this.Suicides   = (-this.Data.PlayerStatsTotal.Suicides).ToString();
     this.KDR        = this.GetKdr(this.Data.PlayerStatsTotal).ToString("N1");
     this.CalculateXp();
     this.CalculatePoints();
     this.Data.PlayerStatsTotal.Xp     = this.GainedXp;
     this.Data.PlayerStatsTotal.Points = this.GainedPts;
     GameState.Current.UpdatePlayerStatistics(this.Data.PlayerStatsTotal, this.Data.PlayerStatsBestPerLife);
 }
        // Token: 0x060010C0 RID: 4288 RVA: 0x00016AB0 File Offset: 0x00014CB0
        public static EndOfMatchData Deserialize(Stream bytes)
        {
            int            num            = Int32Proxy.Deserialize(bytes);
            EndOfMatchData endOfMatchData = new EndOfMatchData();

            endOfMatchData.HasWonMatch = BooleanProxy.Deserialize(bytes);
            if ((num & 1) != 0)
            {
                endOfMatchData.MatchGuid = StringProxy.Deserialize(bytes);
            }
            endOfMatchData.MostEffecientWeaponId = Int32Proxy.Deserialize(bytes);
            if ((num & 2) != 0)
            {
                endOfMatchData.MostValuablePlayers = ListProxy <StatsSummary> .Deserialize(bytes, new ListProxy <StatsSummary> .Deserializer <StatsSummary>(StatsSummaryProxy.Deserialize));
            }
            if ((num & 4) != 0)
            {
                endOfMatchData.PlayerStatsBestPerLife = StatsCollectionProxy.Deserialize(bytes);
            }
            if ((num & 8) != 0)
            {
                endOfMatchData.PlayerStatsTotal = StatsCollectionProxy.Deserialize(bytes);
            }
            if ((num & 16) != 0)
            {
                endOfMatchData.PlayerXpEarned = DictionaryProxy <byte, ushort> .Deserialize(bytes, new DictionaryProxy <byte, ushort> .Deserializer <byte>(ByteProxy.Deserialize), new DictionaryProxy <byte, ushort> .Deserializer <ushort>(UInt16Proxy.Deserialize));
            }
            endOfMatchData.TimeInGameMinutes = Int32Proxy.Deserialize(bytes);
            return(endOfMatchData);
        }
 // Token: 0x0600132D RID: 4909 RVA: 0x000218EC File Offset: 0x0001FAEC
 private void MatchEnd(byte[] _bytes)
 {
     using (MemoryStream memoryStream = new MemoryStream(_bytes))
     {
         EndOfMatchData data = EndOfMatchDataProxy.Deserialize(memoryStream);
         this.OnMatchEnd(data);
     }
 }
        // Token: 0x060010BF RID: 4287 RVA: 0x00016980 File Offset: 0x00014B80
        public static void Serialize(Stream stream, EndOfMatchData instance)
        {
            int num = 0;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                BooleanProxy.Serialize(memoryStream, instance.HasWonMatch);
                if (instance.MatchGuid != null)
                {
                    StringProxy.Serialize(memoryStream, instance.MatchGuid);
                }
                else
                {
                    num |= 1;
                }
                Int32Proxy.Serialize(memoryStream, instance.MostEffecientWeaponId);
                if (instance.MostValuablePlayers != null)
                {
                    ListProxy <StatsSummary> .Serialize(memoryStream, instance.MostValuablePlayers, new ListProxy <StatsSummary> .Serializer <StatsSummary>(StatsSummaryProxy.Serialize));
                }
                else
                {
                    num |= 2;
                }
                if (instance.PlayerStatsBestPerLife != null)
                {
                    StatsCollectionProxy.Serialize(memoryStream, instance.PlayerStatsBestPerLife);
                }
                else
                {
                    num |= 4;
                }
                if (instance.PlayerStatsTotal != null)
                {
                    StatsCollectionProxy.Serialize(memoryStream, instance.PlayerStatsTotal);
                }
                else
                {
                    num |= 8;
                }
                if (instance.PlayerXpEarned != null)
                {
                    DictionaryProxy <byte, ushort> .Serialize(memoryStream, instance.PlayerXpEarned, new DictionaryProxy <byte, ushort> .Serializer <byte>(ByteProxy.Serialize), new DictionaryProxy <byte, ushort> .Serializer <ushort>(UInt16Proxy.Serialize));
                }
                else
                {
                    num |= 16;
                }
                Int32Proxy.Serialize(memoryStream, instance.TimeInGameMinutes);
                Int32Proxy.Serialize(stream, ~num);
                memoryStream.WriteTo(stream);
            }
        }
    // Token: 0x06001A92 RID: 6802 RVA: 0x0008ABBC File Offset: 0x00088DBC
    public AchievementType GetPlayersFirstAchievement(EndOfMatchData endOfMatchData)
    {
        AchievementType result       = AchievementType.None;
        StatsSummary    statsSummary = endOfMatchData.MostValuablePlayers.Find((StatsSummary p) => p.Cmid == PlayerDataManager.Cmid);

        if (statsSummary != null)
        {
            List <AchievementType> list = new List <AchievementType>();
            foreach (KeyValuePair <byte, ushort> keyValuePair in statsSummary.Achievements)
            {
                list.Add((AchievementType)keyValuePair.Key);
            }
            if (list.Count > 0)
            {
                result = list[0];
            }
        }
        return(result);
    }
 // Token: 0x06001307 RID: 4871
 protected abstract void OnMatchEnd(EndOfMatchData data);
Example #7
0
 // Token: 0x060019D3 RID: 6611 RVA: 0x00010E6E File Offset: 0x0000F06E
 protected override void OnMatchEnd(EndOfMatchData data)
 {
     GameState.Current.Statistics.Update(data);
     GameState.Current.MatchState.SetState(GameStateId.EndOfMatch);
     GameState.Current.UpdatePlayersReady();
 }