Move NetTickScale (now NetFrameInterval) control to the server.
This commit is contained in:
@@ -30,7 +30,6 @@ namespace OpenRA
|
||||
{
|
||||
public static class Game
|
||||
{
|
||||
public const int NetTickScale = 3; // 120 ms net tick for 40 ms local tick
|
||||
public const int TimestepJankThreshold = 250; // Don't catch up for delays larger than 250ms
|
||||
|
||||
public static InstalledMods Mods { get; private set; }
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace OpenRA.Network
|
||||
{
|
||||
var shouldTick = true;
|
||||
|
||||
if (IsNetTick)
|
||||
if (IsNetFrame)
|
||||
{
|
||||
// Check whether or not we will be ready for a tick next frame
|
||||
// We don't need to include ourselves in the equation because we can always generate orders this frame
|
||||
@@ -293,7 +293,7 @@ namespace OpenRA.Network
|
||||
}
|
||||
|
||||
var willTick = shouldTick;
|
||||
if (willTick && IsNetTick)
|
||||
if (willTick && IsNetFrame)
|
||||
{
|
||||
willTick = IsReadyForNextFrame;
|
||||
if (willTick)
|
||||
@@ -306,6 +306,8 @@ namespace OpenRA.Network
|
||||
return willTick;
|
||||
}
|
||||
|
||||
bool IsNetTick => LocalFrameNumber % Game.NetTickScale == 0;
|
||||
// The server may request clients to batch multiple frames worth of orders into a single packet
|
||||
// to improve robustness against network jitter at the expense of input latency
|
||||
bool IsNetFrame => LocalFrameNumber % LobbyInfo.GlobalSettings.NetFrameInterval == 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,6 +218,9 @@ namespace OpenRA.Network
|
||||
public bool Dedicated;
|
||||
public bool GameSavesEnabled;
|
||||
|
||||
// 120ms network frame interval for 40ms local tick
|
||||
public int NetFrameInterval = 3;
|
||||
|
||||
[FieldLoader.Ignore]
|
||||
public Dictionary<string, LobbyOptionState> LobbyOptions = new Dictionary<string, LobbyOptionState>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user