summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-08 01:45:28 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-08 01:45:28 +0300
commite2dfb4d9242f74e566416be7f3ad6ac529fac520 (patch)
treeacdd8fd106ba993a0c54cfe7d82925c2532cc185 /src
parentbd7052d90ce2c493f8f93d2be46625bb8297ad79 (diff)
downloadmv-e2dfb4d9242f74e566416be7f3ad6ac529fac520.tar.gz
mv-e2dfb4d9242f74e566416be7f3ad6ac529fac520.tar.bz2
mv-e2dfb4d9242f74e566416be7f3ad6ac529fac520.tar.xz
mv-e2dfb4d9242f74e566416be7f3ad6ac529fac520.zip
Add support for different server flags in server version packet.
This can break old tmwAthena builds. Registration on this servers may work or may not work by random.
Diffstat (limited to 'src')
-rw-r--r--src/net/tmwa/loginhandler.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 00e0563e8..9dc9c5447 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -41,6 +41,11 @@ namespace TmwAthena
extern ServerInfo charServer;
+enum ServerFlags
+{
+ FLAG_REGISTRATION = 1
+};
+
LoginHandler::LoginHandler() :
MessageHandler(),
Ea::LoginHandler()
@@ -188,7 +193,7 @@ void LoginHandler::processServerVersion(Net::MessageIn &msg)
if (b1 == 255 && b2 == 'E' && b3 == 'V' && b4 == 'L')
{
const unsigned int options = msg.readInt8();
- mRegistrationEnabled = options;
+ mRegistrationEnabled = options & FLAG_REGISTRATION;
msg.skip(2); // 0 unused
serverVersion = msg.readInt8();
if (serverVersion >= 5)
@@ -197,7 +202,7 @@ void LoginHandler::processServerVersion(Net::MessageIn &msg)
else
{
const unsigned int options = msg.readInt32();
- mRegistrationEnabled = options;
+ mRegistrationEnabled = options & FLAG_REGISTRATION;
serverVersion = 0;
}
logger->log("Server version: %d", serverVersion);