summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-24 17:19:40 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-24 17:19:40 +0300
commit142cdd218fe10efbea5ceb78cb7947812c35e19e (patch)
tree38a40bddc3b8c9d719ad3f370aecd4ceb191f728 /src/net
parent66c5eb00b62cba0244446a8306dde1ae138d2e06 (diff)
downloadmanaplus-142cdd218fe10efbea5ceb78cb7947812c35e19e.tar.gz
manaplus-142cdd218fe10efbea5ceb78cb7947812c35e19e.tar.bz2
manaplus-142cdd218fe10efbea5ceb78cb7947812c35e19e.tar.xz
manaplus-142cdd218fe10efbea5ceb78cb7947812c35e19e.zip
Add chat command /gmcharcommands. Also add show char commands to player context menu.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/adminhandler.h2
-rw-r--r--src/net/eathena/adminhandler.cpp8
-rw-r--r--src/net/eathena/adminhandler.h3
-rw-r--r--src/net/tmwa/adminhandler.cpp4
-rw-r--r--src/net/tmwa/adminhandler.h3
5 files changed, 20 insertions, 0 deletions
diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h
index b839096a8..31dd89f02 100644
--- a/src/net/adminhandler.h
+++ b/src/net/adminhandler.h
@@ -108,6 +108,8 @@ class AdminHandler notfinal
virtual void mobSpawnSearch(const std::string &name) const = 0;
virtual void playerGmCommands(const std::string &name) const = 0;
+
+ virtual void playerCharGmCommands(const std::string &name) const = 0;
};
} // namespace Net
diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp
index e15c1dd19..f5f5099ae 100644
--- a/src/net/eathena/adminhandler.cpp
+++ b/src/net/eathena/adminhandler.cpp
@@ -195,4 +195,12 @@ void AdminHandler::playerGmCommands(const std::string &name) const
chatHandler->talk("#commands " + name, GENERAL_CHANNEL);
}
+void AdminHandler::playerCharGmCommands(const std::string &name) const
+{
+ if (name.empty() || (localPlayer && name == localPlayer->getName()))
+ chatHandler->talk("@charcommands", GENERAL_CHANNEL);
+ else
+ chatHandler->talk("#charcommands " + name, GENERAL_CHANNEL);
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h
index 5f18c5d63..c84368d8b 100644
--- a/src/net/eathena/adminhandler.h
+++ b/src/net/eathena/adminhandler.h
@@ -83,6 +83,9 @@ class AdminHandler final : public Ea::AdminHandler
void playerGmCommands(const std::string &name) const override final;
+ void playerCharGmCommands(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 6050d2375..91a1985b1 100644
--- a/src/net/tmwa/adminhandler.cpp
+++ b/src/net/tmwa/adminhandler.cpp
@@ -150,4 +150,8 @@ void AdminHandler::playerGmCommands(const std::string &name A_UNUSED) const
{
}
+void AdminHandler::playerCharGmCommands(const std::string &name A_UNUSED) const
+{
+}
+
} // namespace TmwAthena
diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h
index fab21a9ed..35a12913a 100644
--- a/src/net/tmwa/adminhandler.h
+++ b/src/net/tmwa/adminhandler.h
@@ -86,6 +86,9 @@ class AdminHandler final : public Ea::AdminHandler
void playerGmCommands(const std::string &name) const override final
A_CONST;
+
+ void playerCharGmCommands(const std::string &name) const override final
+ A_CONST;
};
} // namespace TmwAthena