]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_conn_lusers.cpp
Moved a ton of functions into helperfuncs.h to speed up recompiles
[user/henk/code/inspircd.git] / src / modules / m_conn_lusers.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *     
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #include "users.h"
18 #include "channels.h"
19 #include "modules.h"
20
21 /* $ModDesc: Sends the /LUSERS on connect */
22
23 // This has to be the simplest module ever.
24 // The RFC doesnt specify that you should send the /LUSERS numerics
25 // on connect, but someone asked for it, so its in a module.
26
27 class ModuleConnLUSERS : public Module
28 {
29  private:
30          
31          Server *Srv;
32  public:
33         ModuleConnLUSERS()
34         {
35                 Srv = new Server;
36         }
37         
38         virtual ~ModuleConnLUSERS()
39         {
40                 delete Srv;
41         }
42         
43         virtual Version GetVersion()
44         {
45                 return Version(1,0,0,1,VF_VENDOR);
46         }
47         
48         virtual void OnUserConnect(userrec* user)
49         {
50                 Srv->CallCommandHandler("LUSERS", NULL, 0, user);
51         }
52 };
53
54
55 //
56 // The ModuleConnLUSERSFactory class inherits from ModuleFactory
57 // and creates a ModuleConnLUSERS object when requested.
58 //
59
60 class ModuleConnLUSERSFactory : public ModuleFactory
61 {
62  public:
63         ModuleConnLUSERSFactory()
64         {
65         }
66         
67         ~ModuleConnLUSERSFactory()
68         {
69         }
70         
71         virtual Module * CreateModule()
72         {
73                 return new ModuleConnLUSERS;
74         }
75         
76 };
77
78
79 //
80 // The "C" linkage factory0() function creates the ModuleConnLUSERSFactory
81 // class for this library
82 //
83
84 extern "C" void * init_module( void )
85 {
86         return new ModuleConnLUSERSFactory;
87 }
88