Mark servers as password protected on RR_INCORRECT_PASSWORD

This commit is contained in:
Timo Schwarzer 2021-03-23 23:30:32 +01:00
parent 8819e633f8
commit 4266f02559
2 changed files with 3 additions and 0 deletions

View File

@ -938,6 +938,7 @@ void ClientLobby::connectionRefused(Event* event)
} }
case RR_INCORRECT_PASSWORD: case RR_INCORRECT_PASSWORD:
m_server->setReconnectWhenQuitLobby(true); m_server->setReconnectWhenQuitLobby(true);
m_server->setIsPasswordProtected(true);
STKHost::get()->setErrorMessage( STKHost::get()->setErrorMessage(
_("Connection refused: Server password is incorrect.")); _("Connection refused: Server password is incorrect."));
break; break;

View File

@ -202,6 +202,8 @@ public:
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
virtual void saveServer() const {} virtual void saveServer() const {}
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
void setIsPasswordProtected(bool password_protected) { m_password_protected = password_protected; }
// ------------------------------------------------------------------------
bool reconnectWhenQuitLobby() const { return m_reconnect_when_quit_lobby; } bool reconnectWhenQuitLobby() const { return m_reconnect_when_quit_lobby; }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
void setReconnectWhenQuitLobby(bool val) void setReconnectWhenQuitLobby(bool val)