Rename Ping -> Latency.

This commit is contained in:
Paul Chote
2013-04-25 13:43:05 +12:00
parent a1d2229a58
commit fd58461d43
7 changed files with 41 additions and 41 deletions

View File

@@ -469,16 +469,16 @@ namespace OpenRA.Server
break;
}
var history = fromClient.PingHistory.ToList();
var history = fromClient.LatencyHistory.ToList();
history.Add(Environment.TickCount - pingSent);
// Cap ping history at 5 values (25 seconds)
if (history.Count > 5)
history.RemoveRange(0, history.Count - 5);
fromClient.Ping = history.Sum() / history.Count;
fromClient.PingJitter = (history.Max() - history.Min())/2;
fromClient.PingHistory = history.ToArray();
fromClient.Latency = history.Sum() / history.Count;
fromClient.LatencyJitter = (history.Max() - history.Min())/2;
fromClient.LatencyHistory = history.ToArray();
if (State == ServerState.WaitingPlayers)
SyncLobbyInfo();