diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/ea/loginhandler.cpp | 19 | ||||
-rw-r--r-- | src/net/logindata.h | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 2fc177476..fbae0813f 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -153,21 +153,20 @@ void LoginHandler::loginOrRegister(LoginData *const data) const const bool remember = data->remember; if (remember) - { serverConfig.setValue("username", data->username); -#ifdef SAVE_PASSWORD - serverConfig.setValue("password", data->password); -#endif - } else - { serverConfig.setValue("username", ""); -#ifdef SAVE_PASSWORD - serverConfig.setValue("password", ""); -#endif - } + serverConfig.setValue("remember", remember); + const bool remember_password = data->remember_password; + if (remember_password) + serverConfig.setValue("password", data->password); + else + serverConfig.setValue("password", ""); + + serverConfig.setValue("remember_password", remember_password); + // Clear the password, avoids auto login when returning to login data->password.clear(); } diff --git a/src/net/logindata.h b/src/net/logindata.h index 68306dced..61a3d1c7a 100644 --- a/src/net/logindata.h +++ b/src/net/logindata.h @@ -48,6 +48,7 @@ class LoginData final gender(Gender::UNSPECIFIED), packetVersion(0), remember(false), + remember_password(false), registerLogin(false), characterSlots(9) { @@ -71,6 +72,7 @@ class LoginData final int packetVersion; bool remember; // Whether to store the username. + bool remember_password; // Whether to store the password. bool registerLogin; // Whether an account is being registered. uint16_t characterSlots; // The number of character slots |