Sync only once per tick, rather than once per tick and once per order.
This greatly improves performance by not syncing the world state for every single order processed as this becomes very expensive, at the cost of being unable to directly pinpoint the order that causes a desync. Instead the granularity of detecting desyncs is reduced to the tick level.
This commit is contained in:
@@ -35,14 +35,13 @@ namespace OpenRA.Network
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static byte[] SerializeSync(this List<int> sync)
|
||||
public static byte[] SerializeSync(int sync)
|
||||
{
|
||||
var ms = new MemoryStream();
|
||||
using (var writer = new BinaryWriter(ms))
|
||||
{
|
||||
writer.Write((byte)0x65);
|
||||
foreach (var s in sync)
|
||||
writer.Write(s);
|
||||
writer.Write(sync);
|
||||
}
|
||||
|
||||
return ms.ToArray();
|
||||
|
||||
Reference in New Issue
Block a user