]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_testcommand.cpp
f2a0fb5fdceb363c5a762f91a741d8c20abed5eb
[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
16 /* $ModDesc: Provides a pointless /dalinfo command, demo module */
17
18 /** Handle /DALINFO
19  */
20 class cmd_dalinfo : public command_t
21 {
22  public:
23         /* Command 'dalinfo', takes no parameters and needs no special modes */
24         cmd_dalinfo (InspIRCd* Instance) : command_t(Instance,"DALINFO", 0, 0)
25         {
26                 this->source = "m_testcommand.so";
27         }
28
29         CmdResult Handle (const char** parameters, int pcnt, userrec *user)
30         {
31                 user->WriteServ("NOTICE %s :*** DALNet had nothing to do with it.", user->nick);
32                 return CMD_FAILURE;
33         }
34 };
35
36 class ModuleTestCommand : public Module
37 {
38         cmd_dalinfo* newcommand;
39  public:
40         ModuleTestCommand(InspIRCd* Me)
41                 : Module(Me)
42         {
43                 // Create a new command
44                 newcommand = new cmd_dalinfo(ServerInstance);
45                 ServerInstance->AddCommand(newcommand);
46         }
47
48         void Implements(char* List)
49         {
50         }
51
52         virtual ~ModuleTestCommand()
53         {
54         }
55
56         virtual Version GetVersion()
57         {
58                 return Version(1, 1, 0, 0, VF_VENDOR, API_VERSION);
59         }
60 };
61
62 MODULE_INIT(ModuleTestCommand)
63