From 575b568c6a3e1f80c7116d82ec34fc2512e53c84 Mon Sep 17 00:00:00 2001 From: LunaticEdit Date: Mon, 13 Apr 2015 00:44:37 -0400 Subject: [PATCH] EndOfStream first chance exceptions on server The server class reads the memory stream in a forever loop until an EndOfStreamException occurs. This causes repeated first chance exceptions due to EndOfStreamException. This change verifies that the memory stream's reader position is not past the length of the memory stream. --- OpenRA.Game/Server/Server.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 7489035e20..c9a7a62f1d 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -425,7 +425,7 @@ namespace OpenRA.Server try { - for (;;) + while (ms.Position < ms.Length) { var so = ServerOrder.Deserialize(br); if (so == null) return;