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 * ---------------------------------------------------
21 /* $ModDesc: A dummy module for testing */
23 // Class ModuleFoobar inherits from Module
24 // It just outputs simple debug strings to show its methods are working.
26 class ModuleFoobar : public Module
30 // It is recommended that your class makes use of one or more Server
31 // objects. A server object is a class which contains methods which
32 // encapsulate the exports from the core of the ircd.
33 // such methods include Debug, SendChannel, etc.
39 // The constructor just creates an instance of the server class
44 virtual ~ModuleFoobar()
46 // destructor deletes the instance of the server class
51 virtual Version GetVersion()
53 // this method instantiates a class of type Version, and returns
54 // the modules version information using it.
56 return Version(1,0,0,1,VF_VENDOR);
59 virtual void OnUserConnect(userrec* user)
61 // method called when a user connects
63 std::string b = user->nick;
64 Srv->Log(DEBUG,"Foobar: User connecting: " + b);
67 virtual void OnUserQuit(userrec* user)
69 // method called when a user disconnects
71 std::string b = user->nick;
72 Srv->Log(DEBUG,"Foobar: User quitting: " + b);
75 virtual void OnUserJoin(userrec* user, chanrec* channel)
77 // method called when a user joins a channel
79 std::string c = channel->name;
80 std::string b = user->nick;
81 Srv->Log(DEBUG,"Foobar: User " + b + " joined " + c);
84 virtual void OnUserPart(userrec* user, chanrec* channel)
86 // method called when a user parts a channel
88 std::string c = channel->name;
89 std::string b = user->nick;
90 Srv->Log(DEBUG,"Foobar: User " + b + " parted " + c);
97 // The ModuleFoobarFactory class inherits from ModuleFactory
98 // and creates a ModuleFoobar object when requested.
101 class ModuleFoobarFactory : public ModuleFactory
104 ModuleFoobarFactory()
108 ~ModuleFoobarFactory()
112 virtual Module * CreateModule()
114 return new ModuleFoobar;
121 // The "C" linkage factory0() function creates the ModuleFoobarFactory
122 // class for this library
125 extern "C" void * init_module( void )
127 return new ModuleFoobarFactory;