Пример #1
0
 // Token: 0x0600543A RID: 21562 RVA: 0x001D16BC File Offset: 0x001CFABC
 public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
 {
     if (stream.isWriting)
     {
         this._ping            = (short)PhotonNetwork.GetPing();
         this._pingVariance    = (short)PhotonNetwork.networkingPeer.RoundTripTimeVariance;
         this._qualityCounter += 1;
         stream.SendNext(this._ping);
         stream.SendNext(this._pingVariance);
         stream.SendNext(this._qualityCounter);
         stream.SendNext(PhotonNetwork.ServerTimestamp);
     }
     else
     {
         this._ping         = (short)stream.ReceiveNext();
         this._pingVariance = (short)stream.ReceiveNext();
         short num  = (short)stream.ReceiveNext();
         int   num2 = (int)stream.ReceiveNext();
         if (this._qualityCounter + 1 != num || Time.time.AlmostEquals(this.lastTime, Time.smoothDeltaTime))
         {
             this._frames.Add(new PlayerNet.Frame
             {
                 expected = false,
                 time     = Time.time
             });
         }
         else
         {
             this._frames.Add(new PlayerNet.Frame
             {
                 expected = true,
                 time     = Time.time
             });
             this.lastTime = Time.time;
         }
         this._connectionQuality = null;
         this._qualityCounter    = num;
         this._receiveTimes.Add(info.timestamp);
         int transitTimeMs = PhotonNetwork.ServerTimestamp - num2;
         this.AccumulateTransitTimeAverage(transitTimeMs);
         int timestampDeltaMS = info.timestampInMilliseconds - num2;
         this.AccumulateTimestampDeltaAverage(timestampDeltaMS);
     }
     PhotonBandwidthGui.RecordPlayerStat(this.vrcPlayer.player);
 }