From e2fcf7b3b15f86fec250b7b784bdf3d0631048c6 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 19 Jul 2019 14:12:13 +0100 Subject: Add an event for adding tags to S2S messages. --- include/modules/server.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') diff --git a/include/modules/server.h b/include/modules/server.h index 6bd10b3e3..259da868f 100644 --- a/include/modules/server.h +++ b/include/modules/server.h @@ -25,6 +25,7 @@ namespace ServerProtocol { class BroadcastEventListener; class LinkEventListener; + class MessageEventListener; class SyncEventListener; } @@ -66,6 +67,30 @@ class ServerProtocol::LinkEventListener virtual void OnServerSplit(const Server* server) { } }; +class ServerProtocol::MessageEventListener + : public Events::ModuleEventListener +{ + public: + MessageEventListener(Module* mod) + : ModuleEventListener(mod, "event/server-message") + { + } + + /** Fired when a server message is being sent by a user. + * @param source The user who sent the message. + * @param name The name of the command which was sent. + * @param tags The tags which will be sent with the message. + */ + virtual void OnBuildMessage(User* source, const char* name, ClientProtocol::TagMap& tags) { } + + /** Fired when a server message is being sent by a server. + * @param source The server who sent the message. + * @param name The name of the command which was sent. + * @param tags The tags which will be sent with the message. + */ + virtual void OnBuildMessage(Server* source, const char* name, ClientProtocol::TagMap& tags) { } +}; + class ServerProtocol::SyncEventListener : public Events::ModuleEventListener { -- cgit v1.2.3