diff --git a/Subsurface/Source/Networking/GameServer.cs b/Subsurface/Source/Networking/GameServer.cs index 2fc1700a5..5ac52c0ae 100644 --- a/Subsurface/Source/Networking/GameServer.cs +++ b/Subsurface/Source/Networking/GameServer.cs @@ -554,14 +554,14 @@ namespace Barotrauma.Networking case ClientNetObject.SYNC_IDS: //TODO: might want to use a clever class for this UInt32 lastLobbyUpdID = inc.ReadUInt32(); - if (lastLobbyUpdID > c.lastRecvLobbyUpdate) - { - c.lastRecvLobbyUpdate = lastLobbyUpdID; + if (lastLobbyUpdID > c.lastRecvLobbyUpdate) + { + c.lastRecvLobbyUpdate = lastLobbyUpdID; } - UInt32 lastChatID = inc.ReadUInt32(); - if (lastChatID > c.lastRecvChatMsgID) - { - c.lastRecvChatMsgID = lastChatID; + UInt32 lastChatID = inc.ReadUInt32(); + if (lastChatID > c.lastRecvChatMsgID) + { + c.lastRecvChatMsgID = lastChatID; } break; case ClientNetObject.CHAT_MESSAGE: @@ -604,36 +604,36 @@ namespace Barotrauma.Networking private void ClientWriteLobby(Client c) { NetOutgoingMessage outmsg = server.CreateMessage(); - outmsg.Write((byte)ServerPacketHeader.UPDATE_LOBBY); - + outmsg.Write((byte)ServerPacketHeader.UPDATE_LOBBY); + outmsg.Write((byte)ServerNetObject.SYNC_IDS); - if (c.lastRecvLobbyUpdate 3) { //disconnect and ban after too many failed attempts + banList.BanPlayer("Unnamed", unauthClient.Connection.RemoteEndPoint.Address.ToString()); unauthClient.Connection.Disconnect("Too many failed login attempts. You have been automatically banned from the server."); unauthenticatedClients.Remove(unauthClient); - banList.BanPlayer("Unnamed", unauthClient.Connection.RemoteEndPoint.Address.ToString()); unauthClient = null; return; }