summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-24 00:35:23 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-24 00:35:23 +0300
commit9208926ca3f162102c08b8e5331f5a1c38681d4f (patch)
tree05dda363ac2288c444691b889cac87a84e67d00e
parent7eabdd0b8c8281128249659c4d8e8501c10da66e (diff)
downloadplus-9208926ca3f162102c08b8e5331f5a1c38681d4f.tar.gz
plus-9208926ca3f162102c08b8e5331f5a1c38681d4f.tar.bz2
plus-9208926ca3f162102c08b8e5331f5a1c38681d4f.tar.xz
plus-9208926ca3f162102c08b8e5331f5a1c38681d4f.zip
Add gm chat command /whodrops
-rw-r--r--src/actions/commands.cpp9
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/dyetool/actions/commands.cpp1
-rw-r--r--src/enums/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h6
-rw-r--r--src/net/adminhandler.h2
-rw-r--r--src/net/eathena/adminhandler.cpp5
-rw-r--r--src/net/eathena/adminhandler.h2
-rw-r--r--src/net/tmwa/adminhandler.cpp4
-rw-r--r--src/net/tmwa/adminhandler.h2
10 files changed, 33 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 2e7252985..2eec5c392 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -1236,4 +1236,13 @@ impHandler(itemInfo)
return true;
}
+impHandler(whoDrops)
+{
+ const std::string args = event.args;
+ if (args.empty())
+ return false;
+ adminHandler->whoDrops(args);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index 7f37f1656..4378e2127 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -99,6 +99,7 @@ namespace Actions
decHandler(ignorePickup);
decHandler(monsterInfo);
decHandler(itemInfo);
+ decHandler(whoDrops);
} // namespace Actions
#undef decHandler
diff --git a/src/dyetool/actions/commands.cpp b/src/dyetool/actions/commands.cpp
index 45458ab65..a515e8b05 100644
--- a/src/dyetool/actions/commands.cpp
+++ b/src/dyetool/actions/commands.cpp
@@ -99,5 +99,6 @@ impHandlerVoid(removePickup)
impHandlerVoid(ignorePickup)
impHandlerVoid(monsterInfo)
impHandlerVoid(itemInfo)
+impHandlerVoid(whoDrops)
} // namespace Actions
diff --git a/src/enums/input/inputaction.h b/src/enums/input/inputaction.h
index 52344e683..7437ee44e 100644
--- a/src/enums/input/inputaction.h
+++ b/src/enums/input/inputaction.h
@@ -628,6 +628,7 @@ enumStart(InputAction)
TARGET_SKILL_UNIT,
MONSTER_INFO,
ITEM_INFO,
+ WHO_DROPS,
TOTAL
}
enumEnd(InputAction);
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index c59203900..d52701cec 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -5257,6 +5257,12 @@ static const InputActionData inputActionData
"iteminfo|ii",
UseArgs_true,
Protected_true},
+ {"keyWhoDrops",
+ defaultAction(&Actions::whoDrops),
+ InputCondition::INGAME,
+ "whodrops|whodrop",
+ UseArgs_true,
+ Protected_true},
};
#undef defaultAction
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index 949b36d4e..d6e1ba11e 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -100,6 +100,8 @@ class AdminHandler notfinal
virtual void monsterInfo(const std::string &name) const = 0;
virtual void itemInfo(const std::string &name) const = 0;
+
+ virtual void whoDrops(const std::string &name) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index ed328b57b..3064a9ca2 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -172,4 +172,9 @@ void AdminHandler::itemInfo(const std::string &name) const
chatHandler->talk("@iteminfo " + name, GENERAL_CHANNEL);
}
+void AdminHandler::whoDrops(const std::string &name) const
+{
+ chatHandler->talk("@whodrops " + name, GENERAL_CHANNEL);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index 51dca1b6f..e7a5a1473 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -75,6 +75,8 @@ class AdminHandler final : public Ea::AdminHandler
void itemInfo(const std::string &name) const override final;
+ void whoDrops(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 ec3a8ffc3..0e1c8ef79 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -134,4 +134,8 @@ void AdminHandler::itemInfo(const std::string &name A_UNUSED) const
{
}
+void AdminHandler::whoDrops(const std::string &name A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index ca02ae7cd..5c0e2558d 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -76,6 +76,8 @@ class AdminHandler final : public Ea::AdminHandler
void monsterInfo(const std::string &name) const override final A_CONST;
void itemInfo(const std::string &name) const override final A_CONST;
+
+ void whoDrops(const std::string &name) const override final A_CONST;
};
} // namespace TmwAthena