From 4266f0255949cb9f073467e945877251f2f038d0 Mon Sep 17 00:00:00 2001 From: Timo Schwarzer Date: Tue, 23 Mar 2021 23:30:32 +0100 Subject: [PATCH] Mark servers as password protected on RR_INCORRECT_PASSWORD --- src/network/protocols/client_lobby.cpp | 1 + src/network/server.hpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/network/protocols/client_lobby.cpp b/src/network/protocols/client_lobby.cpp index 61453b3c2..2e60d34a3 100644 --- a/src/network/protocols/client_lobby.cpp +++ b/src/network/protocols/client_lobby.cpp @@ -938,6 +938,7 @@ void ClientLobby::connectionRefused(Event* event) } case RR_INCORRECT_PASSWORD: m_server->setReconnectWhenQuitLobby(true); + m_server->setIsPasswordProtected(true); STKHost::get()->setErrorMessage( _("Connection refused: Server password is incorrect.")); break; diff --git a/src/network/server.hpp b/src/network/server.hpp index 280555568..892a43642 100644 --- a/src/network/server.hpp +++ b/src/network/server.hpp @@ -202,6 +202,8 @@ public: // ------------------------------------------------------------------------ virtual void saveServer() const {} // ------------------------------------------------------------------------ + void setIsPasswordProtected(bool password_protected) { m_password_protected = password_protected; } + // ------------------------------------------------------------------------ bool reconnectWhenQuitLobby() const { return m_reconnect_when_quit_lobby; } // ------------------------------------------------------------------------ void setReconnectWhenQuitLobby(bool val)