diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-17 22:43:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-17 22:43:13 +0300 |
commit | 73271c8b5e39d01c34064db8a4529e31d36cf0aa (patch) | |
tree | 62889d7fb733f0494317365d7846776b7371fcf7 /src/net/ea | |
parent | 9a40e1202946e3384500da28668a52d28ad377f4 (diff) | |
download | mv-73271c8b5e39d01c34064db8a4529e31d36cf0aa.tar.gz mv-73271c8b5e39d01c34064db8a4529e31d36cf0aa.tar.bz2 mv-73271c8b5e39d01c34064db8a4529e31d36cf0aa.tar.xz mv-73271c8b5e39d01c34064db8a4529e31d36cf0aa.zip |
Add static in loginhandler.
Diffstat (limited to 'src/net/ea')
-rw-r--r-- | src/net/ea/loginhandler.cpp | 23 | ||||
-rw-r--r-- | src/net/ea/loginhandler.h | 22 |
2 files changed, 23 insertions, 22 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 24c9d8e09..57eea9101 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -42,14 +42,19 @@ namespace Ea { +std::string LoginHandler::mUpdateHost; +Worlds LoginHandler::mWorlds; +Token LoginHandler::mToken; +bool LoginHandler::mVersionResponse = false; +bool LoginHandler::mRegistrationEnabled = true; + LoginHandler::LoginHandler() : - Net::LoginHandler(), - mVersionResponse(false), - mRegistrationEnabled(true), - mUpdateHost(), - mWorlds(), - mToken() + Net::LoginHandler() { + mVersionResponse = false; + mRegistrationEnabled = true; + mUpdateHost.clear(); + mWorlds.clear(); mToken.clear(); } @@ -133,7 +138,7 @@ void LoginHandler::clearWorlds() mWorlds.clear(); } -void LoginHandler::procecessCharPasswordResponse(Net::MessageIn &msg) const +void LoginHandler::processCharPasswordResponse(Net::MessageIn &msg) { // 0: acc not found, 1: success, 2: password mismatch, 3: pass too short const uint8_t errMsg = msg.readUInt8("result code"); @@ -189,7 +194,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg) { msg.skip(2, "len"); - clearWorlds(); + loginHandler->clearWorlds(); const int worldCount = (msg.getLength() - 47) / 32; @@ -225,7 +230,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg) client->setState(STATE_WORLD_SELECT); } -void LoginHandler::processLoginError(Net::MessageIn &msg) const +void LoginHandler::processLoginError(Net::MessageIn &msg) { const uint8_t code = msg.readUInt8("error"); logger->log("Login::error code: %u", static_cast<unsigned int>(code)); diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h index 6040e72fd..845e11f50 100644 --- a/src/net/ea/loginhandler.h +++ b/src/net/ea/loginhandler.h @@ -87,17 +87,13 @@ class LoginHandler notfinal : public Net::LoginHandler const std::string &password) const override final; - virtual void procecessCharPasswordResponse(Net::MessageIn &msg) const; + static void processCharPasswordResponse(Net::MessageIn &msg); - virtual void processUpdateHost(Net::MessageIn &msg); + static void processUpdateHost(Net::MessageIn &msg); - virtual void processUpdateHost2(Net::MessageIn &msg) const = 0; + static void processLoginData(Net::MessageIn &msg); - virtual void processLoginData(Net::MessageIn &msg); - - virtual void processLoginError(Net::MessageIn &msg) const; - - virtual void processServerVersion(Net::MessageIn &msg) = 0; + static void processLoginError(Net::MessageIn &msg); void loginOrRegister(LoginData *const data) const override final; @@ -108,11 +104,11 @@ class LoginHandler notfinal : public Net::LoginHandler const std::string &password, const std::string &email) const = 0; - bool mVersionResponse; - bool mRegistrationEnabled; - std::string mUpdateHost; - Worlds mWorlds; - Token mToken; + static std::string mUpdateHost; + static Worlds mWorlds; + static Token mToken; + static bool mVersionResponse; + static bool mRegistrationEnabled; }; } // namespace Ea |