diff options
author | Rogier Polak <rogier.l.a.polak@gmail.com> | 2007-02-23 19:18:28 +0000 |
---|---|---|
committer | Rogier Polak <rogier.l.a.polak@gmail.com> | 2007-02-23 19:18:28 +0000 |
commit | 775404c84c3250225d43f10c4a5363e997618cb2 (patch) | |
tree | 38393287d1554d8e19471f24bc65525c79efeccb /src/net/loginhandler.cpp | |
parent | fee8461a594770f8ef2bd826868a4ae81270a666 (diff) | |
download | mana-775404c84c3250225d43f10c4a5363e997618cb2.tar.gz mana-775404c84c3250225d43f10c4a5363e997618cb2.tar.bz2 mana-775404c84c3250225d43f10c4a5363e997618cb2.tar.xz mana-775404c84c3250225d43f10c4a5363e997618cb2.zip |
Added unregistering, logout_then_exit, switch_character and switch_accountserver.
Diffstat (limited to 'src/net/loginhandler.cpp')
-rw-r--r-- | src/net/loginhandler.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index 73be4b2f..c68a620a 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -33,6 +33,7 @@ LoginHandler::LoginHandler() static const Uint16 _messages[] = { APMSG_LOGIN_RESPONSE, APMSG_REGISTER_RESPONSE, + APMSG_RECONNECT_RESPONSE, 0 }; handledMessages = _messages; @@ -106,5 +107,34 @@ void LoginHandler::handleMessage(MessageIn &msg) } } break; + case APMSG_RECONNECT_RESPONSE: + { + int errMsg = msg.readByte(); + // Successful login + if (errMsg == ERRMSG_OK) + { + state = STATE_CHAR_SELECT; + } + // Login failed + else + { + switch (errMsg) { + case ERRMSG_INVALID_ARGUMENT: + errorMessage = "Wrong magic_token"; + break; + case ERRMSG_FAILURE: + errorMessage = "Already logged in"; + break; + case LOGIN_SERVER_FULL: + errorMessage = "Server is full"; + break; + default: + errorMessage = "Unknown error"; + break; + } + state = STATE_ERROR; + } + } + break; } } |