diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-07-17 22:52:53 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-07-17 22:52:53 +0000 |
commit | ea37ffc6d73bb0de686c29f8e8c6769f2a704ec5 (patch) | |
tree | fcca5b0bdca14ae694702ee4e882ba77a2a9b408 /src/net | |
parent | 406bac35e4c6e79b0ba8d5fe97f32516c8becb0b (diff) | |
download | mana-ea37ffc6d73bb0de686c29f8e8c6769f2a704ec5.tar.gz mana-ea37ffc6d73bb0de686c29f8e8c6769f2a704ec5.tar.bz2 mana-ea37ffc6d73bb0de686c29f8e8c6769f2a704ec5.tar.xz mana-ea37ffc6d73bb0de686c29f8e8c6769f2a704ec5.zip |
Added support for handling the custom eAthena packet that sends the update
host (patch by Sanga).
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/loginhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/loginhandler.h | 4 | ||||
-rw-r--r-- | src/net/network.cpp | 2 | ||||
-rw-r--r-- | src/net/protocol.h | 1 |
4 files changed, 18 insertions, 3 deletions
diff --git a/src/net/loginhandler.cpp b/src/net/loginhandler.cpp index ab788e41..8b057afd 100644 --- a/src/net/loginhandler.cpp +++ b/src/net/loginhandler.cpp @@ -37,6 +37,7 @@ extern SERVER_INFO **server_info; LoginHandler::LoginHandler() { static const Uint16 _messages[] = { + SMSG_UPDATE_HOST, 0x0069, 0x006a, 0 @@ -48,6 +49,16 @@ void LoginHandler::handleMessage(MessageIn *msg) { switch (msg->getId()) { + case 0x0063: + int len; + + len = msg->readInt16() - 4; + mUpdateHost = msg->readString(len); + + logger->log("Received update host \"%s\" from login server", + mUpdateHost.c_str()); + break; + case 0x0069: // Skip the length word msg->skip(2); @@ -70,6 +81,7 @@ void LoginHandler::handleMessage(MessageIn *msg) server_info[i]->port = msg->readInt16(); server_info[i]->name = msg->readString(20); server_info[i]->online_users = msg->readInt32(); + server_info[i]->updateHost = mUpdateHost; msg->skip(2); // unknown logger->log("Network: Server: %s (%s:%d)", @@ -77,7 +89,7 @@ void LoginHandler::handleMessage(MessageIn *msg) iptostring(server_info[i]->address), server_info[i]->port); } - state = CHAR_SERVER_STATE; + state = CHAR_SERVER_STATE; break; case 0x006a: diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 52014559..86c1b609 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -25,6 +25,7 @@ #define _TMW_NET_LOGINHANDLER_H #include "messagehandler.h" +#include <string> struct LoginData; @@ -37,8 +38,9 @@ class LoginHandler : public MessageHandler void setLoginData(LoginData *loginData) { mLoginData = loginData; }; - protected: + private: LoginData *mLoginData; + std::string mUpdateHost; }; #endif diff --git a/src/net/network.cpp b/src/net/network.cpp index fa5964d6..375d93e0 100644 --- a/src/net/network.cpp +++ b/src/net/network.cpp @@ -41,7 +41,7 @@ short packet_lengths[] = { // #0x0040 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 55, 17, 3, 37, 46, -1, 23, -1, 3,108, 3, 2, + 0, 0, 0, -1, 55, 17, 3, 37, 46, -1, 23, -1, 3,108, 3, 2, 3, 28, 19, 11, 3, -1, 9, 5, 54, 53, 58, 60, 41, 2, 6, 6, // #0x0080 7, 3, 2, 2, 2, 5, 16, 12, 10, 7, 29, 23, -1, -1, -1, 0, diff --git a/src/net/protocol.h b/src/net/protocol.h index 811d5481..eb41a9ac 100644 --- a/src/net/protocol.h +++ b/src/net/protocol.h @@ -26,6 +26,7 @@ // Packets from server to client #define SMSG_LOGIN_SUCCESS 0x0073 /**< Contains starting location */ +#define SMSG_UPDATE_HOST 0x0063 /**< Custom update host packet */ #define SMSG_PLAYER_UPDATE_1 0x01d8 #define SMSG_PLAYER_UPDATE_2 0x01d9 #define SMSG_PLAYER_MOVE 0x01da /**< A nearby player moves */ |