Revert "Refactor the OrderManager and world tick loop, improves input latency"

This reverts commit f642cead44.
This commit is contained in:
Matthias Mailänder
2020-07-20 17:58:48 +02:00
committed by Oliver Brakmann
parent 758b0b08d0
commit b01a534a98
2 changed files with 42 additions and 75 deletions

View File

@@ -579,22 +579,26 @@ namespace OpenRA
orderManager.LastTickTime += integralTickTimestep >= TimestepJankThreshold ? integralTickTimestep : worldTimestep;
Sound.Tick();
Sync.RunUnsynced(Settings.Debug.SyncCheckUnsyncedCode, world, orderManager.TickImmediate);
if (world == null)
{
orderManager.TickPreGame();
return;
}
// Collect orders first, we will dispatch them if we can this frame
Sync.RunUnsynced(Settings.Debug.SyncCheckUnsyncedCode, world, () =>
{
world.OrderGenerator.Tick(world);
});
var isNetTick = LocalTick % NetTickScale == 0;
if (orderManager.TryTick())
if (!isNetTick || orderManager.SendNetFrameOrdersAndCheckReady())
{
Log.Write("debug", "--Tick: {0} ({1})", LocalTick, orderManager.IsNetTick ? "net" : "local");
++orderManager.LocalFrameNumber;
Log.Write("debug", "--Tick: {0} ({1})", LocalTick, isNetTick ? "net" : "local");
if (isNetTick)
orderManager.Tick();
Sync.RunUnsynced(Settings.Debug.SyncCheckUnsyncedCode, world, () =>
{
world.OrderGenerator.Tick(world);
});
world.Tick();