From 5b03a091589806dd2250db646b7739f09e55d424 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 24 Feb 2016 01:42:03 +0300 Subject: Add chat command for gm /mobsearch --- src/actions/commands.cpp | 9 +++++++++ src/actions/commands.h | 1 + src/dyetool/actions/commands.cpp | 1 + src/enums/input/inputaction.h | 1 + src/input/inputactionmap.h | 6 ++++++ src/net/adminhandler.h | 2 ++ src/net/eathena/adminhandler.cpp | 5 +++++ src/net/eathena/adminhandler.h | 2 ++ src/net/tmwa/adminhandler.cpp | 4 ++++ src/net/tmwa/adminhandler.h | 2 ++ 10 files changed, 33 insertions(+) (limited to 'src') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 2eec5c392..2adef54ca 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -1245,4 +1245,13 @@ impHandler(whoDrops) return true; } +impHandler(mobSearch) +{ + const std::string args = event.args; + if (args.empty()) + return false; + adminHandler->mobSearch(args); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 4378e2127..07b5dda2e 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -100,6 +100,7 @@ namespace Actions decHandler(monsterInfo); decHandler(itemInfo); decHandler(whoDrops); + decHandler(mobSearch); } // namespace Actions #undef decHandler diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp index a515e8b05..18278f6a1 100644 --- a/src/dyetool/actions/commands.cpp +++ b/src/dyetool/actions/commands.cpp @@ -100,5 +100,6 @@ impHandlerVoid(ignorePickup) impHandlerVoid(monsterInfo) impHandlerVoid(itemInfo) impHandlerVoid(whoDrops) +impHandlerVoid(mobSearch) } // namespace Actions diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h index 7437ee44e..019df826a 100644 --- a/src/enums/input/inputaction.h +++ b/src/enums/input/inputaction.h @@ -629,6 +629,7 @@ enumStart(InputAction) MONSTER_INFO, ITEM_INFO, WHO_DROPS, + MOB_SEARCH, TOTAL } enumEnd(InputAction); diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index d52701cec..e7322d456 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -5263,6 +5263,12 @@ static const InputActionData inputActionData "whodrops|whodrop", UseArgs_true, Protected_true}, + {"keyMobSearch", + defaultAction(&Actions::mobSearch), + InputCondition::INGAME, + "mobsearch|monstersearch", + UseArgs_true, + Protected_true}, }; #undef defaultAction diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index d6e1ba11e..caa5098b9 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -102,6 +102,8 @@ class AdminHandler notfinal virtual void itemInfo(const std::string &name) const = 0; virtual void whoDrops(const std::string &name) const = 0; + + virtual void mobSearch(const std::string &name) const = 0; }; } // namespace Net diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index 3064a9ca2..d13c29a31 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -177,4 +177,9 @@ void AdminHandler::whoDrops(const std::string &name) const chatHandler->talk("@whodrops " + name, GENERAL_CHANNEL); } +void AdminHandler::mobSearch(const std::string &name) const +{ + chatHandler->talk("@mobsearch " + name, GENERAL_CHANNEL); +} + } // namespace EAthena diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h index e7a5a1473..79ce6cf23 100644 --- a/src/net/eathena/adminhandler.h +++ b/src/net/eathena/adminhandler.h @@ -77,6 +77,8 @@ class AdminHandler final : public Ea::AdminHandler void whoDrops(const std::string &name) const override final; + void mobSearch(const std::string &name) const override final; + protected: static std::string mStatsName; }; diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 0e1c8ef79..e26806c8d 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -138,4 +138,8 @@ void AdminHandler::whoDrops(const std::string &name A_UNUSED) const { } +void AdminHandler::mobSearch(const std::string &name A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index 5c0e2558d..94ec3b7be 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -78,6 +78,8 @@ class AdminHandler final : public Ea::AdminHandler void itemInfo(const std::string &name) const override final A_CONST; void whoDrops(const std::string &name) const override final A_CONST; + + void mobSearch(const std::string &name) const override final A_CONST; }; } // namespace TmwAthena -- cgit v1.2.3-60-g2f50