summaryrefslogtreecommitdiff
path: root/src/progs/manaplus/client.cpp
diff options
context:
space:
mode:
authorcpasjuste <cpasjuste@gmail.com>2020-04-25 09:13:02 +0200
committercpasjuste <cpasjuste@gmail.com>2020-04-25 09:13:02 +0200
commit82735cd2e2d11376fc4f2576542f0f578bb3ed7a (patch)
treed32e267eddebaa7d89e525e7122864ca3acc7431 /src/progs/manaplus/client.cpp
parentc4fad09b3d29679b15d456f6cc0d61b0f59a8d4c (diff)
downloadmv-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.gz
mv-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.bz2
mv-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.tar.xz
mv-82735cd2e2d11376fc4f2576542f0f578bb3ed7a.zip
add "SAVE_PASSWORD" define option
Diffstat (limited to 'src/progs/manaplus/client.cpp')
-rw-r--r--src/progs/manaplus/client.cpp11
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");