X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_rpctest.cpp;h=a3397651087faf591867e43bfa4db4807fd43dd2;hb=6d03943426dcce76ba66567a9b18425a5ebb4c0c;hp=673955a0dceaf58cab23a48c3cd7452bf161a2c4;hpb=c2957516bca0fe70622c7668a12ade68576ddab2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_rpctest.cpp b/src/modules/m_rpctest.cpp index 673955a0d..a33976510 100644 --- a/src/modules/m_rpctest.cpp +++ b/src/modules/m_rpctest.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -12,9 +12,6 @@ */ #include "inspircd.h" -#include "users.h" -#include "channels.h" -#include "modules.h" #include "rpc.h" /* $ModDesc: A test of the RPC API */ @@ -23,30 +20,29 @@ class ModuleRPCTest : public Module { private: - + public: - ModuleRPCTest(InspIRCd *Me) : Module(Me) - { + ModuleRPCTest() { Implementation eventlist[] = { I_OnEvent }; ServerInstance->Modules->Attach(eventlist, this, 1); } - + virtual ~ModuleRPCTest() { } - + virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_VENDOR, API_VERSION); + return Version("A test of the RPC API", 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; @@ -55,7 +51,7 @@ class ModuleRPCTest : public Module req->error = "Insufficient parameters"; return; } - + req->result->SetString(req->parameters->GetArray(0)->GetString()); } }