diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-17 11:03:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-17 11:03:22 +0300 |
commit | dfaae6f6e804e7779ade870a211a1a14d3a5d9aa (patch) | |
tree | a7652f4e548e166b39a8203e27c890c02c62d5ca /src/net | |
parent | fd050698f74b5dc7a9867bc93ba6b7c65ef2462f (diff) | |
download | plus-dfaae6f6e804e7779ade870a211a1a14d3a5d9aa.tar.gz plus-dfaae6f6e804e7779ade870a211a1a14d3a5d9aa.tar.bz2 plus-dfaae6f6e804e7779ade870a211a1a14d3a5d9aa.tar.xz plus-dfaae6f6e804e7779ade870a211a1a14d3a5d9aa.zip |
Remove getter for loginHandler.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/charserverhandler.cpp | 7 | ||||
-rw-r--r-- | src/net/eathena/gamehandler.cpp | 3 | ||||
-rw-r--r-- | src/net/loginhandler.h | 2 | ||||
-rw-r--r-- | src/net/net.cpp | 12 | ||||
-rw-r--r-- | src/net/net.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 7 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 3 |
7 files changed, 14 insertions, 22 deletions
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index 189acb05d..bf1f18004 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -142,7 +142,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, return; const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + static_cast<LoginHandler*>(loginHandler)->getToken(); LocalPlayer *const tempPlayer = new LocalPlayer( msg.readInt32("player id"), 0); @@ -274,7 +274,7 @@ void CharServerHandler::switchCharacter() const void CharServerHandler::connect() { const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + static_cast<LoginHandler*>(loginHandler)->getToken(); if (!mNetwork) return; @@ -301,8 +301,7 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *const window) StringVect attributes; - const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); mCharCreateDialog->setAttributes(attributes, 0, 0, 0); mCharCreateDialog->setFixedGender(true, token.sex); diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp index 07e4dd7c6..381131fbc 100644 --- a/src/net/eathena/gamehandler.cpp +++ b/src/net/eathena/gamehandler.cpp @@ -107,8 +107,7 @@ void GameHandler::connect() mNetwork->connect(mapServer); - const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); if (client->getState() == STATE_CONNECT_GAME) diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 172dde361..89c55a334 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -109,4 +109,6 @@ class LoginHandler notfinal } // namespace Net +extern Net::LoginHandler *loginHandler; + #endif // NET_LOGINHANDLER_H diff --git a/src/net/net.cpp b/src/net/net.cpp index ed81a42ec..06768cb43 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -51,6 +51,7 @@ namespace Net class GeneralHandler; class GuildHandler; class InventoryHandler; + class LoginHandler; } Net::AdminHandler *adminHandler = nullptr; @@ -76,11 +77,6 @@ Net::CashShopHandler *cashShopHandler = nullptr; Net::FamilyHandler *familyHandler = nullptr; Net::BankHandler *bankHandler = nullptr; -Net::LoginHandler *Net::getLoginHandler() -{ - return loginHandler; -} - Net::NpcHandler *Net::getNpcHandler() { return npcHandler; @@ -164,10 +160,10 @@ void connectToServer(const ServerInfo &server) networkType = server.type; } - if (getLoginHandler()) + if (loginHandler) { - getLoginHandler()->setServer(server); - getLoginHandler()->connect(); + loginHandler->setServer(server); + loginHandler->connect(); } BLOCK_END("Net::connectToServer") } diff --git a/src/net/net.h b/src/net/net.h index baee5e9b2..a2c1c90b1 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -36,7 +36,6 @@ namespace Net { -class LoginHandler; class MailHandler; class NpcHandler; class PartyHandler; @@ -46,7 +45,6 @@ class SkillHandler; class TradeHandler; class ServerFeatures; -LoginHandler *getLoginHandler() A_WARN_UNUSED; NpcHandler *getNpcHandler() A_WARN_UNUSED; PartyHandler *getPartyHandler() A_WARN_UNUSED; PetHandler *getPetHandler() A_WARN_UNUSED; diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 969353cc4..d386206aa 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -138,7 +138,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg, return; const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + static_cast<LoginHandler*>(loginHandler)->getToken(); LocalPlayer *const tempPlayer = new LocalPlayer( msg.readInt32("account id"), 0); @@ -310,7 +310,7 @@ void CharServerHandler::switchCharacter() const void CharServerHandler::connect() { const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + static_cast<LoginHandler*>(loginHandler)->getToken(); if (!mNetwork) return; @@ -359,8 +359,7 @@ void CharServerHandler::setCharCreateDialog(CharCreateDialog *const window) // TRANSLATORS: playe stat attributes.push_back(_("Luck:")); - const Token &token = - static_cast<LoginHandler*>(Net::getLoginHandler())->getToken(); + const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); int minStat = CharDB::getMinStat(); if (!minStat) diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index f0c3c0d5d..8815803c6 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -103,8 +103,7 @@ void GameHandler::connect() BLOCK_START("GameHandler::connect") mNetwork->connect(mapServer); - const Token &token = static_cast<LoginHandler*>( - Net::getLoginHandler())->getToken(); + const Token &token = static_cast<LoginHandler*>(loginHandler)->getToken(); if (client->getState() == STATE_CONNECT_GAME) { |