X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_rpctest.cpp;h=0ff938041938bf141423f32459a1b352b3fd0e79;hb=27cef863f7286b626e01f1287f31005478a66fea;hp=1d3f2a71ee3f1c125361c28cd1e837d45ffcb103;hpb=2e1f86fd0c9911210b79e6ac346672441eef18c4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_rpctest.cpp b/src/modules/m_rpctest.cpp index 1d3f2a71e..0ff938041 100644 --- a/src/modules/m_rpctest.cpp +++ b/src/modules/m_rpctest.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -23,32 +23,30 @@ class ModuleRPCTest : public Module { private: - + public: ModuleRPCTest(InspIRCd *Me) : Module(Me) { + Implementation eventlist[] = { I_OnEvent }; + ServerInstance->Modules->Attach(eventlist, this, 1); } - + virtual ~ModuleRPCTest() { } - + virtual Version GetVersion() { - return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION); - } - - void Implements(char *List) - { - List[I_OnEvent] = 1; + return Version(1, 2, 0, 0, VF_VENDOR, API_VERSION); } - + + virtual void OnEvent(Event *ev) { if (ev->GetEventID() == "RPCMethod") { RPCRequest *req = (RPCRequest*) ev->GetData(); - + if (req->method == "test.echo") { req->claimed = true; @@ -57,7 +55,7 @@ class ModuleRPCTest : public Module req->error = "Insufficient parameters"; return; } - + req->result->SetString(req->parameters->GetArray(0)->GetString()); } }