1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
23 /* $ModDesc: Sends the /LUSERS on connect */
25 // This has to be the simplest module ever.
26 // The RFC doesnt specify that you should send the /LUSERS numerics
27 // on connect, but someone asked for it, so its in a module.
29 class ModuleConnLUSERS : public Module
35 ModuleConnLUSERS(Server* Me)
41 virtual ~ModuleConnLUSERS()
45 virtual Version GetVersion()
47 return Version(1,0,0,1,VF_VENDOR);
50 void Implements(char* List)
52 List[I_OnUserConnect] = 1;
55 virtual void OnUserConnect(userrec* user)
57 // if we're using a protocol module, we cant just call
58 // the command handler because the protocol module
59 // has hooked it. We must call OnPreCommand in the
60 // protocol module. Yes, at some point there will
61 // be a way to get the current protocol module's name
62 // from the core and probably a pointer to its class.
63 Module* Proto = Srv->FindModule("m_spanningtree.so");
66 Proto->OnPreCommand("LUSERS", NULL, 0, user, true);
70 Srv->CallCommandHandler("LUSERS", NULL, 0, user);
77 // The ModuleConnLUSERSFactory class inherits from ModuleFactory
78 // and creates a ModuleConnLUSERS object when requested.
81 class ModuleConnLUSERSFactory : public ModuleFactory
84 ModuleConnLUSERSFactory()
88 ~ModuleConnLUSERSFactory()
92 virtual Module * CreateModule(Server* Me)
94 return new ModuleConnLUSERS(Me);
101 // The "C" linkage factory0() function creates the ModuleConnLUSERSFactory
102 // class for this library
105 extern "C" void * init_module( void )
107 return new ModuleConnLUSERSFactory;