From e2dfb4d9242f74e566416be7f3ad6ac529fac520 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Aug 2013 01:45:28 +0300 Subject: 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. --- src/net/tmwa/loginhandler.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/net') 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); -- cgit v1.2.3-70-g09d2