moved internal time step setting to Game
player should not be able change it as it is not synced yet
This commit is contained in:
@@ -73,7 +73,7 @@ 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; // 120ms net tick for 40ms local tick
|
||||
public const int NetTickScale = 3; // 120 ms net tick for 40 ms local tick
|
||||
public const int Timestep = 40;
|
||||
|
||||
public static event Action<OrderManager> ConnectionStateChanged = _ => { };
|
||||
@@ -163,14 +163,15 @@ namespace OpenRA
|
||||
|
||||
static void TickInner(OrderManager orderManager)
|
||||
{
|
||||
int t = Environment.TickCount;
|
||||
int dt = t - orderManager.LastTickTime;
|
||||
if (dt >= Settings.Game.Timestep)
|
||||
var t = Environment.TickCount;
|
||||
var dt = t - orderManager.LastTickTime;
|
||||
var world = orderManager.world;
|
||||
var timestep = world == null ? Timestep : world.Timestep;
|
||||
if (dt >= timestep)
|
||||
using (new PerfSample("tick_time"))
|
||||
{
|
||||
orderManager.LastTickTime += Settings.Game.Timestep;
|
||||
orderManager.LastTickTime += timestep;
|
||||
Ui.Tick();
|
||||
var world = orderManager.world;
|
||||
if (orderManager.GameStarted)
|
||||
++Viewport.TicksSinceLastMove;
|
||||
|
||||
|
||||
@@ -135,9 +135,6 @@ namespace OpenRA.GameRules
|
||||
public bool AlwaysShowStatusBars = false;
|
||||
public bool TeamHealthColors = false;
|
||||
|
||||
// Internal game settings
|
||||
public int Timestep = 40;
|
||||
|
||||
public bool AllowDownloading = true;
|
||||
public string[] MapRepositories = { "http://resource.openra.net/map/", "http://resource.ihptru.net:8080/map/" };
|
||||
}
|
||||
|
||||
@@ -479,7 +479,6 @@
|
||||
<Compile Include="Widgets\Logic\DisconnectWatcherLogic.cs" />
|
||||
<Compile Include="Activities\FlyFollow.cs" />
|
||||
<Compile Include="Modifiers\DisabledOverlay.cs" />
|
||||
<Compile Include="Widgets\Logic\ReplayControlBarLogic.cs" />
|
||||
<Compile Include="Widgets\Logic\GameTimerLogic.cs" />
|
||||
<Compile Include="Immobile.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user