summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-20 19:17:19 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-20 19:17:19 +0300
commitdf43616053bf6533938178eb3ddd81de74ededf2 (patch)
tree4269f853a33c9b699f3d16f5e3c4147e3ea6e416 /src/net/eathena
parent90a63c3d866812143faab7d2c551cfff8ba61aa3 (diff)
downloadmanaplus-df43616053bf6533938178eb3ddd81de74ededf2.tar.gz
manaplus-df43616053bf6533938178eb3ddd81de74ededf2.tar.bz2
manaplus-df43616053bf6533938178eb3ddd81de74ededf2.tar.xz
manaplus-df43616053bf6533938178eb3ddd81de74ededf2.zip
Move processUpdateHost2 from ea namespace into eathena.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/loginhandler.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp
index 573b5212c..0b965f38c 100644
--- a/src/net/eathena/loginhandler.cpp
+++ b/src/net/eathena/loginhandler.cpp
@@ -27,6 +27,7 @@
#include "gui/windows/logindialog.h"
#include "net/generalhandler.h"
+#include "net/logindata.h"
#include "net/serverfeatures.h"
#include "net/eathena/messageout.h"
@@ -34,6 +35,7 @@
#include "net/eathena/protocol.h"
#include "utils/gettext.h"
+#include "utils/paths.h"
#include "debug.h"
@@ -251,7 +253,25 @@ void LoginHandler::processLoginError2(Net::MessageIn &msg)
void LoginHandler::processUpdateHost2(Net::MessageIn &msg)
{
- UNIMPLIMENTEDPACKET;
+ const int len = msg.readInt16("len") - 4;
+ const std::string updateHost = msg.readString(len, "host");
+
+ splitToStringVector(loginData.updateHosts, updateHost, '|');
+ FOR_EACH (StringVectIter, it, loginData.updateHosts)
+ {
+ if (!checkPath(*it))
+ {
+ logger->log1("Warning: incorrect update server name");
+ loginData.updateHosts.clear();
+ break;
+ }
+ }
+
+ logger->log("Received update hosts \"%s\" from login server.",
+ updateHost.c_str());
+
+ if (client->getState() == STATE_PRE_LOGIN)
+ client->setState(STATE_LOGIN);
}
void LoginHandler::sendVersion() const