From 9cdbed6c562f95e24e02f49630386f8b18884a02 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Sep 2014 10:31:03 +0300 Subject: Remove getter for gameHandler. --- src/net/eathena/charserverhandler.cpp | 4 ++-- src/net/familyhandler.h | 2 ++ src/net/gamehandler.h | 2 ++ src/net/net.cpp | 12 ++---------- src/net/net.h | 4 ---- src/net/tmwa/charserverhandler.cpp | 4 ++-- 6 files changed, 10 insertions(+), 18 deletions(-) (limited to 'src/net') diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index e1d6c5373..189acb05d 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -357,7 +357,7 @@ void CharServerHandler::processCharMapInfo(Net::MessageIn &restrict msg) ServerInfo &server = mapServer; BLOCK_START("CharServerHandler::processCharMapInfo") PlayerInfo::setCharId(msg.readInt32("char id")); - GameHandler *const gh = static_cast(Net::getGameHandler()); + GameHandler *const gh = static_cast(gameHandler); gh->setMap(msg.readString(16, "map name")); if (config.getBoolValue("usePersistentIP") || settings.persistentIp) { @@ -390,7 +390,7 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg) Network *const network = mNetwork; ServerInfo &server = mapServer; BLOCK_START("CharServerHandler::processChangeMapServer") - GameHandler *const gh = static_cast(Net::getGameHandler()); + GameHandler *const gh = static_cast(gameHandler); if (!gh || !network) { BLOCK_END("CharServerHandler::processChangeMapServer") diff --git a/src/net/familyhandler.h b/src/net/familyhandler.h index e6b7bb174..3f4bce683 100644 --- a/src/net/familyhandler.h +++ b/src/net/familyhandler.h @@ -43,4 +43,6 @@ class FamilyHandler notfinal } // namespace Net +extern Net::FamilyHandler *familyHandler; + #endif // NET_FAMILYHANDLER_H diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h index 1752f7eea..94cb554c1 100644 --- a/src/net/gamehandler.h +++ b/src/net/gamehandler.h @@ -65,4 +65,6 @@ class GameHandler notfinal } // namespace Net +extern Net::GameHandler *gameHandler; + #endif // NET_GAMEHANDLER_H diff --git a/src/net/net.cpp b/src/net/net.cpp index aa89e39fe..cd97e921e 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -46,6 +46,8 @@ namespace Net class CashShopHandler; class CharServerHandler; class ChatHandler; + class FamilyHandler; + class GameHandler; } Net::AdminHandler *adminHandler = nullptr; @@ -71,11 +73,6 @@ Net::CashShopHandler *cashShopHandler = nullptr; Net::FamilyHandler *familyHandler = nullptr; Net::BankHandler *bankHandler = nullptr; -Net::GameHandler *Net::getGameHandler() -{ - return gameHandler; -} - Net::GeneralHandler *Net::getGeneralHandler() { return generalHandler; @@ -136,11 +133,6 @@ Net::MailHandler *Net::getMailHandler() return mailHandler; } -Net::FamilyHandler *Net::getFamilyHandler() -{ - return familyHandler; -} - namespace Net { diff --git a/src/net/net.h b/src/net/net.h index 11f605252..825a9894a 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -36,8 +36,6 @@ namespace Net { -class FamilyHandler; -class GameHandler; class GeneralHandler; class GuildHandler; class InventoryHandler; @@ -51,7 +49,6 @@ class SkillHandler; class TradeHandler; class ServerFeatures; -GameHandler *getGameHandler() A_WARN_UNUSED; GeneralHandler *getGeneralHandler() A_WARN_UNUSED; GuildHandler *getGuildHandler() A_WARN_UNUSED; InventoryHandler *getInventoryHandler() A_WARN_UNUSED; @@ -64,7 +61,6 @@ SkillHandler *getSkillHandler() A_WARN_UNUSED; TradeHandler *getTradeHandler() A_WARN_UNUSED; ServerFeatures *getServerFeatures() A_WARN_UNUSED; MailHandler *getMailHandler() A_WARN_UNUSED; -FamilyHandler *getFamilyHandler() A_WARN_UNUSED; ServerInfo::Type getNetworkType() A_WARN_UNUSED; diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index e23b6f08c..969353cc4 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -420,7 +420,7 @@ void CharServerHandler::processCharMapInfo(Net::MessageIn &restrict msg) ServerInfo &server = mapServer; BLOCK_START("CharServerHandler::processCharMapInfo") PlayerInfo::setCharId(msg.readInt32("char id?")); - GameHandler *const gh = static_cast(Net::getGameHandler()); + GameHandler *const gh = static_cast(gameHandler); gh->setMap(msg.readString(16, "map name")); if (config.getBoolValue("usePersistentIP") || settings.persistentIp) { @@ -453,7 +453,7 @@ void CharServerHandler::processChangeMapServer(Net::MessageIn &msg) Network *const network = mNetwork; ServerInfo &server = mapServer; BLOCK_START("CharServerHandler::processChangeMapServer") - GameHandler *const gh = static_cast(Net::getGameHandler()); + GameHandler *const gh = static_cast(gameHandler); if (!gh || !network) { BLOCK_END("CharServerHandler::processChangeMapServer") -- cgit v1.2.3-60-g2f50