1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 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 * ---------------------------------------------------
24 /* $ModDesc: Sends the /LUSERS on connect */
28 // This has to be the simplest module ever.
29 // The RFC doesnt specify that you should send the /LUSERS numerics
30 // on connect, but someone asked for it, so its in a module.
32 class ModuleConnLUSERS : public Module
38 ModuleConnLUSERS(InspIRCd* Me)
44 virtual ~ModuleConnLUSERS()
48 virtual Version GetVersion()
50 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
53 void Implements(char* List)
55 List[I_OnUserConnect] = 1;
58 virtual void OnUserConnect(userrec* user)
60 // if we're using a protocol module, we cant just call
61 // the command handler because the protocol module
62 // has hooked it. We must call OnPreCommand in the
63 // protocol module. Yes, at some point there will
64 // be a way to get the current protocol module's name
65 // from the core and probably a pointer to its class.
66 Module* Proto = ServerInstance->FindModule("m_spanningtree.so");
69 Proto->OnPreCommand("LUSERS", NULL, 0, user, true, "LUSERS");
73 ServerInstance->CallCommandHandler("LUSERS", NULL, 0, user);
80 // The ModuleConnLUSERSFactory class inherits from ModuleFactory
81 // and creates a ModuleConnLUSERS object when requested.
84 class ModuleConnLUSERSFactory : public ModuleFactory
87 ModuleConnLUSERSFactory()
91 ~ModuleConnLUSERSFactory()
95 virtual Module * CreateModule(InspIRCd* Me)
97 return new ModuleConnLUSERS(Me);
104 // The "C" linkage factory0() function creates the ModuleConnLUSERSFactory
105 // class for this library
108 extern "C" void * init_module( void )
110 return new ModuleConnLUSERSFactory;