Skip to content

Commit

Permalink
Fixes required to make jrb's servers work.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Jan 27, 2019
1 parent 3e9bf36 commit 3c7f763
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions OpenRA.Game/Network/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ public virtual void Send(int frame, List<byte[]> orders)

public virtual void SendImmediate(List<byte[]> orders)
{
var ms = new MemoryStream();
ms.WriteArray(BitConverter.GetBytes(0));
foreach (var o in orders)
{
var ms = new MemoryStream();
ms.WriteArray(BitConverter.GetBytes(0));
ms.WriteArray(o);
Send(ms.ToArray());
Send(ms.ToArray());
}
}

public virtual void SendSync(int frame, byte[] syncData)
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Game/Network/OrderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ public void Tick()
if (!IsReadyForNextFrame)
throw new InvalidOperationException();

Connection.Send(NetFrameNumber + FramesAhead, localOrders.Select(o => o.Serialize()).ToList());
localOrders.Clear();
Connection.Send(NetFrameNumber + FramesAhead, localOrders.Where(o => !o.IsImmediate).Select(o => o.Serialize()).ToList());
localOrders.RemoveAll(o => !o.IsImmediate);

foreach (var order in frameData.OrdersForFrame(World, NetFrameNumber))
UnitOrders.ProcessOrder(this, World, order.Client, order.Order);
Expand Down

0 comments on commit 3c7f763

Please sign in to comment.