diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-02 01:51:25 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-02 01:51:25 +0200 |
commit | 582428edf9e40db0d1ed7b78222562a7a5031fe4 (patch) | |
tree | 2a9f4b1303a3647e3d7bf4599e85ebd358159b4d /src/net/tmwa/loginhandler.cpp | |
parent | 218dbbd7ce5415fe8c26857f06c5907c7cc6d175 (diff) | |
download | plus-582428edf9e40db0d1ed7b78222562a7a5031fe4.tar.gz plus-582428edf9e40db0d1ed7b78222562a7a5031fe4.tar.bz2 plus-582428edf9e40db0d1ed7b78222562a7a5031fe4.tar.xz plus-582428edf9e40db0d1ed7b78222562a7a5031fe4.zip |
Add serverversion checks. And disable some advanced features in old servers.
Diffstat (limited to 'src/net/tmwa/loginhandler.cpp')
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index a1b3c0f95..810d97056 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -198,15 +198,23 @@ void LoginHandler::handleMessage(Net::MessageIn &msg) { // TODO: verify these! - msg.readInt8(); // -1 - msg.readInt8(); // T - msg.readInt8(); // M - msg.readInt8(); // W - - unsigned int options = msg.readInt32(); - - mRegistrationEnabled = options; -// mRegistrationEnabled = (options & 1); + char b1 = msg.readInt8(); // -1 + char b2 = msg.readInt8(); // T + char b3 = msg.readInt8(); // M + char b4 = msg.readInt8(); // W + if (b1 == -1 && b2 == 'E' && b3 == 'V' && b4 == 'L') + { + unsigned int options = msg.readInt8(); + mRegistrationEnabled = options; + msg.skip(2); + serverVersion = msg.readInt8(); + } + else + { + unsigned int options = msg.readInt32(); + mRegistrationEnabled = options; + serverVersion = 0; + } // Leave this last mVersionResponse = true; |