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: A dummy module for testing */
25 // Class ModuleFoobar inherits from Module
26 // It just outputs simple debug strings to show its methods are working.
28 class ModuleFoobar : public Module
32 // It is recommended that your class makes use of one or more Server
33 // objects. A server object is a class which contains methods which
34 // encapsulate the exports from the core of the ircd.
35 // such methods include Debug, SendChannel, etc.
41 // The constructor just creates an instance of the server class
46 virtual ~ModuleFoobar()
48 // destructor deletes the instance of the server class
53 virtual Version GetVersion()
55 // this method instantiates a class of type Version, and returns
56 // the modules version information using it.
58 return Version(1,0,0,1,VF_VENDOR);
61 virtual void OnUserConnect(userrec* user)
63 // method called when a user connects
65 std::string b = user->nick;
66 Srv->Log(DEBUG,"Foobar: User connecting: " + b);
69 virtual void OnUserQuit(userrec* user, std::string reason)
71 // method called when a user disconnects
73 std::string b = user->nick;
74 Srv->Log(DEBUG,"Foobar: User quitting: " + b);
77 virtual void OnUserJoin(userrec* user, chanrec* channel)
79 // method called when a user joins a channel
81 std::string c = channel->name;
82 std::string b = user->nick;
83 Srv->Log(DEBUG,"Foobar: User " + b + " joined " + c);
86 virtual void OnUserPart(userrec* user, chanrec* channel)
88 // method called when a user parts a channel
90 std::string c = channel->name;
91 std::string b = user->nick;
92 Srv->Log(DEBUG,"Foobar: User " + b + " parted " + c);
99 // The ModuleFoobarFactory class inherits from ModuleFactory
100 // and creates a ModuleFoobar object when requested.
103 class ModuleFoobarFactory : public ModuleFactory
106 ModuleFoobarFactory()
110 ~ModuleFoobarFactory()
114 virtual Module * CreateModule()
116 return new ModuleFoobar;
123 // The "C" linkage factory0() function creates the ModuleFoobarFactory
124 // class for this library
127 extern "C" void * init_module( void )
129 return new ModuleFoobarFactory;