git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1339 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
(no author)
2007-07-24 07:59:41 +00:00
parent 7e40835c5e
commit 5bf38488d2
10 changed files with 113 additions and 64 deletions

View File

@@ -18,7 +18,7 @@ namespace OpenRa.Game
int currentFrame = 0;
public int CurrentFrame { get { return currentFrame; } }
public int RemainingNetSyncTime { get { return Math.Min(0, Environment.TickCount - nextSyncTime); } }
public int RemainingNetSyncTime { get { return Math.Max(0, nextSyncTime - Environment.TickCount); } }
Queue<Packet> incomingPackets = new Queue<Packet>();
@@ -36,10 +36,8 @@ namespace OpenRa.Game
Packet packet = Packet.FromReceivedData(sender, data);
lock (this)
{
if (currentFrame <= packet.Frame)
incomingPackets.Enqueue(packet);
}
}
});
@@ -76,7 +74,9 @@ namespace OpenRa.Game
if (p.Frame == currentFrame)
toProcess.Enqueue(p);
}
++currentFrame;
nextSyncTime = Environment.TickCount + netSyncInterval;
}
return toProcess;