1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
20 /* $ModDesc: A test of the RPC API */
23 class ModuleRPCTest : public Module
28 ModuleRPCTest(InspIRCd *Me) : Module(Me)
32 virtual ~ModuleRPCTest()
36 virtual Version GetVersion()
38 return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
41 void Implements(char *List)
46 virtual void OnEvent(Event *ev)
48 if (ev->GetEventID() == "RPCMethod")
50 RPCRequest *req = (RPCRequest*) ev->GetData();
52 if (req->method == "test.echo")
55 if (req->parameters->ArraySize() < 1)
57 req->error = "Insufficient parameters";
61 req->result->SetString(req->parameters->GetArray(0)->GetString());
67 MODULE_INIT(ModuleRPCTest);