Пример #1
0
 // Token: 0x06005360 RID: 21344 RVA: 0x001CB0E8 File Offset: 0x001C94E8
 public static void RecordPlayerStat(Player player)
 {
     if (!PhotonBandwidthGui.ShouldRecord)
     {
         return;
     }
     try
     {
         PhotonBandwidthGui instance = PhotonBandwidthGui._instance;
         object             obj      = instance.playerStats;
         lock (obj)
         {
             if (!instance.playerStats.ContainsKey(player))
             {
                 instance.playerStats.Add(player, new List <PhotonBandwidthGui.PlayerStat>());
             }
         }
         object obj2 = instance.playerStats;
         lock (obj2)
         {
             instance.playerStats[player].Insert(0, new PhotonBandwidthGui.PlayerStat
             {
                 frame   = instance.frame,
                 ping    = (float)PhotonBandwidthGui.ApproximatePing(player),
                 quality = player.vrcPlayer.ConnectionQuality
             });
         }
     }
     catch
     {
     }
 }
Пример #2
0
    // Token: 0x0600536D RID: 21357 RVA: 0x001CC800 File Offset: 0x001CAC00
    private void DrawUsageList(IEnumerable <KeyValuePair <string, PhotonBandwidthGui.UsageTotal> > usage, Dictionary <string, int> frameCounts, PhotonBandwidthGui.UsageType type)
    {
        int num = 50;

        foreach (KeyValuePair <string, PhotonBandwidthGui.UsageTotal> keyValuePair in usage)
        {
            if (type != PhotonBandwidthGui.UsageType.Player)
            {
                this.DrawRow(string.Format("{0}", keyValuePair.Key), string.Format("{0} ({1})", keyValuePair.Value.total, keyValuePair.Value.maximum), string.Format("{0}", (double)frameCounts[keyValuePair.Key]), string.Format("{0:F3}", (double)keyValuePair.Value.total / (double)frameCounts[keyValuePair.Key]), string.Empty);
            }
            else if (keyValuePair.Value.obj != null)
            {
                Player componentInSelfOrParent = keyValuePair.Value.obj.GetComponentInSelfOrParent <Player>();
                float  num2 = (!(componentInSelfOrParent.playerNet == null)) ? componentInSelfOrParent.playerNet.ConnectionDisparity : 0f;
                this.DrawRow(string.Format("{0} {1}", componentInSelfOrParent.name, componentInSelfOrParent.GetPhotonPlayerId()), string.Format("{0} ({1})", keyValuePair.Value.total, keyValuePair.Value.maximum), string.Format("{0}", (double)frameCounts[keyValuePair.Key]), string.Format("{0:F3}", (double)keyValuePair.Value.total / (double)frameCounts[keyValuePair.Key]), string.Format("{0}ms, {1:F2}ms, {2}%", PhotonBandwidthGui.ApproximatePing(componentInSelfOrParent), num2, Mathf.CeilToInt(100f * componentInSelfOrParent.vrcPlayer.ConnectionQuality)));
            }
            num--;
            if (num == 0)
            {
                break;
            }
        }
    }