diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/generalhandler.h | 2 | ||||
-rw-r--r-- | src/net/net.cpp | 18 | ||||
-rw-r--r-- | src/net/net.h | 2 |
3 files changed, 9 insertions, 13 deletions
diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h index 5467c06e6..ecfbfe24a 100644 --- a/src/net/generalhandler.h +++ b/src/net/generalhandler.h @@ -53,4 +53,6 @@ class GeneralHandler notfinal } // namespace Net +extern Net::GeneralHandler *generalHandler; + #endif // NET_GENERALHANDLER_H diff --git a/src/net/net.cpp b/src/net/net.cpp index cd97e921e..b8b292f98 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -48,6 +48,7 @@ namespace Net class ChatHandler; class FamilyHandler; class GameHandler; + class GeneralHandler; } Net::AdminHandler *adminHandler = nullptr; @@ -73,11 +74,6 @@ Net::CashShopHandler *cashShopHandler = nullptr; Net::FamilyHandler *familyHandler = nullptr; Net::BankHandler *bankHandler = nullptr; -Net::GeneralHandler *Net::getGeneralHandler() -{ - return generalHandler; -} - Net::GuildHandler *Net::getGuildHandler() { return guildHandler; @@ -141,14 +137,14 @@ ServerInfo::Type networkType = ServerInfo::UNKNOWN; void connectToServer(const ServerInfo &server) { BLOCK_START("Net::connectToServer") - if (networkType == server.type && getGeneralHandler()) + if (networkType == server.type && generalHandler) { - getGeneralHandler()->reload(); + generalHandler->reload(); } else { - if (networkType != ServerInfo::UNKNOWN && getGeneralHandler()) - getGeneralHandler()->unload(); + if (networkType != ServerInfo::UNKNOWN && generalHandler) + generalHandler->unload(); switch (server.type) { @@ -171,7 +167,7 @@ void connectToServer(const ServerInfo &server) break; } - getGeneralHandler()->load(); + generalHandler->load(); networkType = server.type; } @@ -186,7 +182,7 @@ void connectToServer(const ServerInfo &server) void unload() { - GeneralHandler *const handler = getGeneralHandler(); + GeneralHandler *const handler = generalHandler; if (handler) handler->unload(); } diff --git a/src/net/net.h b/src/net/net.h index 825a9894a..b0fb224bd 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -36,7 +36,6 @@ namespace Net { -class GeneralHandler; class GuildHandler; class InventoryHandler; class LoginHandler; @@ -49,7 +48,6 @@ class SkillHandler; class TradeHandler; class ServerFeatures; -GeneralHandler *getGeneralHandler() A_WARN_UNUSED; GuildHandler *getGuildHandler() A_WARN_UNUSED; InventoryHandler *getInventoryHandler() A_WARN_UNUSED; LoginHandler *getLoginHandler() A_WARN_UNUSED; |