diff options
author | cpasjuste <cpasjuste@gmail.com> | 2020-04-25 09:13:02 +0200 |
---|---|---|
committer | cpasjuste <cpasjuste@gmail.com> | 2020-04-25 09:13:02 +0200 |
commit | 82735cd2e2d11376fc4f2576542f0f578bb3ed7a (patch) | |
tree | d32e267eddebaa7d89e525e7122864ca3acc7431 /src/progs | |
parent | c4fad09b3d29679b15d456f6cc0d61b0f59a8d4c (diff) | |
download | ManaVerse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.gz ManaVerse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.bz2 ManaVerse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.xz ManaVerse-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.zip |
add "SAVE_PASSWORD" define option
Diffstat (limited to 'src/progs')
-rw-r--r-- | src/progs/manaplus/client.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index cea2d10af..d47404925 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -860,6 +860,11 @@ void Client::stateConnectServer1() { loginData.username = settings.options.username; } +#ifdef SAVE_PASSWORD + LoginDialog::savedPassword = loginData.remember ? + serverConfig.getValue("password", "") : ""; + loginData.password = settings.options.password = LoginDialog::savedPassword; +#endif settings.login = loginData.username; WindowManager::updateTitle(); @@ -1639,6 +1644,12 @@ int Client::gameExec() case State::ERROR: BLOCK_START("Client::gameExec State::ERROR") config.write(); +#ifdef SAVE_PASSWORD + if(errorMessage == "Wrong password.") { + serverConfig.setValue("password", ""); + serverConfig.write(); + } +#endif if (mOldState == State::GAME) serverConfig.write(); logger->log1("State: ERROR"); |