From e70fd2cf3aa1f23f074da8a8b720c85c6dc12294 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 31 Dec 2018 03:52:25 +0200 Subject: [PATCH] [Server] Accept clients with wrong password on servers with no password --- apps/openmw-mp/Networking.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 0c9602941..cb68bfa04 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -112,10 +112,18 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) if (player->serverPassword != serverPassword) { - LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Wrong server password %s used by client at %s", - player->serverPassword.c_str(), packet->systemAddress.ToString()); - kickPlayer(player->guid); - return; + if (isPassworded()) + { + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Wrong server password %s used by client at %s", + player->serverPassword.c_str(), packet->systemAddress.ToString()); + kickPlayer(player->guid); + return; + } + else + { + LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Client at %s tried to join using password, despite the server not being passworded", + packet->systemAddress.ToString()); + } } player->setHandshake(); return;