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/charserverhandler.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/charserverhandler.cpp')
-rw-r--r-- | src/net/charserverhandler.cpp | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 909100e5..b91a506a 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -43,6 +43,7 @@ CharServerHandler::CharServerHandler(): mCharCreateDialog(0) { static const Uint16 _messages[] = { + SMSG_CONNECTION_PROBLEM, 0x006b, 0x006c, 0x006d, @@ -50,7 +51,6 @@ CharServerHandler::CharServerHandler(): 0x006f, 0x0070, 0x0071, - 0x0081, 0 }; handledMessages = _messages; @@ -58,14 +58,40 @@ CharServerHandler::CharServerHandler(): void CharServerHandler::handleMessage(MessageIn *msg) { - int slot; - int flags; + int slot, flags, code; LocalPlayer *tempPlayer; logger->log("CharServerHandler: Packet ID: %x, Length: %d", msg->getId(), msg->getLength()); 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 1: + errorMessage = "Map server(s) offline"; + break; + case 2: + errorMessage = "This account is already logged in"; + break; + case 3: + errorMessage = "Speed hack detected"; + break; + case 8: + errorMessage = "Duplicated login"; + break; + default: + errorMessage = "Unknown connection error"; + break; + } + state = ERROR_STATE; + break; + case 0x006b: msg->skip(2); // Length word flags = msg->readInt32(); // Aethyra extensions flags @@ -165,25 +191,6 @@ void CharServerHandler::handleMessage(MessageIn *msg) mCharInfo->select(slot); state = CONNECTING_STATE; break; - - case 0x0081: - switch (msg->readInt8()) { - case 1: - errorMessage = "Map server offline"; - break; - case 3: - errorMessage = "Speed hack detected"; - break; - case 8: - errorMessage = "Duplicated login"; - break; - default: - errorMessage = "Unknown error with 0x0081"; - break; - } - mCharInfo->unlock(); - state = ERROR_STATE; - break; } } |