Пример #1
0
    //--------------------------------------------------------------------
    protected override void OnMessageReceivedSync(IPEndPoint fromUser, NetMessage data)
    {
        double totMs = DateTime.UtcNow.Subtract(data.PopDatetime()).TotalMilliseconds;

        SPingTotal += totMs;
        ++SPingCount;
        SPing = (float)(SPingTotal / SPingCount) + "  -  " + (float)totMs;
    }
Пример #2
0
 //--------------------------------------------------------------------
 protected override void OnMessageReceivedAsync(IPEndPoint fromUser, NetMessage data, bool reliable)
 {
     if (GetAsync)
     {
         double totMs = DateTime.UtcNow.Subtract(data.PopDatetime()).TotalMilliseconds;
         APingTotal += totMs;
         ++APingCount;
         APing = (float)(APingTotal / APingCount) + "  -  " + (float)totMs;
     }
     else
     {
         PushToMainThread(fromUser, data);
     }
     GetAsync = !GetAsync;
 }