summaryrefslogtreecommitdiff
path: root/src/net/tmwa/loginhandler.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-05-22 13:01:41 -0600
committerJared Adams <jaxad0127@gmail.com>2010-05-22 13:01:41 -0600
commita72030a4e8af2d60ccf574f224070805780e19ca (patch)
tree09877a6796ffe0219d9ee548636323d32e9b6a07 /src/net/tmwa/loginhandler.cpp
parent2953a3f92c5097bd99ff21f4536fe167a32d90c5 (diff)
downloadmana-a72030a4e8af2d60ccf574f224070805780e19ca.tar.gz
mana-a72030a4e8af2d60ccf574f224070805780e19ca.tar.bz2
mana-a72030a4e8af2d60ccf574f224070805780e19ca.tar.xz
mana-a72030a4e8af2d60ccf574f224070805780e19ca.zip
Fix handling of tmwAthena registration disabled bit
Diffstat (limited to 'src/net/tmwa/loginhandler.cpp')
-rw-r--r--src/net/tmwa/loginhandler.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 7d973ba3..e58acb4d 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -42,6 +42,7 @@ namespace TmwAthena {
extern ServerInfo charServer;
LoginHandler::LoginHandler():
+ mVersionResponse(false),
mRegistrationEnabled(true)
{
static const Uint16 _messages[] = {
@@ -187,6 +188,7 @@ void LoginHandler::handleMessage(Net::MessageIn &msg)
case SMSG_SERVER_VERSION_RESPONSE:
{
// TODO: verify these!
+
msg.readInt8(); // -1
msg.readInt8(); // T
msg.readInt8(); // M
@@ -194,13 +196,10 @@ void LoginHandler::handleMessage(Net::MessageIn &msg)
unsigned int options = msg.readInt32();
- if (options & 1)
- {
- // Registeration not allowed
- mRegistrationEnabled = false;
- }
+ mRegistrationEnabled = (options & 1);
- //state = STATE_LOGIN;
+ // Leave this last
+ mVersionResponse = true;
}
break;
}
@@ -214,7 +213,7 @@ void LoginHandler::connect()
bool LoginHandler::isConnected()
{
- return mNetwork->isConnected();
+ return mVersionResponse && mNetwork->isConnected();
}
void LoginHandler::disconnect()