1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 16:03:13 +02:00

Rework how the RPC interface stores its events.

This commit is contained in:
Sadie Powell
2025-02-18 17:01:33 +00:00
parent 98320d130f
commit 3c55fbe650
4 changed files with 155 additions and 88 deletions
+15 -3
View File
@@ -46,9 +46,21 @@ class RPCServiceInterface;
class RPCEvent
{
private:
Anope::string event;
protected:
RPCEvent(const Anope::string& e)
: event(e)
{
}
public:
virtual ~RPCEvent() = default;
virtual bool Run(RPCServiceInterface *iface, HTTPClient *client, RPCRequest &request) = 0;
const auto &GetEvent() const { return event; }
virtual void Run(RPCServiceInterface *iface, HTTPClient *client, RPCRequest &request) = 0;
};
class RPCServiceInterface
@@ -57,9 +69,9 @@ class RPCServiceInterface
public:
RPCServiceInterface(Module *creator, const Anope::string &sname) : Service(creator, "RPCServiceInterface", sname) { }
virtual void Register(RPCEvent *event) = 0;
virtual bool Register(RPCEvent *event) = 0;
virtual void Unregister(RPCEvent *event) = 0;
virtual bool Unregister(RPCEvent *event) = 0;
virtual void Reply(RPCRequest &request) = 0;
};