diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-15 21:52:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-15 21:52:18 +0300 |
commit | da003f08612697b6cd1ad145fab7c5abe04fcca9 (patch) | |
tree | 8243836442f9281572144df4ab600518d17fccde | |
parent | f7637a968024c69590ffbf6cbde3d8de06aebf7f (diff) | |
download | manaverse-da003f08612697b6cd1ad145fab7c5abe04fcca9.tar.gz manaverse-da003f08612697b6cd1ad145fab7c5abe04fcca9.tar.bz2 manaverse-da003f08612697b6cd1ad145fab7c5abe04fcca9.tar.xz manaverse-da003f08612697b6cd1ad145fab7c5abe04fcca9.zip |
Change packet version to 6 (tmwa)
Add hack to send version 5 to old tmwa,
because for version 6 some servers can be broken.
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/tmwa/network.h | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index c2e6d462c..2f006c639 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -33,6 +33,7 @@ #include "debug.h" extern Net::LoginHandler *loginHandler; +extern unsigned int tmwServerVersion; namespace TmwAthena { @@ -91,8 +92,17 @@ void LoginHandler::sendLoginRegister(const std::string &restrict username, A_UNUSED) const { createOutPacket(CMSG_LOGIN_REGISTER); - outMsg.writeInt32(CLIENT_PROTOCOL_VERSION, - "client protocol version"); + if (tmwServerVersion < 0x100408) + { + // hack to avoid bug in tmwa... + outMsg.writeInt32(5, + "client protocol version"); + } + else + { + outMsg.writeInt32(CLIENT_PROTOCOL_VERSION, + "client protocol version"); + } outMsg.writeString(username, 24, "login"); outMsg.writeStringNoLog(password, 24, "password"); diff --git a/src/net/tmwa/network.h b/src/net/tmwa/network.h index 11980d95c..d75d9774b 100644 --- a/src/net/tmwa/network.h +++ b/src/net/tmwa/network.h @@ -29,7 +29,7 @@ * Protocol version, reported to the tmwa char and mapserver who can adjust * the protocol accordingly. */ -#define CLIENT_PROTOCOL_VERSION 5 +#define CLIENT_PROTOCOL_VERSION 6 namespace TmwAthena { |