summaryrefslogtreecommitdiff
path: root/src/net/ea/loginhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea/loginhandler.cpp')
-rw-r--r--src/net/ea/loginhandler.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 420236cfd..291a92906 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -2,7 +2,7 @@
* The ManaPlus Client
* Copyright (C) 2004-2009 The Mana World Development Team
* Copyright (C) 2009-2010 The Mana Developers
- * Copyright (C) 2011 The ManaPlus Developers
+ * Copyright (C) 2011-2012 The ManaPlus Developers
*
* This file is part of The ManaPlus Client.
*
@@ -150,6 +150,11 @@ void LoginHandler::processUpdateHost(Net::MessageIn &msg)
len = msg.readInt16() - 4;
mUpdateHost = msg.readString(len);
+ if (!checkPath(mUpdateHost))
+ {
+ mUpdateHost = "";
+ logger->log1("Warning: incorrect update server name");
+ }
loginData.updateHost = mUpdateHost;
logger->log("Received update host \"%s\" from login server.",
@@ -159,7 +164,7 @@ void LoginHandler::processUpdateHost(Net::MessageIn &msg)
void LoginHandler::processLoginData(Net::MessageIn &msg)
{
// Skip the length word
- msg.skip(2);
+ msg.skip(2); // size
clearWorlds();
@@ -170,7 +175,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
mToken.session_ID2 = msg.readInt32();
msg.skip(4); // old ip
loginData.lastLogin = msg.readString(24);
- msg.skip(2); // unused bytes
+ msg.skip(2); // 0 unused bytes
// msg.skip(30); // unknown
// reserve bits for future usage
@@ -183,10 +188,11 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
world->address = msg.readInt32();
world->port = msg.readInt16();
world->name = msg.readString(20);
- world->online_users = msg.readInt32();
+ world->online_users = msg.readInt16();
config.setValue("updatehost", mUpdateHost);
world->updateHost = mUpdateHost;
- msg.skip(2); // unknown
+ msg.skip(2); // maintenance
+ msg.skip(2); // new
logger->log("Network: Server: %s (%s:%d)", world->name.c_str(),
ipToString(world->address), world->port);