]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - 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
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "users.h"
16 #include "channels.h"
17 #include "modules.h"
18
19 /* $ModDesc: Provides a pointless /dalinfo command, demo module */
20
21 /** Handle /DALINFO
22  */
23 class cmd_dalinfo : public command_t
24 {
25  public:
26         /* Command 'dalinfo', takes no parameters and needs no special modes */
27         cmd_dalinfo (InspIRCd* Instance) : command_t(Instance,"DALINFO", 0, 0)
28         {
29                 this->source = "m_testcommand.so";
30         }
31
32         CmdResult Handle (const char** parameters, int pcnt, userrec *user)
33         {
34                 user->WriteServ("NOTICE %s :*** DALNet had nothing to do with it.", user->nick);
35                 return CMD_FAILURE;
36         }
37 };
38
39 class ModuleTestCommand : public Module
40 {
41         cmd_dalinfo* newcommand;
42  public:
43         ModuleTestCommand(InspIRCd* Me)
44                 : Module(Me)
45         {
46                 // Create a new command
47                 newcommand = new cmd_dalinfo(ServerInstance);
48                 ServerInstance->AddCommand(newcommand);
49         }
50
51         void Implements(char* List)
52         {
53         }
54
55         virtual ~ModuleTestCommand()
56         {
57                 delete newcommand;
58         }
59
60         virtual Version GetVersion()
61         {
62                 return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
63         }
64 };
65
66 MODULE_INIT(ModuleTestCommand)
67