]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_rpctest.cpp
Update copyrights for 2009.
[user/henk/code/inspircd.git] / src / modules / m_rpctest.cpp
index 720e7a9e5b4036d0f37e09c129af6f786e7ccfe8..830325bd1a9824665c5677ad4c7830591739286b 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -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 */
 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("$Id$", 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,11 +52,12 @@ class ModuleRPCTest : public Module
                                        req->error = "Insufficient parameters";
                                        return;
                                }
-                               
+
                                req->result->SetString(req->parameters->GetArray(0)->GetString());
                        }
                }
        }
 };
 
-MODULE_INIT(ModuleRPCTest);
+MODULE_INIT(ModuleRPCTest)
+