summaryrefslogtreecommitdiff
path: root/src/net/tmwa/loginhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-02 01:51:25 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-02 01:51:25 +0200
commit582428edf9e40db0d1ed7b78222562a7a5031fe4 (patch)
tree2a9f4b1303a3647e3d7bf4599e85ebd358159b4d /src/net/tmwa/loginhandler.cpp
parent218dbbd7ce5415fe8c26857f06c5907c7cc6d175 (diff)
downloadmanaplus-582428edf9e40db0d1ed7b78222562a7a5031fe4.tar.gz
manaplus-582428edf9e40db0d1ed7b78222562a7a5031fe4.tar.bz2
manaplus-582428edf9e40db0d1ed7b78222562a7a5031fe4.tar.xz
manaplus-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.cpp26
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;