diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2008-04-25 23:15:03 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2008-04-25 23:15:03 +0000 |
commit | 536f18bdaae32831aa92702535586f26d0628a42 (patch) | |
tree | f438efa69af7a6588bd00df126cd1f7c07bb8641 /src/net | |
parent | 23e6d031b6c9f20dea6ba48dd1826d3286e18233 (diff) | |
download | mana-536f18bdaae32831aa92702535586f26d0628a42.tar.gz mana-536f18bdaae32831aa92702535586f26d0628a42.tar.bz2 mana-536f18bdaae32831aa92702535586f26d0628a42.tar.xz mana-536f18bdaae32831aa92702535586f26d0628a42.zip |
Added client-side email address change ability.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/loginhandler.cpp | 32 | ||||
-rw-r--r-- | src/net/protocol.h | 2 |
2 files changed, 32 insertions, 2 deletions
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 39b2e194..3a5b1c64 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -35,6 +35,7 @@ LoginHandler::LoginHandler() APMSG_REGISTER_RESPONSE, APMSG_RECONNECT_RESPONSE, APMSG_PASSWORD_CHANGE_RESPONSE, + APMSG_EMAIL_CHANGE_RESPONSE, 0 }; handledMessages = _messages; @@ -167,5 +168,36 @@ void LoginHandler::handleMessage(MessageIn &msg) } } break; + + case APMSG_EMAIL_CHANGE_RESPONSE: + { + int errMsg = msg.readInt8(); + // Successful pass change + if (errMsg == ERRMSG_OK) + { + state = STATE_CHANGEEMAIL; + } + // pass change failed + else + { + switch (errMsg) { + case ERRMSG_INVALID_ARGUMENT: + errorMessage = "New email address incorrect"; + break; + case ERRMSG_FAILURE: + errorMessage = "Old email address incorrect"; + break; + case ERRMSG_NO_LOGIN: + errorMessage = "Account not connected. Please login first."; + break; + default: + errorMessage = "Unknown error"; + break; + } + state = STATE_ACCOUNTCHANGE_ERROR; + } + } + break; + } } diff --git a/src/net/protocol.h b/src/net/protocol.h index e26e9ed5..76610635 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -54,8 +54,6 @@ enum { APMSG_CHAR_SELECT_RESPONSE = 0x0027, // B error, B*32 token, S game address, W game port, S chat address, W chat port PAMSG_EMAIL_CHANGE = 0x0030, // S email APMSG_EMAIL_CHANGE_RESPONSE = 0x0031, // B error - PAMSG_EMAIL_GET = 0x0032, // - - APMSG_EMAIL_GET_RESPONSE = 0x0033, // B error, S email PAMSG_PASSWORD_CHANGE = 0x0034, // S old password, S new password APMSG_PASSWORD_CHANGE_RESPONSE = 0x0035, // B error |