Пример #1
0
 // Token: 0x0600535D RID: 21341 RVA: 0x001CABF0 File Offset: 0x001C8FF0
 public static void RecordEvent(EventData evt, PhotonPlayer originatingPlayer)
 {
     if (!PhotonBandwidthGui.ShouldRecord)
     {
         return;
     }
     try
     {
         PhotonBandwidthGui instance = PhotonBandwidthGui._instance;
         string             name     = Enum.GetName(typeof(PhotonBandwidthGui.EventTypes), (PhotonBandwidthGui.EventTypes)evt.Code);
         int    bytes = Protocol.Serialize(evt.Parameters).Length;
         object obj   = instance.serializationStatistics;
         lock (obj)
         {
             instance.serializationStatistics.Insert(0, new PhotonBandwidthGui.UsageData
             {
                 name       = name,
                 bytes      = bytes,
                 frame      = instance.frame,
                 type       = PhotonBandwidthGui.UsageType.Event,
                 addToTotal = true
             });
         }
         if (evt.Code == 201 || evt.Code == 206)
         {
             Hashtable hashtable = (Hashtable)evt[245];
             byte      b         = 10;
             int       num       = 1;
             if (hashtable.ContainsKey(1))
             {
                 short num2 = (short)hashtable[1];
                 num = 2;
             }
             byte b2 = b;
             while ((int)(b2 - b) < hashtable.Count - num)
             {
                 object[] array = hashtable[b2] as object[];
                 PhotonBandwidthGui.RecordSerialization(PhotonView.Find((int)array[0]), array);
                 b2 += 1;
             }
         }
         if (originatingPlayer != null)
         {
             object obj2 = instance.serializationStatistics;
             lock (obj2)
             {
                 instance.serializationStatistics.Insert(0, new PhotonBandwidthGui.UsageData
                 {
                     name       = originatingPlayer.NickName,
                     bytes      = bytes,
                     frame      = instance.frame,
                     type       = PhotonBandwidthGui.UsageType.Player,
                     addToTotal = false
                 });
             }
         }
     }
     catch
     {
     }
 }