diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-06 00:39:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-06 23:06:15 +0300 |
commit | 6b291b6515825f4ce0e09df5dec7ea1b619b63a7 (patch) | |
tree | f26a35a21cde34f45538a191b2196bf7c81d2693 /src/client.cpp | |
parent | 833e498f54c1d33be94c09214315b368cccaec06 (diff) | |
download | plus-6b291b6515825f4ce0e09df5dec7ea1b619b63a7.tar.gz plus-6b291b6515825f4ce0e09df5dec7ea1b619b63a7.tar.bz2 plus-6b291b6515825f4ce0e09df5dec7ea1b619b63a7.tar.xz plus-6b291b6515825f4ce0e09df5dec7ea1b619b63a7.zip |
improve a bit different code.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/client.cpp b/src/client.cpp index 5d635f522..cdee0b049 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -185,7 +185,7 @@ bool isSafeMode = false; int serverVersion = 0; unsigned int tmwServerVersion = 0; int start_time; - +unsigned int mLastHost = 0; int textures_count = 0; #ifdef WIN32 @@ -1323,7 +1323,7 @@ int Client::gameExec() // TRANSLATORS: connection dialog header _("Logging in"), STATE_SWITCH_SERVER); mCurrentDialog->postInit(); - accountLogin(&loginData); + Net::getLoginHandler()->loginOrRegister(&loginData); BLOCK_END("Client::gameExec STATE_LOGIN_ATTEMPT") break; @@ -2340,30 +2340,6 @@ void Client::initScreenshotDir() logger->log("screenshotDirectory: " + mScreenshotDir); } -void Client::accountLogin(LoginData *const data) -{ - if (!data) - return; - - logger->log("Username is %s", data->username.c_str()); - - // Send login infos - if (data->registerLogin) - Net::getLoginHandler()->registerAccount(data); - else - Net::getLoginHandler()->loginAccount(data); - - // Clear the password, avoids auto login when returning to login - data->password.clear(); - - const bool remember = data->remember; - if (remember) - serverConfig.setValue("username", data->username); - else - serverConfig.setValue("username", ""); - serverConfig.setValue("remember", remember); -} - #ifndef ANDROID void Client::storeSafeParameters() const { |