diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/gui/register.cpp | 1 | ||||
-rw-r--r-- | src/logindata.h | 1 | ||||
-rw-r--r-- | src/main.cpp | 7 |
4 files changed, 15 insertions, 1 deletions
@@ -1,4 +1,9 @@ -2007-02-11 Philipp Sehmisch <tmw@crushnet.org> +2007-02-13 Philipp Sehmisch <tmw@crushnet.org> + + * src/gui/register.cpp, src/logindata.h, src/main.cpp: Fixed the _M/_F + username bug. + +2007-02-11 Philipp Sehmisch <tmw@crushnet.org> * data/maps/new_1-9.tmx.gz, data/maps/new_1-14.tmx.gz, data/maps/new_1-16.tmx.gz: Restored the cloud shadow overlays in the diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 9e6a66ed..c8f3c1e1 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -206,6 +206,7 @@ RegisterDialog::action(const gcn::ActionEvent &event) mLoginData->username = mUserField->getText(); mLoginData->password = mPasswordField->getText(); mLoginData->username += mFemaleButton->isMarked() ? "_F" : "_M"; + mLoginData->registerLogin = true; state = ACCOUNT_STATE; } diff --git a/src/logindata.h b/src/logindata.h index f4fcd1b1..82623ba5 100644 --- a/src/logindata.h +++ b/src/logindata.h @@ -37,6 +37,7 @@ struct LoginData char sex; bool remember; + bool registerLogin; }; #endif diff --git a/src/main.cpp b/src/main.cpp index 364b8a61..3e7576aa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -421,6 +421,12 @@ void accountLogin(Network *network, LoginData *loginData) // Clear the password, avoids auto login when returning to login loginData->password = ""; + //remove _M or _F from username after a login for registration purpose + if (loginData->registerLogin) + { + loginData->registerLogin = false; + loginData->username = loginData->username.substr(0, loginData->username.length() - 2); + } // TODO This is not the best place to save the config, but at least better // than the login gui window if (loginData->remember) { @@ -538,6 +544,7 @@ int main(int argc, char *argv[]) loginData.hostname = config.getValue("host", "server.themanaworld.org"); loginData.port = (short)config.getValue("port", 0); loginData.remember = config.getValue("remember", 0); + loginData.registerLogin = false; SDLNet_Init(); Network *network = new Network(); |