From 4247e05ae8ee9e14323629701c3a11e5c2fac674 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 10 Nov 2014 22:02:37 +0300 Subject: eathnea; add support for update hosts. --- src/net/ea/loginhandler.cpp | 23 +++++++++++++++++++++++ src/net/ea/loginhandler.h | 2 ++ 2 files changed, 25 insertions(+) (limited to 'src/net/ea') diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 11fe197c2..8b2ec1ed1 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -323,6 +323,29 @@ void LoginHandler::loginOrRegister(LoginData *const data) const serverConfig.setValue("remember", remember); } +void LoginHandler::processUpdateHost2(Net::MessageIn &msg) +{ + 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::logout() const { } diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h index 845e11f50..93fe3fb2d 100644 --- a/src/net/ea/loginhandler.h +++ b/src/net/ea/loginhandler.h @@ -95,6 +95,8 @@ class LoginHandler notfinal : public Net::LoginHandler static void processLoginError(Net::MessageIn &msg); + static void processUpdateHost2(Net::MessageIn &msg); + void loginOrRegister(LoginData *const data) const override final; protected: -- cgit v1.2.3-70-g09d2