//-------------------------------------------------------------------- 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; }
//-------------------------------------------------------------------- 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; }