Rename Ping -> Latency.
This commit is contained in:
@@ -61,9 +61,9 @@ namespace OpenRA.Network
|
||||
public bool IsAdmin;
|
||||
public bool IsReady { get { return State == ClientState.Ready; } }
|
||||
public bool IsObserver { get { return Slot == null; } }
|
||||
public int Ping = -1;
|
||||
public int PingJitter = -1;
|
||||
public int[] PingHistory = {};
|
||||
public int Latency = -1;
|
||||
public int LatencyJitter = -1;
|
||||
public int[] LatencyHistory = {};
|
||||
}
|
||||
|
||||
public class Slot
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user