From d823d38e8c89a9e2936ba3a4130caf02eea2259c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 22 Dec 2018 14:40:13 +1300 Subject: [PATCH] Fix "game is full" error when the game is not full. Client.IsObserver is not valid to check until the slot has been assigned. --- OpenRA.Game/Server/Server.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 27f06b1aab..44bff5220b 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -334,13 +334,6 @@ namespace OpenRA.Server IsAdmin = !LobbyInfo.Clients.Any(c1 => c1.IsAdmin) }; - if (client.IsObserver && !LobbyInfo.GlobalSettings.AllowSpectators) - { - SendOrderTo(newConn, "ServerError", "The game is full"); - DropClient(newConn); - return; - } - if (ModData.Manifest.Id != handshake.Mod) { Log.Write("server", "Rejected connection from {0}; mods do not match.", @@ -375,6 +368,13 @@ namespace OpenRA.Server { client.Slot = LobbyInfo.FirstEmptySlot(); + if (client.IsObserver && !LobbyInfo.GlobalSettings.AllowSpectators) + { + SendOrderTo(newConn, "ServerError", "The game is full"); + DropClient(newConn); + return; + } + if (client.Slot != null) SyncClientToPlayerReference(client, Map.Players.Players[client.Slot]); else