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