diff options
Diffstat (limited to 'src/net/ea/charserverhandler.cpp')
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index 377cd2dd..0fcc2cb0 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -21,6 +21,7 @@ #include "net/ea/charserverhandler.h" +#include "net/ea/network.h" #include "net/ea/protocol.h" #include "net/messagein.h" @@ -45,7 +46,6 @@ CharServerHandler::CharServerHandler(): mCharCreateDialog(0) { static const Uint16 _messages[] = { - SMSG_CONNECTION_PROBLEM, 0x006b, 0x006c, 0x006d, @@ -68,33 +68,6 @@ void CharServerHandler::handleMessage(MessageIn &msg) 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 = STATE_ERROR; - break; - case 0x006b: msg.skip(2); // Length word flags = msg.readInt32(); // Aethyra extensions flags @@ -259,6 +232,23 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *window) mCharCreateDialog->setFixedGender(true); } +void CharServerHandler::connect(LoginData *loginData) +{ + mLoginData = loginData; + + MessageOut outMsg(0x0065); + outMsg.writeInt32(loginData->account_ID); + outMsg.writeInt32(loginData->session_ID1); + outMsg.writeInt32(loginData->session_ID2); + // [Fate] The next word is unused by the old char server, so we squeeze in + // tmw client version information + outMsg.writeInt16(CLIENT_PROTOCOL_VERSION); + outMsg.writeInt8(loginData->sex); + + // We get 4 useless bytes before the real answer comes in (what are these?) + mNetwork->skip(4); +} + void CharServerHandler::chooseCharacter(int slot, LocalPlayer* character) { MessageOut outMsg(CMSG_CHAR_SELECT); |