summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-24 17:09:20 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-24 17:09:20 +0300
commit66c5eb00b62cba0244446a8306dde1ae138d2e06 (patch)
tree41fefef24147487d9753e24ca5b4e340f14b554f /src/net/eathena
parentf0906ab944c982da76a5c123100e567e1db680ac (diff)
downloadmv-66c5eb00b62cba0244446a8306dde1ae138d2e06.tar.gz
mv-66c5eb00b62cba0244446a8306dde1ae138d2e06.tar.bz2
mv-66c5eb00b62cba0244446a8306dde1ae138d2e06.tar.xz
mv-66c5eb00b62cba0244446a8306dde1ae138d2e06.zip
Add chat command /gmcommands. Also add show commands to player context menu.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/adminhandler.cpp10
-rw-r--r--src/net/eathena/adminhandler.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index 630062167..e15c1dd19 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -22,7 +22,7 @@
#include "net/eathena/adminhandler.h"
-#include "being/being.h"
+#include "being/localplayer.h"
#include "const/gui/chat.h"
@@ -187,4 +187,12 @@ void AdminHandler::mobSpawnSearch(const std::string &name) const
chatHandler->talk("@whereis " + name, GENERAL_CHANNEL);
}
+void AdminHandler::playerGmCommands(const std::string &name) const
+{
+ if (name.empty() || (localPlayer && name == localPlayer->getName()))
+ chatHandler->talk("@commands", GENERAL_CHANNEL);
+ else
+ chatHandler->talk("#commands " + name, GENERAL_CHANNEL);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index de65a3f48..5f18c5d63 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -81,6 +81,8 @@ class AdminHandler final : public Ea::AdminHandler
void mobSpawnSearch(const std::string &name) const override final;
+ void playerGmCommands(const std::string &name) const override final;
+
protected:
static std::string mStatsName;
};