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 * ---------------------------------------------------
16 /* $ModDesc: A dummy module for testing */
18 // Class ModuleFoobar inherits from Module
19 // It just outputs simple debug strings to show its methods are working.
21 class ModuleFoobar : public Module
25 // It is recommended that your class makes use of one or more Server
26 // objects. A server object is a class which contains methods which
27 // encapsulate the exports from the core of the ircd.
28 // such methods include Debug, SendChannel, etc.
32 ModuleFoobar(InspIRCd* Me)
35 // The constructor just makes a copy of the server class
38 Implementation eventlist[] = { I_OnUserConnect, I_OnUserQuit, I_OnUserJoin, I_OnUserPart };
39 ServerInstance->Modules->Attach(eventlist, this, 4);
42 virtual ~ModuleFoobar()
46 virtual Version GetVersion()
48 // this method instantiates a class of type Version, and returns
49 // the modules version information using it.
51 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
55 virtual void OnUserConnect(User* user)
57 // method called when a user connects
59 std::string b = user->nick;
60 ServerInstance->Log(DEBUG,"Foobar: User connecting: "+b);
63 virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
65 // method called when a user disconnects
67 std::string b = user->nick;
68 ServerInstance->Log(DEBUG,"Foobar: User quitting: "+b);
71 virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
73 // method called when a user joins a channel
75 std::string c = channel->name;
76 std::string b = user->nick;
77 ServerInstance->Log(DEBUG,"Foobar: User "+b+" joined "+c);
80 virtual void OnUserPart(User* user, Channel* channel, const std::string &partreason, bool &silent)
82 // method called when a user parts a channel
84 std::string c = channel->name;
85 std::string b = user->nick;
86 ServerInstance->Log(DEBUG,"Foobar: User "+b+" parted "+c);
92 MODULE_INIT(ModuleFoobar)