コード例 #1
0
        public static ConnectionStatistics operator -(ConnectionStatistics s1, ConnectionStatistics s2)
        {
            ConnectionStatistics c = new ConnectionStatistics(
                s1.PacketsIn - s2.PacketsIn,
                s1.BytesIn - s2.BytesIn,
                s1.PacketsOut - s2.PacketsOut,
                s1.BytesOut - s2.BytesOut,
                s1.UncompressedBytesIn - s2.UncompressedBytesIn,
                s1.UncompressedBytesOut - s2.UncompressedBytesOut
                );

            c.RoundTripTime = s1.RoundTripTime;
            return(c);
        }
コード例 #2
0
 public static ConnectionStatistics Convert(NetPeerStatistics n, float rtt)
 {
     if (n != null)
     {
         ConnectionStatistics c = new ConnectionStatistics(
             n.ReceivedPackets, n.ReceivedBytes,
             n.SentPackets, n.SentBytes,
             n.ReceivedBytes, n.SentBytes);
         c.RoundTripTime = rtt;
         return(c);
     }
     else
     {
         ConnectionStatistics c = new ConnectionStatistics();
         c.RoundTripTime = rtt;
         return(c);
     }
 }
コード例 #3
0
ファイル: Net.cs プロジェクト: cody82/spacewar-arena
 public static ConnectionStatistics Convert(NetPeerStatistics n,float rtt)
 {
     if (n != null)
     {
         ConnectionStatistics c = new ConnectionStatistics(
             n.ReceivedPackets, n.ReceivedBytes,
             n.SentPackets, n.SentBytes,
             n.ReceivedBytes, n.SentBytes);
         c.RoundTripTime = rtt;
         return c;
     }
     else
     {
         ConnectionStatistics c = new ConnectionStatistics();
         c.RoundTripTime = rtt;
         return c;
     }
 }
コード例 #4
0
ファイル: Net.cs プロジェクト: cody82/spacewar-arena
 public static ConnectionStatistics operator -(ConnectionStatistics s1,ConnectionStatistics s2)
 {
     ConnectionStatistics c=new ConnectionStatistics(
         s1.PacketsIn - s2.PacketsIn,
         s1.BytesIn - s2.BytesIn,
         s1.PacketsOut - s2.PacketsOut,
         s1.BytesOut - s2.BytesOut,
         s1.UncompressedBytesIn - s2.UncompressedBytesIn,
         s1.UncompressedBytesOut - s2.UncompressedBytesOut
         );
     c.RoundTripTime = s1.RoundTripTime;
     return c;
 }