Fix StyleCop warnings in OpenRA.Game
This commit is contained in:
@@ -27,6 +27,10 @@ namespace OpenRA
|
||||
{
|
||||
public static class Game
|
||||
{
|
||||
public const int NetTickScale = 3; // 120 ms net tick for 40 ms local tick
|
||||
public const int Timestep = 40;
|
||||
public const int TimestepJankThreshold = 250; // Don't catch up for delays larger than 250ms
|
||||
|
||||
public static ModData modData;
|
||||
public static Settings Settings;
|
||||
public static ICursor Cursor;
|
||||
@@ -83,9 +87,6 @@ namespace OpenRA
|
||||
public static int RenderFrame = 0;
|
||||
public static int NetFrameNumber { get { return orderManager.NetFrameNumber; } }
|
||||
public static int LocalTick { get { return orderManager.LocalFrameNumber; } }
|
||||
public const int NetTickScale = 3; // 120 ms net tick for 40 ms local tick
|
||||
public const int Timestep = 40;
|
||||
public const int TimestepJankThreshold = 250; // Don't catch up for delays larger than 250ms
|
||||
|
||||
public static event Action<string, int> OnRemoteDirectConnect = (a, b) => { };
|
||||
public static event Action<OrderManager> ConnectionStateChanged = _ => { };
|
||||
@@ -148,6 +149,7 @@ namespace OpenRA
|
||||
orderManager.World = new World(map, orderManager, isShellmap);
|
||||
orderManager.World.Timestep = Timestep;
|
||||
}
|
||||
|
||||
if (worldRenderer != null)
|
||||
worldRenderer.Dispose();
|
||||
worldRenderer = new WorldRenderer(orderManager.World);
|
||||
@@ -417,7 +419,7 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
var worldTimestep = world == null ? Timestep : world.Timestep;
|
||||
var worldTickDelta = (tick - orderManager.LastTickTime);
|
||||
var worldTickDelta = tick - orderManager.LastTickTime;
|
||||
if (worldTimestep != 0 && worldTickDelta >= worldTimestep)
|
||||
{
|
||||
using (new PerfSample("tick_time"))
|
||||
@@ -426,7 +428,6 @@ namespace OpenRA
|
||||
// If dt < TickJankThreshold then we should try and catch up by repeatedly ticking
|
||||
// If dt >= TickJankThreshold then we should accept the jank and progress at the normal rate
|
||||
// dt is rounded down to an integer tick count in order to preserve fractional tick components.
|
||||
|
||||
var integralTickTimestep = (worldTickDelta / worldTimestep) * worldTimestep;
|
||||
orderManager.LastTickTime += integralTickTimestep >= TimestepJankThreshold ? integralTickTimestep : worldTimestep;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user