diff options
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 |