diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-12 21:09:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-12 21:30:35 +0300 |
commit | 09187552601a2b6c26225cf2fa4a700347a02224 (patch) | |
tree | fa75da86eff794d1062486e7fc6a6ee3620a0db5 /src/net | |
parent | 58f80ebffbb354357e2650a41e233f54df3e376d (diff) | |
download | manaverse-09187552601a2b6c26225cf2fa4a700347a02224.tar.gz manaverse-09187552601a2b6c26225cf2fa4a700347a02224.tar.bz2 manaverse-09187552601a2b6c26225cf2fa4a700347a02224.tar.xz manaverse-09187552601a2b6c26225cf2fa4a700347a02224.zip |
add server version check for "new" tmw servers.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 4f7a35d3b..91e2c3027 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -196,16 +196,38 @@ void LoginHandler::processServerVersion(Net::MessageIn &msg) mRegistrationEnabled = options & FLAG_REGISTRATION; msg.skip(2); // 0 unused serverVersion = msg.readInt8(); + tmwServerVersion = 0; if (serverVersion >= 5) requestUpdateHosts(); } + else if (b1 == 255) + { // old TMWA + const unsigned int options = msg.readInt32(); + mRegistrationEnabled = options & FLAG_REGISTRATION; + serverVersion = 0; + tmwServerVersion = 0; + } + else if (b1 >= 0x0d) + { // new TMWA + const unsigned int options = msg.readInt32(); + mRegistrationEnabled = options & FLAG_REGISTRATION; + serverVersion = 0; + tmwServerVersion = (b1 << 16) | (b2 << 8) | b3; + } else - { + { // eAthena const unsigned int options = msg.readInt32(); mRegistrationEnabled = options & FLAG_REGISTRATION; serverVersion = 0; + tmwServerVersion = 0; } - logger->log("Server version: %d", serverVersion); + if (serverVersion > 0) + logger->log("Evol server version: %d", serverVersion); + else if (tmwServerVersion > 0) + logger->log("Tmw server version: x%06x", tmwServerVersion); + else + logger->log("Server witout version"); + if (serverVersion < 5) { if (client->getState() != STATE_LOGIN) |