]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_testcommand.cpp
OOPS! We try again, since I'm smoking craq. LF is 0x0a NOT CR.
[user/henk/code/inspircd.git] / src / modules / m_testcommand.cpp
index 0733fd0f06e56202562a2b4f4a7e233740cc5fc9..6ec197eb69487bbf618992b92540e69e05da678b 100644 (file)
@@ -1 +1,67 @@
-/*       +------------------------------------+\r *       | Inspire Internet Relay Chat Daemon |\r *       +------------------------------------+\r *\r *  InspIRCd: (C) 2002-2007 InspIRCd Development Team\r * See: http://www.inspircd.org/wiki/index.php/Credits\r *\r * This program is free but copyrighted software; see\r *            the file COPYING for details.\r *\r * ---------------------------------------------------\r */\r\r#include "inspircd.h"\r#include "users.h"\r#include "channels.h"\r#include "modules.h"\r\r/* $ModDesc: Provides a pointless /dalinfo command, demo module */\r\r/** Handle /DALINFO\r */\rclass cmd_dalinfo : public command_t\r{\r public:\r  /* Command 'dalinfo', takes no parameters and needs no special modes */\r        cmd_dalinfo (InspIRCd* Instance) : command_t(Instance,"DALINFO", 0, 0)\r {\r              this->source = "m_testcommand.so";\r     }\r\r     CmdResult Handle (const char** parameters, int pcnt, userrec *user)\r    {\r              user->WriteServ("NOTICE %s :*** DALNet had nothing to do with it.", user->nick);\r               return CMD_FAILURE;\r    }\r};\r\rclass ModuleTestCommand : public Module\r{\r        cmd_dalinfo* newcommand;\r public:\r      ModuleTestCommand(InspIRCd* Me)\r                : Module(Me)\r   {\r              // Create a new command\r                newcommand = new cmd_dalinfo(ServerInstance);\r          ServerInstance->AddCommand(newcommand);\r        }\r\r     void Implements(char* List)\r    {\r      }\r\r     virtual ~ModuleTestCommand()\r   {\r              delete newcommand;\r     }\r\r     virtual Version GetVersion()\r   {\r              return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);\r    }\r};\r\rMODULE_INIT(ModuleTestCommand)\r\r
\ No newline at end of file
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#include "inspircd.h"
+#include "users.h"
+#include "channels.h"
+#include "modules.h"
+
+/* $ModDesc: Provides a pointless /dalinfo command, demo module */
+
+/** Handle /DALINFO
+ */
+class cmd_dalinfo : public command_t
+{
+ public:
+       /* Command 'dalinfo', takes no parameters and needs no special modes */
+       cmd_dalinfo (InspIRCd* Instance) : command_t(Instance,"DALINFO", 0, 0)
+       {
+               this->source = "m_testcommand.so";
+       }
+
+       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
+       {
+               user->WriteServ("NOTICE %s :*** DALNet had nothing to do with it.", user->nick);
+               return CMD_FAILURE;
+       }
+};
+
+class ModuleTestCommand : public Module
+{
+       cmd_dalinfo* newcommand;
+ public:
+       ModuleTestCommand(InspIRCd* Me)
+               : Module(Me)
+       {
+               // Create a new command
+               newcommand = new cmd_dalinfo(ServerInstance);
+               ServerInstance->AddCommand(newcommand);
+       }
+
+       void Implements(char* List)
+       {
+       }
+
+       virtual ~ModuleTestCommand()
+       {
+               delete newcommand;
+       }
+
+       virtual Version GetVersion()
+       {
+               return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
+       }
+};
+
+MODULE_INIT(ModuleTestCommand)
+