diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2008-04-18 23:47:23 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2008-04-18 23:47:23 +0000 |
commit | f99ed4c4efcaff47c643a2683e489594d759151f (patch) | |
tree | d0df967052ec02460b1132e60b9d8055fe95578f /src/main.cpp | |
parent | 327db845912a5e3857438fc0ad5ed0543f25a79f (diff) | |
download | mana-f99ed4c4efcaff47c643a2683e489594d759151f.tar.gz mana-f99ed4c4efcaff47c643a2683e489594d759151f.tar.bz2 mana-f99ed4c4efcaff47c643a2683e489594d759151f.tar.xz mana-f99ed4c4efcaff47c643a2683e489594d759151f.zip |
Made mislogins and misregistrations a little less annoying for the user.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4fc959cf..cc137752 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -502,6 +502,14 @@ namespace { state = STATE_CHAR_SELECT; } } accountListener; + + struct LoginListener : public gcn::ActionListener + { + void action(const gcn::ActionEvent &event) + { + state = STATE_LOGIN; + } + } loginListener; } // TODO Find some nice place for these functions @@ -521,13 +529,6 @@ void accountLogin(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->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) @@ -936,6 +937,13 @@ int main(int argc, char *argv[]) accountLogin(&loginData); break; + case STATE_LOGIN_ERROR: + logger->log("State: LOGIN ERROR"); + currentDialog = new OkDialog("Error ", errorMessage); + currentDialog->addActionListener(&loginListener); + currentDialog = NULL; // OkDialog deletes itself + break; + case STATE_SWITCH_ACCOUNTSERVER: logger->log("State: SWITCH_ACCOUNTSERVER"); |