diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-12 14:53:32 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-12 14:58:48 +0200 |
commit | 92a8e0403595cd0f4b8b2084c45ec79edca7e7c1 (patch) | |
tree | d1d4b2b6638935f666c6512b467a6ffc3017fb60 /src/main.cpp | |
parent | 14a6e6a4bc5d39ddf8f31efc07a5e2493a6f6d0a (diff) | |
download | mana-92a8e0403595cd0f4b8b2084c45ec79edca7e7c1.tar.gz mana-92a8e0403595cd0f4b8b2084c45ec79edca7e7c1.tar.bz2 mana-92a8e0403595cd0f4b8b2084c45ec79edca7e7c1.tar.xz mana-92a8e0403595cd0f4b8b2084c45ec79edca7e7c1.zip |
Append _F or _M to username in eAthena network layer
Abstracts it away and out of main.cpp and register.cpp.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/main.cpp b/src/main.cpp index 5bd82e33..d10403b5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -736,20 +736,15 @@ static void accountLogin(Network *network, LoginData *loginData) #endif // Send login infos - Net::getLoginHandler()->loginAccount(loginData); + if (loginData->registerLogin) { + Net::getLoginHandler()->registerAccount(loginData); + } else { + Net::getLoginHandler()->loginAccount(loginData); + } // Clear the password, avoids auto login when returning to login loginData->password = ""; -#ifdef EATHENA_SUPPORT - // Remove _M or _F from username after a login for registration purpose - if (loginData->registerLogin) - { - loginData->username = - loginData->username.substr(0, loginData->username.length() - 2); - } -#endif - // TODO This is not the best place to save the config, but at least better // than the login gui window if (loginData->remember) @@ -802,9 +797,7 @@ static void accountRegister(LoginData *loginData) logger->log("Username is %s", loginData->username.c_str()); Net::getCharHandler()->setCharInfo(&charInfo); - - Net::getLoginHandler()->registerAccount(loginData->username, - loginData->password, loginData->email); + Net::getLoginHandler()->registerAccount(loginData); } static void switchCharacter(std::string *passToken) @@ -1465,8 +1458,7 @@ int main(int argc, char *argv[]) case STATE_CHAR_SELECT: logger->log("State: CHAR_SELECT"); currentDialog = new CharSelectDialog(&charInfo, - (loginData.sex == 0) ? - GENDER_FEMALE : GENDER_MALE); + loginData.sex); positionDialog(currentDialog, screenWidth, screenHeight); if (((CharSelectDialog*) currentDialog)-> |