summaryrefslogtreecommitdiff
path: root/src/net/charserverhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/charserverhandler.cpp')
-rw-r--r--src/net/charserverhandler.cpp51
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;
}
}