1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
19 /* $ModDesc: A dummy module for testing */
21 // Class ModuleFoobar inherits from Module
22 // It just outputs simple debug strings to show its methods are working.
24 class ModuleFoobar : public Module
28 // It is recommended that your class makes use of one or more Server
29 // objects. A server object is a class which contains methods which
30 // encapsulate the exports from the core of the ircd.
31 // such methods include Debug, SendChannel, etc.
35 ModuleFoobar(InspIRCd* Me)
38 // The constructor just makes a copy of the server class
43 virtual ~ModuleFoobar()
47 virtual Version GetVersion()
49 // this method instantiates a class of type Version, and returns
50 // the modules version information using it.
52 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
55 void Implements(char* List)
57 List[I_OnUserConnect] = List[I_OnUserQuit] = List[I_OnUserJoin] = List[I_OnUserPart] = 1;
60 virtual void OnUserConnect(userrec* user)
62 // method called when a user connects
64 std::string b = user->nick;
65 ServerInstance->Log(DEBUG,"Foobar: User connecting: "+b);
68 virtual void OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message)
70 // method called when a user disconnects
72 std::string b = user->nick;
73 ServerInstance->Log(DEBUG,"Foobar: User quitting: "+b);
76 virtual void OnUserJoin(userrec* user, chanrec* channel, bool &silent)
78 // method called when a user joins a channel
80 std::string c = channel->name;
81 std::string b = user->nick;
82 ServerInstance->Log(DEBUG,"Foobar: User "+b+" joined "+c);
85 virtual void OnUserPart(userrec* user, chanrec* channel, const std::string &partreason, bool &silent)
87 // method called when a user parts a channel
89 std::string c = channel->name;
90 std::string b = user->nick;
91 ServerInstance->Log(DEBUG,"Foobar: User "+b+" parted "+c);
97 MODULE_INIT(ModuleFoobar)