summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-16 23:56:49 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-17 00:02:02 +0300
commit9b25edfe24395fdee2ad06c85a0f9c0a6117aaa8 (patch)
treea1116647b9e40fe8a7f710e09434301da137a785 /src
parentf5c479fa193fb4199872aabcb73d35f872caa87f (diff)
downloadmanaverse-9b25edfe24395fdee2ad06c85a0f9c0a6117aaa8.tar.gz
manaverse-9b25edfe24395fdee2ad06c85a0f9c0a6117aaa8.tar.bz2
manaverse-9b25edfe24395fdee2ad06c85a0f9c0a6117aaa8.tar.xz
manaverse-9b25edfe24395fdee2ad06c85a0f9c0a6117aaa8.zip
Remove getter for adminHandler.
Diffstat (limited to 'src')
-rw-r--r--src/actions/commands.cpp2
-rw-r--r--src/gui/popups/popupmenu.cpp14
-rw-r--r--src/gui/windows/buydialog.cpp2
-rw-r--r--src/net/adminhandler.h2
-rw-r--r--src/net/net.cpp10
-rw-r--r--src/net/net.h2
6 files changed, 16 insertions, 16 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index e6dba74f3..c7e12af88 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -124,7 +124,7 @@ static void changeRelation(const InputEvent &event,
impHandler(chatAnnounce)
{
- Net::getAdminHandler()->announce(event.args);
+ adminHandler->announce(event.args);
return true;
}
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 6298b7b14..00b19ee38 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -1319,7 +1319,7 @@ void PopupMenu::handleLink(const std::string &link,
(being->getType() == ActorType::Player ||
being->getType() == ActorType::Monster))
{
- Net::getAdminHandler()->kick(being->getId());
+ adminHandler->kick(being->getId());
}
else if (link == "chat close" && mTab)
{
@@ -1339,7 +1339,7 @@ void PopupMenu::handleLink(const std::string &link,
{
if (Game::instance())
{
- Net::getAdminHandler()->warp(Game::instance()->getCurrentMapName(),
+ adminHandler->warp(Game::instance()->getCurrentMapName(),
mMapItem->getX(), mMapItem->getY());
}
}
@@ -1347,7 +1347,7 @@ void PopupMenu::handleLink(const std::string &link,
{
if (Game::instance())
{
- Net::getAdminHandler()->warp(Game::instance()->getCurrentMapName(),
+ adminHandler->warp(Game::instance()->getCurrentMapName(),
mX, mY);
}
}
@@ -1784,19 +1784,19 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "goto" && !mNick.empty())
{
- Net::getAdminHandler()->gotoName(mNick);
+ adminHandler->gotoName(mNick);
}
else if (link == "recall" && !mNick.empty())
{
- Net::getAdminHandler()->recallName(mNick);
+ adminHandler->recallName(mNick);
}
else if (link == "revive" && !mNick.empty())
{
- Net::getAdminHandler()->reviveName(mNick);
+ adminHandler->reviveName(mNick);
}
else if (link == "ipcheck" && !mNick.empty())
{
- Net::getAdminHandler()->ipcheckName(mNick);
+ adminHandler->ipcheckName(mNick);
}
else if (link == "gm" && !mNick.empty())
{
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index ce22252a0..c09044f7b 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -434,7 +434,7 @@ void BuyDialog::action(const ActionEvent &event)
if (mNpcId == -2)
{
const ShopItem *const item = mShopItems->at(selectedItem);
- Net::getAdminHandler()->createItems(item->getId(),
+ adminHandler->createItems(item->getId(),
mAmountItems, item->getColor());
}
else if (mNpcId != -1)
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index e6565e4a6..eca316210 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -94,4 +94,6 @@ class AdminHandler notfinal
} // namespace Net
+extern Net::AdminHandler *adminHandler;
+
#endif // NET_ADMINHANDLER_H
diff --git a/src/net/net.cpp b/src/net/net.cpp
index 6a0ac33a3..520c794db 100644
--- a/src/net/net.cpp
+++ b/src/net/net.cpp
@@ -36,6 +36,11 @@
#include "debug.h"
+namespace Net
+{
+ class AdminHandler;
+}
+
Net::AdminHandler *adminHandler = nullptr;
Net::CharServerHandler *charServerHandler = nullptr;
Net::ChatHandler *chatHandler = nullptr;
@@ -59,11 +64,6 @@ Net::CashShopHandler *cashShopHandler = nullptr;
Net::FamilyHandler *familyHandler = nullptr;
Net::BankHandler *bankHandler = nullptr;
-Net::AdminHandler *Net::getAdminHandler()
-{
- return adminHandler;
-}
-
Net::CharServerHandler *Net::getCharServerHandler()
{
return charServerHandler;
diff --git a/src/net/net.h b/src/net/net.h
index d1872e052..4581e9946 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -36,7 +36,6 @@
namespace Net
{
-class AdminHandler;
class AuctionHandler;
class BankHandler;
class BeingHandler;
@@ -59,7 +58,6 @@ class TradeHandler;
class BuySellHandler;
class ServerFeatures;
-AdminHandler *getAdminHandler() A_WARN_UNUSED;
BeingHandler *getBeingHandler() A_WARN_UNUSED;
CharServerHandler *getCharServerHandler() A_WARN_UNUSED;
ChatHandler *getChatHandler() A_WARN_UNUSED;