net tick interval is now 120ms; local tick is still 40ms

This commit is contained in:
Chris Forbes
2010-03-27 14:43:23 +13:00
parent 9afdf5459e
commit 17b135926d
2 changed files with 13 additions and 4 deletions

View File

@@ -180,6 +180,9 @@ namespace OpenRA
internal static Chat chat = new Chat();
public static int LocalTick = 0;
const int NetTickScale = 3; // 120ms net tick for 40ms local tick
public static void Tick()
{
if (changePending && PackageDownloader.IsIdle())
@@ -199,9 +202,14 @@ namespace OpenRA
orderManager.TickImmediate( world );
if (orderManager.IsReadyForNextFrame)
var isNetTick = LocalTick % NetTickScale == 0;
if (!isNetTick || orderManager.IsReadyForNextFrame)
{
orderManager.Tick(world);
++LocalTick;
if (isNetTick) orderManager.Tick(world);
controller.orderGenerator.Tick(world);
controller.selection.Tick(world);