diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-01-28 15:16:12 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-28 16:00:58 -0700 |
commit | 1ca8d08b7619e1958371ce8d82e201b82ae39e32 (patch) | |
tree | 9b79fab367afedd8adac26a9acc56ac923034a2c /src/net/maploginhandler.cpp | |
parent | 487b7237a730469fc4f8a501a93f78c2bbafad51 (diff) | |
download | mana-1ca8d08b7619e1958371ce8d82e201b82ae39e32.tar.gz mana-1ca8d08b7619e1958371ce8d82e201b82ae39e32.tar.bz2 mana-1ca8d08b7619e1958371ce8d82e201b82ae39e32.tar.xz mana-1ca8d08b7619e1958371ce8d82e201b82ae39e32.zip |
Fix handling of packet 0x81
Diffstat (limited to 'src/net/maploginhandler.cpp')
-rw-r--r-- | src/net/maploginhandler.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/net/maploginhandler.cpp b/src/net/maploginhandler.cpp index 1b0919fa..b851117e 100644 --- a/src/net/maploginhandler.cpp +++ b/src/net/maploginhandler.cpp @@ -30,8 +30,8 @@ MapLoginHandler::MapLoginHandler() { static const Uint16 _messages[] = { + SMSG_CONNECTION_PROBLEM, SMSG_LOGIN_SUCCESS, - 0x0081, 0 }; handledMessages = _messages; @@ -39,10 +39,29 @@ MapLoginHandler::MapLoginHandler() void MapLoginHandler::handleMessage(MessageIn *msg) { + int code; unsigned char direction; switch (msg->getId()) { + case SMSG_CONNECTION_PROBLEM: + code = msg->readInt8(); + logger->log("Connection problem: %i", code); + + switch (code) { + case 0: + errorMessage = "Authentication failed"; + break; + case 2: + errorMessage = "This account is already logged in"; + break; + default: + errorMessage = "Unknown connection error"; + break; + } + state = ERROR_STATE; + break; + case SMSG_LOGIN_SUCCESS: msg->readInt32(); // server tick msg->readCoordinates(player_node->mX, player_node->mY, direction); @@ -51,10 +70,5 @@ void MapLoginHandler::handleMessage(MessageIn *msg) player_node->mX, player_node->mY, direction); state = GAME_STATE; break; - - case 0x0081: - logger->log("Warning: Map server D/C"); - state = ERROR_STATE; - break; } } |