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
40 virtual ~ModuleFoobar()
44 virtual Version GetVersion()
46 // this method instantiates a class of type Version, and returns
47 // the modules version information using it.
49 return Version(1,1,0,1,VF_VENDOR,API_VERSION);
52 void Implements(char* List)
54 List[I_OnUserConnect] = List[I_OnUserQuit] = List[I_OnUserJoin] = List[I_OnUserPart] = 1;
57 virtual void OnUserConnect(User* user)
59 // method called when a user connects
61 std::string b = user->nick;
62 ServerInstance->Log(DEBUG,"Foobar: User connecting: "+b);
65 virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
67 // method called when a user disconnects
69 std::string b = user->nick;
70 ServerInstance->Log(DEBUG,"Foobar: User quitting: "+b);
73 virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
75 // method called when a user joins a channel
77 std::string c = channel->name;
78 std::string b = user->nick;
79 ServerInstance->Log(DEBUG,"Foobar: User "+b+" joined "+c);
82 virtual void OnUserPart(User* user, Channel* channel, const std::string &partreason, bool &silent)
84 // method called when a user parts a channel
86 std::string c = channel->name;
87 std::string b = user->nick;
88 ServerInstance->Log(DEBUG,"Foobar: User "+b+" parted "+c);
94 MODULE_INIT(ModuleFoobar)