summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-17 10:41:59 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 10:41:59 +0300
commit38b46ebb02bbe307765aa9a456b587eafd3dfd7e (patch)
treed096b453db8708d8239a4255a9d626eb8bb0f681 /src/net
parent9cdbed6c562f95e24e02f49630386f8b18884a02 (diff)
downloadmanaplus-38b46ebb02bbe307765aa9a456b587eafd3dfd7e.tar.gz
manaplus-38b46ebb02bbe307765aa9a456b587eafd3dfd7e.tar.bz2
manaplus-38b46ebb02bbe307765aa9a456b587eafd3dfd7e.tar.xz
manaplus-38b46ebb02bbe307765aa9a456b587eafd3dfd7e.zip
Remove getter for generalHandler.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/generalhandler.h2
-rw-r--r--src/net/net.cpp18
-rw-r--r--src/net/net.h2
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;