1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>Module class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
6 <!-- Generated by Doxygen 1.3-rc3 -->
8 <a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
9 <hr><h1>Module Class Reference</h1>Base class for all InspIRCd modules This class is the base class for InspIRCd modules.
10 <a href="#_details">More...</a>
12 <code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code>
14 Inheritance diagram for Module:<p><center><img src="classModule__inherit__graph.gif" border="0" usemap="#Module__inherit__map" alt="Inheritance graph"></center>
15 <map name="Module__inherit__map">
16 <area href="classclassbase.html" shape="rect" coords="7,16,73,37" alt="">
18 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center>Collaboration diagram for Module:<p><center><img src="classModule__coll__graph.gif" border="0" usemap="#Module__coll__map" alt="Collaboration graph"></center>
19 <map name="Module__coll__map">
20 <area href="classclassbase.html" shape="rect" coords="7,106,73,128" alt="">
22 <center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classModule-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
24 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
25 <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classModule.html#a0">Module</a> ()</td></tr>
26 <tr><td> </td><td><font size=-1><em>Default constructor creates a module class.</em> <a href="#a0"></a><em></em></font><br><br></td></tr>
27 <tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classModule.html#a1">~Module</a> ()</td></tr>
28 <tr><td> </td><td><font size=-1><em>Default destructor destroys a module class.</em> <a href="#a1"></a><em></em></font><br><br></td></tr>
29 <tr><td nowrap align=right valign=top>virtual <a class="el" href="classVersion.html">Version</a> </td><td valign=bottom><a class="el" href="classModule.html#a2">GetVersion</a> ()</td></tr>
30 <tr><td> </td><td><font size=-1><em>Returns the version number of a Module.</em> <a href="#a2"></a><em></em></font><br><br></td></tr>
31 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a3">OnUserConnect</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
32 <tr><td> </td><td><font size=-1><em>Called when a user connects.</em> <a href="#a3"></a><em></em></font><br><br></td></tr>
33 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a4">OnUserQuit</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
34 <tr><td> </td><td><font size=-1><em>Called when a user quits.</em> <a href="#a4"></a><em></em></font><br><br></td></tr>
35 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a5">OnUserJoin</a> (<a class="el" href="classuserrec.html">userrec</a> *user, <a class="el" href="classchanrec.html">chanrec</a> *channel)</td></tr>
36 <tr><td> </td><td><font size=-1><em>Called when a user joins a channel.</em> <a href="#a5"></a><em></em></font><br><br></td></tr>
37 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a6">OnUserPart</a> (<a class="el" href="classuserrec.html">userrec</a> *user, <a class="el" href="classchanrec.html">chanrec</a> *channel)</td></tr>
38 <tr><td> </td><td><font size=-1><em>Called when a user parts a channel.</em> <a href="#a6"></a><em></em></font><br><br></td></tr>
39 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a7">OnPacketTransmit</a> (char *p)</td></tr>
40 <tr><td> </td><td><font size=-1><em>Called before a packet is transmitted across the irc network between two irc servers.</em> <a href="#a7"></a><em></em></font><br><br></td></tr>
41 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a8">OnPacketReceive</a> (char *p)</td></tr>
42 <tr><td> </td><td><font size=-1><em>Called after a packet is received from another irc server.</em> <a href="#a8"></a><em></em></font><br><br></td></tr>
43 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a9">OnRehash</a> ()</td></tr>
44 <tr><td> </td><td><font size=-1><em>Called on rehash.</em> <a href="#a9"></a><em></em></font><br><br></td></tr>
45 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a10">OnServerRaw</a> (std::string &raw, bool inbound, <a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
46 <tr><td> </td><td><font size=-1><em>Called when a raw command is transmitted or received.</em> <a href="#a10"></a><em></em></font><br><br></td></tr>
47 <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classModule.html#a11">OnExtendedMode</a> (<a class="el" href="classuserrec.html">userrec</a> *user, void *target, char modechar, int type, bool mode_on, <a class="el" href="modules_8h.html#a23">string_list</a> &params)</td></tr>
48 <tr><td> </td><td><font size=-1><em>Called whenever an extended mode is to be processed.</em> <a href="#a11"></a><em></em></font><br><br></td></tr>
49 <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classModule.html#a12">OnUserPreJoin</a> (<a class="el" href="classuserrec.html">userrec</a> *user, <a class="el" href="classchanrec.html">chanrec</a> *chan, const char *cname)</td></tr>
50 <tr><td> </td><td><font size=-1><em>Called whenever a user is about to join a channel, before any processing is done.</em> <a href="#a12"></a><em></em></font><br><br></td></tr>
51 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a13">OnOper</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
52 <tr><td> </td><td><font size=-1><em>Called whenever a user opers locally.</em> <a href="#a13"></a><em></em></font><br><br></td></tr>
53 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a14">OnInfo</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
54 <tr><td> </td><td><font size=-1><em>Called whenever a user types /INFO.</em> <a href="#a14"></a><em></em></font><br><br></td></tr>
55 <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classModule.html#a15">OnWhois</a> (<a class="el" href="classuserrec.html">userrec</a> *source, <a class="el" href="classuserrec.html">userrec</a> *dest)</td></tr>
56 <tr><td> </td><td><font size=-1><em>Called whenever a /WHOIS is performed on a local user.</em> <a href="#a15"></a><em></em></font><br><br></td></tr>
57 <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classModule.html#a16">OnUserPreMessage</a> (<a class="el" href="classuserrec.html">userrec</a> *user, void *dest, int target_type, std::string text)</td></tr>
58 <tr><td> </td><td><font size=-1><em>Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done.</em> <a href="#a16"></a><em></em></font><br><br></td></tr>
59 <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classModule.html#a17">OnUserPreNotice</a> (<a class="el" href="classuserrec.html">userrec</a> *user, void *dest, int target_type, std::string text)</td></tr>
60 <tr><td> </td><td><font size=-1><em>Called whenever a user is about to NOTICE A user or a channel, before any processing is done.</em> <a href="#a17"></a><em></em></font><br><br></td></tr>
61 <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classModule.html#a18">OnUserPreNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string newnick)</td></tr>
62 <tr><td> </td><td><font size=-1><em>Called before any nickchange, local or remote.</em> <a href="#a18"></a><em></em></font><br><br></td></tr>
63 <tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classModule.html#a19">OnAccessCheck</a> (<a class="el" href="classuserrec.html">userrec</a> *source, <a class="el" href="classuserrec.html">userrec</a> *dest, <a class="el" href="classchanrec.html">chanrec</a> *channel, int access_type)</td></tr>
64 <tr><td> </td><td><font size=-1><em>Called before an action which requires a channel privilage check.</em> <a href="#a19"></a><em></em></font><br><br></td></tr>
65 <tr><td nowrap align=right valign=top>virtual <a class="el" href="modules_8h.html#a23">string_list</a> </td><td valign=bottom><a class="el" href="classModule.html#a20">OnUserSync</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
66 <tr><td> </td><td><font size=-1><em>Called during a netburst to sync user data.</em> <a href="#a20"></a><em></em></font><br><br></td></tr>
67 <tr><td nowrap align=right valign=top>virtual <a class="el" href="modules_8h.html#a23">string_list</a> </td><td valign=bottom><a class="el" href="classModule.html#a21">OnChannelSync</a> (<a class="el" href="classchanrec.html">chanrec</a> *chan)</td></tr>
68 <tr><td> </td><td><font size=-1><em>Called during a netburst to sync channel data.</em> <a href="#a21"></a><em></em></font><br><br></td></tr>
70 <hr><a name="_details"></a><h2>Detailed Description</h2>
71 Base class for all InspIRCd modules This class is the base class for InspIRCd modules.
73 All modules must inherit from this class, its methods will be called when irc server events occur. class inherited from module must be instantiated by the <a class="el" href="classModuleFactory.html">ModuleFactory</a> class (see relevent section) for the plugin to be initialised.
77 Definition at line <a class="el" href="modules_8h-source.html#l00116">116</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
78 <a name="a0" doxytag="Module::Module"></a><p>
79 <table width="100%" cellpadding="2" cellspacing="0" border="0">
82 <table cellpadding="0" cellspacing="0" border="0">
84 <td class="md" nowrap valign="top"> Module::Module </td>
85 <td class="md" valign="top">( </td>
86 <td class="mdname1" valign="top" nowrap> </td>
87 <td class="md" valign="top">) </td>
88 <td class="md" nowrap></td>
95 <table cellspacing=5 cellpadding=0 border=0>
103 Default constructor creates a module class.
107 Definition at line <a class="el" href="modules_8cpp-source.html#l00285">285</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
109 <div class="fragment"><pre>00285 { }
113 <a name="a1" doxytag="Module::~Module"></a><p>
114 <table width="100%" cellpadding="2" cellspacing="0" border="0">
117 <table cellpadding="0" cellspacing="0" border="0">
119 <td class="md" nowrap valign="top"> Module::~Module </td>
120 <td class="md" valign="top">( </td>
121 <td class="mdname1" valign="top" nowrap> </td>
122 <td class="md" valign="top">) </td>
123 <td class="md" nowrap><code> [virtual]</code></td>
130 <table cellspacing=5 cellpadding=0 border=0>
138 Default destructor destroys a module class.
142 Definition at line <a class="el" href="modules_8cpp-source.html#l00286">286</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
144 <div class="fragment"><pre>00286 { }
148 <hr><h2>Member Function Documentation</h2>
149 <a name="a2" doxytag="Module::GetVersion"></a><p>
150 <table width="100%" cellpadding="2" cellspacing="0" border="0">
153 <table cellpadding="0" cellspacing="0" border="0">
155 <td class="md" nowrap valign="top"> <a class="el" href="classVersion.html">Version</a> Module::GetVersion </td>
156 <td class="md" valign="top">( </td>
157 <td class="mdname1" valign="top" nowrap> </td>
158 <td class="md" valign="top">) </td>
159 <td class="md" nowrap><code> [virtual]</code></td>
166 <table cellspacing=5 cellpadding=0 border=0>
174 Returns the version number of a Module.
176 The method should return a <a class="el" href="classVersion.html">Version</a> object with its version information assigned via <a class="el" href="classVersion.html#a0">Version::Version</a>
178 Definition at line <a class="el" href="modules_8cpp-source.html#l00297">297</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
180 <div class="fragment"><pre>00297 { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0); }
184 <a name="a19" doxytag="Module::OnAccessCheck"></a><p>
185 <table width="100%" cellpadding="2" cellspacing="0" border="0">
188 <table cellpadding="0" cellspacing="0" border="0">
190 <td class="md" nowrap valign="top"> int Module::OnAccessCheck </td>
191 <td class="md" valign="top">( </td>
192 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
193 <td class="mdname" nowrap> <em>source</em>, </td>
198 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
199 <td class="mdname" nowrap> <em>dest</em>, </td>
204 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
205 <td class="mdname" nowrap> <em>channel</em>, </td>
210 <td class="md" nowrap>int </td>
211 <td class="mdname" nowrap> <em>access_type</em></td>
215 <td class="md">) </td>
216 <td class="md" colspan="2"><code> [virtual]</code></td>
223 <table cellspacing=5 cellpadding=0 border=0>
231 Called before an action which requires a channel privilage check.
233 This function is called before many functions which check a users status on a channel, for example before opping a user, deopping a user, kicking a user, etc. There are several values for access_type which indicate for what reason access is being checked. These are:<br>
235 AC_KICK (0) - A user is being kicked<br>
236 AC_DEOP (1) - a user is being deopped<br>
237 AC_OP (2) - a user is being opped<br>
238 AC_VOICE (3) - a user is being voiced<br>
239 AC_DEVOICE (4) - a user is being devoiced<br>
240 AC_HALFOP (5) - a user is being halfopped<br>
241 AC_DEHALFOP (6) - a user is being dehalfopped<br>
242 AC_INVITE (7) - a user is being invited<br>
243 AC_GENERAL_MODE (8) - a user channel mode is being changed<br>
245 Upon returning from your function you must return either ACR_DEFAULT, to indicate the module wishes to do nothing, or ACR_DENY where approprate to deny the action, and ACR_ALLOW where appropriate to allow the action. Please note that in the case of some access checks (such as AC_GENERAL_MODE) access may be denied 'upstream' causing other checks such as AC_DEOP to not be reached. Be very careful with use of the AC_GENERAL_MODE type, as it may inadvertently override the behaviour of other modules. When the access_type is AC_GENERAL_MODE, the destination of the mode will be NULL (as it has not yet been determined).
247 Definition at line <a class="el" href="modules_8cpp-source.html#l00304">304</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
249 References <a class="el" href="modules_8h-source.html#l00027">ACR_DEFAULT</a>.
251 <div class="fragment"><pre>00304 { <span class="keywordflow">return</span> <a class="code" href="modules_8h.html#a8">ACR_DEFAULT</a>; };
255 <a name="a21" doxytag="Module::OnChannelSync"></a><p>
256 <table width="100%" cellpadding="2" cellspacing="0" border="0">
259 <table cellpadding="0" cellspacing="0" border="0">
261 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a23">string_list</a> Module::OnChannelSync </td>
262 <td class="md" valign="top">( </td>
263 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
264 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
265 <td class="md" valign="top">) </td>
266 <td class="md" nowrap><code> [virtual]</code></td>
273 <table cellspacing=5 cellpadding=0 border=0>
281 Called during a netburst to sync channel data.
283 This is called during the netburst on a per-channel basis. You should use this call to up any special channel-related things which are implemented by your module, e.g. sending listmodes. You may return multiple commands in the string_list.
285 Definition at line <a class="el" href="modules_8cpp-source.html#l00306">306</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
287 References <a class="el" href="modules_8h-source.html#l00051">string_list</a>.
289 <div class="fragment"><pre>00306 { <a class="code" href="modules_8h.html#a23">string_list</a> empty; <span class="keywordflow">return</span> empty; }
293 <a name="a11" doxytag="Module::OnExtendedMode"></a><p>
294 <table width="100%" cellpadding="2" cellspacing="0" border="0">
297 <table cellpadding="0" cellspacing="0" border="0">
299 <td class="md" nowrap valign="top"> int Module::OnExtendedMode </td>
300 <td class="md" valign="top">( </td>
301 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
302 <td class="mdname" nowrap> <em>user</em>, </td>
307 <td class="md" nowrap>void * </td>
308 <td class="mdname" nowrap> <em>target</em>, </td>
313 <td class="md" nowrap>char </td>
314 <td class="mdname" nowrap> <em>modechar</em>, </td>
319 <td class="md" nowrap>int </td>
320 <td class="mdname" nowrap> <em>type</em>, </td>
325 <td class="md" nowrap>bool </td>
326 <td class="mdname" nowrap> <em>mode_on</em>, </td>
331 <td class="md" nowrap><a class="el" href="modules_8h.html#a23">string_list</a> & </td>
332 <td class="mdname" nowrap> <em>params</em></td>
336 <td class="md">) </td>
337 <td class="md" colspan="2"><code> [virtual]</code></td>
344 <table cellspacing=5 cellpadding=0 border=0>
352 Called whenever an extended mode is to be processed.
354 The type parameter is MT_SERVER, MT_CLIENT or MT_CHANNEL, dependent on where the mode is being changed. mode_on is set when the mode is being set, in which case params contains a list of parameters for the mode as strings. If mode_on is false, the mode is being removed, and parameters may contain the parameters for the mode, dependent on wether they were defined when a mode handler was set up with <a class="el" href="classServer.html#a21">Server::AddExtendedMode</a> If the mode is a channel mode, target is a chanrec*, and if it is a user mode, target is a userrec*. You must cast this value yourself to make use of it.
356 Definition at line <a class="el" href="modules_8cpp-source.html#l00296">296</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
358 <div class="fragment"><pre>00296 { <span class="keywordflow">return</span> <span class="keyword">false</span>; }
362 <a name="a14" doxytag="Module::OnInfo"></a><p>
363 <table width="100%" cellpadding="2" cellspacing="0" border="0">
366 <table cellpadding="0" cellspacing="0" border="0">
368 <td class="md" nowrap valign="top"> void Module::OnInfo </td>
369 <td class="md" valign="top">( </td>
370 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
371 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
372 <td class="md" valign="top">) </td>
373 <td class="md" nowrap><code> [virtual]</code></td>
380 <table cellspacing=5 cellpadding=0 border=0>
388 Called whenever a user types /INFO.
390 The userrec will contain the information of the user who typed the command. Modules may use this method to output their own credits in /INFO (which is the ircd's version of an about box). It is purposefully not possible to modify any info that has already been output, or halt the list. You must write a 371 numeric to the user, containing your info in the following format:<p>
393 Definition at line <a class="el" href="modules_8cpp-source.html#l00299">299</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
395 <div class="fragment"><pre>00299 { };
399 <a name="a13" doxytag="Module::OnOper"></a><p>
400 <table width="100%" cellpadding="2" cellspacing="0" border="0">
403 <table cellpadding="0" cellspacing="0" border="0">
405 <td class="md" nowrap valign="top"> void Module::OnOper </td>
406 <td class="md" valign="top">( </td>
407 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
408 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
409 <td class="md" valign="top">) </td>
410 <td class="md" nowrap><code> [virtual]</code></td>
417 <table cellspacing=5 cellpadding=0 border=0>
425 Called whenever a user opers locally.
427 The userrec will contain the oper mode 'o' as this function is called after any modifications are made to the user's structure by the core.
429 Definition at line <a class="el" href="modules_8cpp-source.html#l00298">298</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
431 <div class="fragment"><pre>00298 { };
435 <a name="a8" doxytag="Module::OnPacketReceive"></a><p>
436 <table width="100%" cellpadding="2" cellspacing="0" border="0">
439 <table cellpadding="0" cellspacing="0" border="0">
441 <td class="md" nowrap valign="top"> void Module::OnPacketReceive </td>
442 <td class="md" valign="top">( </td>
443 <td class="md" nowrap valign="top">char * </td>
444 <td class="mdname1" valign="top" nowrap> <em>p</em> </td>
445 <td class="md" valign="top">) </td>
446 <td class="md" nowrap><code> [virtual]</code></td>
453 <table cellspacing=5 cellpadding=0 border=0>
461 Called after a packet is received from another irc server.
463 The packet is represented as a char*, as it should be regarded as a buffer, and not a string. This allows you to easily represent it in the correct ways to implement encryption, compression, digital signatures and anything else you may want to add. This should be regarded as a pre-processor and will be called immediately after the packet is received but before any other operations with the core of the ircd.
465 Definition at line <a class="el" href="modules_8cpp-source.html#l00292">292</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
467 <div class="fragment"><pre>00292 { }
471 <a name="a7" doxytag="Module::OnPacketTransmit"></a><p>
472 <table width="100%" cellpadding="2" cellspacing="0" border="0">
475 <table cellpadding="0" cellspacing="0" border="0">
477 <td class="md" nowrap valign="top"> void Module::OnPacketTransmit </td>
478 <td class="md" valign="top">( </td>
479 <td class="md" nowrap valign="top">char * </td>
480 <td class="mdname1" valign="top" nowrap> <em>p</em> </td>
481 <td class="md" valign="top">) </td>
482 <td class="md" nowrap><code> [virtual]</code></td>
489 <table cellspacing=5 cellpadding=0 border=0>
497 Called before a packet is transmitted across the irc network between two irc servers.
499 The packet is represented as a char*, as it should be regarded as a buffer, and not a string. This allows you to easily represent it in the correct ways to implement encryption, compression, digital signatures and anything else you may want to add. This should be regarded as a pre-processor and will be called before ANY other operations within the ircd core program.
501 Definition at line <a class="el" href="modules_8cpp-source.html#l00291">291</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
503 <div class="fragment"><pre>00291 { }
507 <a name="a9" doxytag="Module::OnRehash"></a><p>
508 <table width="100%" cellpadding="2" cellspacing="0" border="0">
511 <table cellpadding="0" cellspacing="0" border="0">
513 <td class="md" nowrap valign="top"> void Module::OnRehash </td>
514 <td class="md" valign="top">( </td>
515 <td class="mdname1" valign="top" nowrap> </td>
516 <td class="md" valign="top">) </td>
517 <td class="md" nowrap><code> [virtual]</code></td>
524 <table cellspacing=5 cellpadding=0 border=0>
534 This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application.
536 Definition at line <a class="el" href="modules_8cpp-source.html#l00293">293</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
538 <div class="fragment"><pre>00293 { }
542 <a name="a10" doxytag="Module::OnServerRaw"></a><p>
543 <table width="100%" cellpadding="2" cellspacing="0" border="0">
546 <table cellpadding="0" cellspacing="0" border="0">
548 <td class="md" nowrap valign="top"> void Module::OnServerRaw </td>
549 <td class="md" valign="top">( </td>
550 <td class="md" nowrap valign="top">std::string & </td>
551 <td class="mdname" nowrap> <em>raw</em>, </td>
556 <td class="md" nowrap>bool </td>
557 <td class="mdname" nowrap> <em>inbound</em>, </td>
562 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
563 <td class="mdname" nowrap> <em>user</em></td>
567 <td class="md">) </td>
568 <td class="md" colspan="2"><code> [virtual]</code></td>
575 <table cellspacing=5 cellpadding=0 border=0>
583 Called when a raw command is transmitted or received.
585 This method is the lowest level of handler available to a module. It will be called with raw data which is passing through a connected socket. If you wish, you may munge this data by changing the string parameter "raw". If you do this, after your function exits it will immediately be cut down to 510 characters plus a carriage return and linefeed. For INBOUND messages only (where inbound is set to true) the value of user will be the userrec of the connection sending the data. This is not possible for outbound data because the data may be being routed to multiple targets.
587 Definition at line <a class="el" href="modules_8cpp-source.html#l00294">294</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
589 <div class="fragment"><pre>00294 { }
593 <a name="a3" doxytag="Module::OnUserConnect"></a><p>
594 <table width="100%" cellpadding="2" cellspacing="0" border="0">
597 <table cellpadding="0" cellspacing="0" border="0">
599 <td class="md" nowrap valign="top"> void Module::OnUserConnect </td>
600 <td class="md" valign="top">( </td>
601 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
602 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
603 <td class="md" valign="top">) </td>
604 <td class="md" nowrap><code> [virtual]</code></td>
611 <table cellspacing=5 cellpadding=0 border=0>
619 Called when a user connects.
621 The details of the connecting user are available to you in the parameter userrec *user
623 Definition at line <a class="el" href="modules_8cpp-source.html#l00287">287</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
625 <div class="fragment"><pre>00287 { }
629 <a name="a5" doxytag="Module::OnUserJoin"></a><p>
630 <table width="100%" cellpadding="2" cellspacing="0" border="0">
633 <table cellpadding="0" cellspacing="0" border="0">
635 <td class="md" nowrap valign="top"> void Module::OnUserJoin </td>
636 <td class="md" valign="top">( </td>
637 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
638 <td class="mdname" nowrap> <em>user</em>, </td>
643 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
644 <td class="mdname" nowrap> <em>channel</em></td>
648 <td class="md">) </td>
649 <td class="md" colspan="2"><code> [virtual]</code></td>
656 <table cellspacing=5 cellpadding=0 border=0>
664 Called when a user joins a channel.
666 The details of the joining user are available to you in the parameter userrec *user, and the details of the channel they have joined is available in the variable chanrec *channel
668 Definition at line <a class="el" href="modules_8cpp-source.html#l00289">289</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
670 <div class="fragment"><pre>00289 { }
674 <a name="a6" doxytag="Module::OnUserPart"></a><p>
675 <table width="100%" cellpadding="2" cellspacing="0" border="0">
678 <table cellpadding="0" cellspacing="0" border="0">
680 <td class="md" nowrap valign="top"> void Module::OnUserPart </td>
681 <td class="md" valign="top">( </td>
682 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
683 <td class="mdname" nowrap> <em>user</em>, </td>
688 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
689 <td class="mdname" nowrap> <em>channel</em></td>
693 <td class="md">) </td>
694 <td class="md" colspan="2"><code> [virtual]</code></td>
701 <table cellspacing=5 cellpadding=0 border=0>
709 Called when a user parts a channel.
711 The details of the leaving user are available to you in the parameter userrec *user, and the details of the channel they have left is available in the variable chanrec *channel
713 Definition at line <a class="el" href="modules_8cpp-source.html#l00290">290</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
715 <div class="fragment"><pre>00290 { }
719 <a name="a12" doxytag="Module::OnUserPreJoin"></a><p>
720 <table width="100%" cellpadding="2" cellspacing="0" border="0">
723 <table cellpadding="0" cellspacing="0" border="0">
725 <td class="md" nowrap valign="top"> int Module::OnUserPreJoin </td>
726 <td class="md" valign="top">( </td>
727 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
728 <td class="mdname" nowrap> <em>user</em>, </td>
733 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
734 <td class="mdname" nowrap> <em>chan</em>, </td>
739 <td class="md" nowrap>const char * </td>
740 <td class="mdname" nowrap> <em>cname</em></td>
744 <td class="md">) </td>
745 <td class="md" colspan="2"><code> [virtual]</code></td>
752 <table cellspacing=5 cellpadding=0 border=0>
760 Called whenever a user is about to join a channel, before any processing is done.
762 Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to mimic +b, +k, +l etc.<p>
764 If the user joins a NEW channel which does not exist yet, OnUserPreJoin will be called BEFORE the channel record is created. This will cause chanrec* chan to be NULL. There is very little you can do in form of processing on the actual channel record at this point, however the channel NAME will still be passed in char* cname, so that you could for example implement a channel blacklist or whitelist, etc.
766 Definition at line <a class="el" href="modules_8cpp-source.html#l00295">295</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
768 <div class="fragment"><pre>00295 { <span class="keywordflow">return</span> 0; }
772 <a name="a16" doxytag="Module::OnUserPreMessage"></a><p>
773 <table width="100%" cellpadding="2" cellspacing="0" border="0">
776 <table cellpadding="0" cellspacing="0" border="0">
778 <td class="md" nowrap valign="top"> int Module::OnUserPreMessage </td>
779 <td class="md" valign="top">( </td>
780 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
781 <td class="mdname" nowrap> <em>user</em>, </td>
786 <td class="md" nowrap>void * </td>
787 <td class="mdname" nowrap> <em>dest</em>, </td>
792 <td class="md" nowrap>int </td>
793 <td class="mdname" nowrap> <em>target_type</em>, </td>
798 <td class="md" nowrap>std::string </td>
799 <td class="mdname" nowrap> <em>text</em></td>
803 <td class="md">) </td>
804 <td class="md" colspan="2"><code> [virtual]</code></td>
811 <table cellspacing=5 cellpadding=0 border=0>
819 Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done.
821 Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details of where the message is destined to be sent.
823 Definition at line <a class="el" href="modules_8cpp-source.html#l00301">301</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
825 <div class="fragment"><pre>00301 { <span class="keywordflow">return</span> 0; };
829 <a name="a18" doxytag="Module::OnUserPreNick"></a><p>
830 <table width="100%" cellpadding="2" cellspacing="0" border="0">
833 <table cellpadding="0" cellspacing="0" border="0">
835 <td class="md" nowrap valign="top"> int Module::OnUserPreNick </td>
836 <td class="md" valign="top">( </td>
837 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
838 <td class="mdname" nowrap> <em>user</em>, </td>
843 <td class="md" nowrap>std::string </td>
844 <td class="mdname" nowrap> <em>newnick</em></td>
848 <td class="md">) </td>
849 <td class="md" colspan="2"><code> [virtual]</code></td>
856 <table cellspacing=5 cellpadding=0 border=0>
864 Called before any nickchange, local or remote.
866 This can be used to implement Q-lines etc. Please note that although you can see remote nickchanges through this function, you should NOT make any changes to the userrec if the user is a remote user as this may cause a desnyc. check user->server before taking any action (including returning nonzero from the method). If your method returns nonzero, the nickchange is silently forbidden, and it is down to your module to generate some meaninful output.
868 Definition at line <a class="el" href="modules_8cpp-source.html#l00303">303</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
870 <div class="fragment"><pre>00303 { <span class="keywordflow">return</span> 0; };
874 <a name="a17" doxytag="Module::OnUserPreNotice"></a><p>
875 <table width="100%" cellpadding="2" cellspacing="0" border="0">
878 <table cellpadding="0" cellspacing="0" border="0">
880 <td class="md" nowrap valign="top"> int Module::OnUserPreNotice </td>
881 <td class="md" valign="top">( </td>
882 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
883 <td class="mdname" nowrap> <em>user</em>, </td>
888 <td class="md" nowrap>void * </td>
889 <td class="mdname" nowrap> <em>dest</em>, </td>
894 <td class="md" nowrap>int </td>
895 <td class="mdname" nowrap> <em>target_type</em>, </td>
900 <td class="md" nowrap>std::string </td>
901 <td class="mdname" nowrap> <em>text</em></td>
905 <td class="md">) </td>
906 <td class="md" colspan="2"><code> [virtual]</code></td>
913 <table cellspacing=5 cellpadding=0 border=0>
921 Called whenever a user is about to NOTICE A user or a channel, before any processing is done.
923 Returning any nonzero value from this function stops the process immediately, causing no output to be sent to the user by the core. If you do this you must produce your own numerics, notices etc. This is useful for modules which may want to filter or redirect messages. target_type can be one of TYPE_USER or TYPE_CHANNEL. If the target_type value is a user, you must cast dest to a userrec* otherwise you must cast it to a chanrec*, this is the details of where the message is destined to be sent.
925 Definition at line <a class="el" href="modules_8cpp-source.html#l00302">302</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
927 <div class="fragment"><pre>00302 { <span class="keywordflow">return</span> 0; };
931 <a name="a4" doxytag="Module::OnUserQuit"></a><p>
932 <table width="100%" cellpadding="2" cellspacing="0" border="0">
935 <table cellpadding="0" cellspacing="0" border="0">
937 <td class="md" nowrap valign="top"> void Module::OnUserQuit </td>
938 <td class="md" valign="top">( </td>
939 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
940 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
941 <td class="md" valign="top">) </td>
942 <td class="md" nowrap><code> [virtual]</code></td>
949 <table cellspacing=5 cellpadding=0 border=0>
957 Called when a user quits.
959 The details of the exiting user are available to you in the parameter userrec *user
961 Definition at line <a class="el" href="modules_8cpp-source.html#l00288">288</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
963 <div class="fragment"><pre>00288 { }
967 <a name="a20" doxytag="Module::OnUserSync"></a><p>
968 <table width="100%" cellpadding="2" cellspacing="0" border="0">
971 <table cellpadding="0" cellspacing="0" border="0">
973 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a23">string_list</a> Module::OnUserSync </td>
974 <td class="md" valign="top">( </td>
975 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
976 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
977 <td class="md" valign="top">) </td>
978 <td class="md" nowrap><code> [virtual]</code></td>
985 <table cellspacing=5 cellpadding=0 border=0>
993 Called during a netburst to sync user data.
995 This is called during the netburst on a per-user basis. You should use this call to up any special user-related things which are implemented by your module, e.g. sending listmodes. You may return multiple commands in the string_list.
997 Definition at line <a class="el" href="modules_8cpp-source.html#l00305">305</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
999 References <a class="el" href="modules_8h-source.html#l00051">string_list</a>.
1001 <div class="fragment"><pre>00305 { <a class="code" href="modules_8h.html#a23">string_list</a> empty; <span class="keywordflow">return</span> empty; }
1005 <a name="a15" doxytag="Module::OnWhois"></a><p>
1006 <table width="100%" cellpadding="2" cellspacing="0" border="0">
1009 <table cellpadding="0" cellspacing="0" border="0">
1011 <td class="md" nowrap valign="top"> void Module::OnWhois </td>
1012 <td class="md" valign="top">( </td>
1013 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1014 <td class="mdname" nowrap> <em>source</em>, </td>
1019 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1020 <td class="mdname" nowrap> <em>dest</em></td>
1024 <td class="md">) </td>
1025 <td class="md" colspan="2"><code> [virtual]</code></td>
1032 <table cellspacing=5 cellpadding=0 border=0>
1040 Called whenever a /WHOIS is performed on a local user.
1042 The source parameter contains the details of the user who issued the WHOIS command, and the dest parameter contains the information of the user they are whoising.
1044 Definition at line <a class="el" href="modules_8cpp-source.html#l00300">300</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1046 <div class="fragment"><pre>00300 { };
1050 <hr>The documentation for this class was generated from the following files:<ul>
1051 <li><a class="el" href="modules_8h-source.html">modules.h</a><li><a class="el" href="modules_8cpp-source.html">modules.cpp</a></ul>
1052 <hr><address style="align: right;"><small>Generated on Sat May 1 17:50:31 2004 for InspIRCd by
1053 <a href="http://www.doxygen.org/index.html">
1054 <img src="doxygen.png" alt="doxygen" align="middle" border=0
1055 width=110 height=53></a>1.3-rc3 </small></address>