diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-11 21:05:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-11 21:05:05 +0300 |
commit | d0c97c8a12b0904c00a492acd129aebffd7816c8 (patch) | |
tree | 8c863fd894b3eb5453db40db3a9780edc932ed08 | |
parent | e36c735ce6569cd9c0e668632e59bcbe3280d507 (diff) | |
download | ManaVerse-d0c97c8a12b0904c00a492acd129aebffd7816c8.tar.gz ManaVerse-d0c97c8a12b0904c00a492acd129aebffd7816c8.tar.bz2 ManaVerse-d0c97c8a12b0904c00a492acd129aebffd7816c8.tar.xz ManaVerse-d0c97c8a12b0904c00a492acd129aebffd7816c8.zip |
Remove low level gm actions from popup to net code.
-rw-r--r-- | src/gui/popupmenu.cpp | 12 | ||||
-rw-r--r-- | src/net/adminhandler.h | 8 | ||||
-rw-r--r-- | src/net/ea/adminhandler.cpp | 20 | ||||
-rw-r--r-- | src/net/ea/adminhandler.h | 8 |
4 files changed, 40 insertions, 8 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index d2a3568b1..da33b6915 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -1665,23 +1665,19 @@ void PopupMenu::handleLink(const std::string &link, } else if (link == "goto" && !mNick.empty()) { - if (chatWindow) - chatWindow->localChatInput("@goto " + mNick); + Net::getAdminHandler()->gotoName(mNick); } else if (link == "recall" && !mNick.empty()) { - if (chatWindow) - chatWindow->localChatInput("@recall " + mNick); + Net::getAdminHandler()->recallName(mNick); } else if (link == "revive" && !mNick.empty()) { - if (chatWindow) - chatWindow->localChatInput("@revive " + mNick); + Net::getAdminHandler()->reviveName(mNick); } else if (link == "ipcheck" && !mNick.empty()) { - if (chatWindow) - chatWindow->localChatInput("@ipcheck " + mNick); + Net::getAdminHandler()->ipcheckName(mNick); } else if (link == "gm" && !mNick.empty()) { diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index 7178aacae..c3b58fa9e 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -61,6 +61,14 @@ class AdminHandler virtual void createItems(const int id, const int color, const int amount) = 0; + + virtual void gotoName(const std::string &name) const = 0; + + virtual void recallName(const std::string &name) const = 0; + + virtual void reviveName(const std::string &name) const = 0; + + virtual void ipcheckName(const std::string &name) const = 0; }; } // namespace Net diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp index 9e1956edd..5e1c188a0 100644 --- a/src/net/ea/adminhandler.cpp +++ b/src/net/ea/adminhandler.cpp @@ -72,6 +72,26 @@ void AdminHandler::warp(const std::string &map, const int x, const int y) const "@warp %s %d %d", map.c_str(), x, y), GENERAL_CHANNEL); } +void AdminHandler::gotoName(const std::string &name) const +{ + Net::getChatHandler()->talk("@goto " + name, GENERAL_CHANNEL); +} + +void AdminHandler::recallName(const std::string &name) const +{ + Net::getChatHandler()->talk("@recall " + name, GENERAL_CHANNEL); +} + +void AdminHandler::reviveName(const std::string &name) const +{ + Net::getChatHandler()->talk("@revive " + name, GENERAL_CHANNEL); +} + +void AdminHandler::ipcheckName(const std::string &name) const +{ + Net::getChatHandler()->talk("@ipcheck " + name, GENERAL_CHANNEL); +} + void AdminHandler::createItems(const int id, const int color, const int amount) { if (serverVersion < 1) diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h index fb0ddfd0c..aeaa1154f 100644 --- a/src/net/ea/adminhandler.h +++ b/src/net/ea/adminhandler.h @@ -56,6 +56,14 @@ class AdminHandler : public Net::AdminHandler virtual void warp(const std::string &map, const int x, const int y) const override; + void gotoName(const std::string &name) const; + + void recallName(const std::string &name) const; + + void reviveName(const std::string &name) const; + + void ipcheckName(const std::string &name) const; + void createItems(const int id, const int color, const int amount); }; |