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 * ---------------------------------------------------
25 /* $ModDesc: A dummy module for testing */
27 // Class ModuleFoobar inherits from Module
28 // It just outputs simple debug strings to show its methods are working.
30 class ModuleFoobar : public Module
34 // It is recommended that your class makes use of one or more Server
35 // objects. A server object is a class which contains methods which
36 // encapsulate the exports from the core of the ircd.
37 // such methods include Debug, SendChannel, etc.
41 ModuleFoobar(InspIRCd* Me)
44 // The constructor just makes a copy of the server class
49 virtual ~ModuleFoobar()
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 void Implements(char* List)
63 List[I_OnUserConnect] = List[I_OnUserQuit] = List[I_OnUserJoin] = List[I_OnUserPart] = 1;
66 virtual void OnUserConnect(userrec* user)
68 // method called when a user connects
70 std::string b = user->nick;
71 ServerInstance->Log(DEBUG,"Foobar: User connecting: "+b);
74 virtual void OnUserQuit(userrec* user, const std::string &reason)
76 // method called when a user disconnects
78 std::string b = user->nick;
79 ServerInstance->Log(DEBUG,"Foobar: User quitting: "+b);
82 virtual void OnUserJoin(userrec* user, chanrec* channel)
84 // method called when a user joins a channel
86 std::string c = channel->name;
87 std::string b = user->nick;
88 ServerInstance->Log(DEBUG,"Foobar: User "+b+" joined "+c);
91 virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partreason)
93 // method called when a user parts a channel
95 std::string c = channel->name;
96 std::string b = user->nick;
97 ServerInstance->Log(DEBUG,"Foobar: User "+b+" parted "+c);
104 // The ModuleFoobarFactory class inherits from ModuleFactory
105 // and creates a ModuleFoobar object when requested.
108 class ModuleFoobarFactory : public ModuleFactory
111 ModuleFoobarFactory()
115 ~ModuleFoobarFactory()
119 virtual Module * CreateModule(InspIRCd* Me)
121 return new ModuleFoobar(Me);
128 // The "C" linkage factory0() function creates the ModuleFoobarFactory
129 // class for this library
132 extern "C" void * init_module( void )
134 return new ModuleFoobarFactory;