Ignore malformed orders instead of crashing.

This commit is contained in:
Paul Chote
2018-08-24 17:33:55 +01:00
committed by reaperrr
parent cdfa52d918
commit 8475bd6294

View File

@@ -75,6 +75,8 @@ namespace OpenRA
} }
public static Order Deserialize(World world, BinaryReader r) public static Order Deserialize(World world, BinaryReader r)
{
try
{ {
var magic = r.ReadByte(); var magic = r.ReadByte();
switch (magic) switch (magic)
@@ -171,6 +173,18 @@ namespace OpenRA
} }
} }
} }
catch (Exception e)
{
Log.Write("debug", "Caught exception while processing order");
Log.Write("debug", e.ToString());
// HACK: this can hopefully go away in the future
Game.Debug("Ignoring malformed order that would have crashed the game");
Game.Debug("Please file a bug report and include the replay from this match");
return null;
}
}
static uint UIntFromActor(Actor a) static uint UIntFromActor(Actor a)
{ {