diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs index ef11cde37..08897f112 100644 --- a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs +++ b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs @@ -1650,6 +1650,7 @@ namespace Barotrauma.Networking public void ReportError(ClientNetError error,UInt16 expectedID=0,UInt16 eventID=0,UInt16 entityID=0) { NetOutgoingMessage outMsg = client.CreateMessage(); + outMsg.Write((byte)ClientPacketHeader.ERROR); outMsg.Write((byte)error); switch (error) { diff --git a/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs b/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs index 2eb44d022..0989ffc84 100644 --- a/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaShared/Source/Networking/GameServer.cs @@ -648,8 +648,15 @@ namespace Barotrauma.Networking break; } - GameServer.Log(c.Name+" has reported an error: "+errorStr, ServerLog.MessageType.Error); - KickClient(c, errorStr); + if (c == null) + { + KickClient(inc.SenderConnection, errorStr); + } + else + { + GameServer.Log(c.Name + " has reported an error: " + errorStr, ServerLog.MessageType.Error); + KickClient(c, errorStr); + } } private void ClientReadLobby(NetIncomingMessage inc)