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="doxygen.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="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">Module::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">Module::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)</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 bool </td><td valign=bottom><a class="el" href="classModule.html#a11">OnExtendedMode</a> (<a class="el" href="classuserrec.html">userrec</a> *user, <a class="el" href="classchanrec.html">chanrec</a> *chan, char modechar, int type, bool mode_on, <a class="el" href="modules_8h.html#a10">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>
50 <hr><a name="_details"></a><h2>Detailed Description</h2>
51 Base class for all InspIRCd modules This class is the base class for InspIRCd modules.
53 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.
57 Definition at line <a class="el" href="modules_8h-source.html#l00072">72</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
58 <a name="a0" doxytag="Module::Module"></a><p>
59 <table width="100%" cellpadding="2" cellspacing="0" border="0">
62 <table cellpadding="0" cellspacing="0" border="0">
64 <td class="md" nowrap valign="top"> Module::Module </td>
65 <td class="md" valign="top">( </td>
66 <td class="mdname1" valign="top" nowrap> </td>
67 <td class="md" valign="top">) </td>
68 <td class="md" nowrap></td>
75 <table cellspacing=5 cellpadding=0 border=0>
83 Default constructor creates a module class.
87 Definition at line <a class="el" href="modules_8cpp-source.html#l00088">88</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
89 <div class="fragment"><pre>00088 { }
93 <a name="a1" doxytag="Module::~Module"></a><p>
94 <table width="100%" cellpadding="2" cellspacing="0" border="0">
97 <table cellpadding="0" cellspacing="0" border="0">
99 <td class="md" nowrap valign="top"> Module::~Module </td>
100 <td class="md" valign="top">( </td>
101 <td class="mdname1" valign="top" nowrap> </td>
102 <td class="md" valign="top">) </td>
103 <td class="md" nowrap><code> [virtual]</code></td>
110 <table cellspacing=5 cellpadding=0 border=0>
118 Default destructor destroys a module class.
122 Definition at line <a class="el" href="modules_8cpp-source.html#l00089">89</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
124 <div class="fragment"><pre>00089 { }
128 <hr><h2>Member Function Documentation</h2>
129 <a name="a2" doxytag="Module::GetVersion"></a><p>
130 <table width="100%" cellpadding="2" cellspacing="0" border="0">
133 <table cellpadding="0" cellspacing="0" border="0">
135 <td class="md" nowrap valign="top"> <a class="el" href="classVersion.html">Version</a> Module::GetVersion </td>
136 <td class="md" valign="top">( </td>
137 <td class="mdname1" valign="top" nowrap> </td>
138 <td class="md" valign="top">) </td>
139 <td class="md" nowrap><code> [virtual]</code></td>
146 <table cellspacing=5 cellpadding=0 border=0>
154 Returns the version number of a Module.
156 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>
158 Definition at line <a class="el" href="modules_8cpp-source.html#l00099">99</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
160 <div class="fragment"><pre>00099 { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0); }
164 <a name="a8" doxytag="Module::Module::OnPacketReceive"></a><p>
165 <table width="100%" cellpadding="2" cellspacing="0" border="0">
168 <table cellpadding="0" cellspacing="0" border="0">
170 <td class="md" nowrap valign="top"> virtual void Module::Module::OnPacketReceive </td>
171 <td class="md" valign="top">( </td>
172 <td class="md" nowrap valign="top">char * </td>
173 <td class="mdname1" valign="top" nowrap> <em>p</em> </td>
174 <td class="md" valign="top">) </td>
175 <td class="md" nowrap><code> [virtual]</code></td>
182 <table cellspacing=5 cellpadding=0 border=0>
190 Called after a packet is received from another irc server.
192 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. </td>
195 <a name="a7" doxytag="Module::Module::OnPacketTransmit"></a><p>
196 <table width="100%" cellpadding="2" cellspacing="0" border="0">
199 <table cellpadding="0" cellspacing="0" border="0">
201 <td class="md" nowrap valign="top"> virtual void Module::Module::OnPacketTransmit </td>
202 <td class="md" valign="top">( </td>
203 <td class="md" nowrap valign="top">char * </td>
204 <td class="mdname1" valign="top" nowrap> <em>p</em> </td>
205 <td class="md" valign="top">) </td>
206 <td class="md" nowrap><code> [virtual]</code></td>
213 <table cellspacing=5 cellpadding=0 border=0>
221 Called before a packet is transmitted across the irc network between two irc servers.
223 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. </td>
226 <a name="a11" doxytag="Module::OnExtendedMode"></a><p>
227 <table width="100%" cellpadding="2" cellspacing="0" border="0">
230 <table cellpadding="0" cellspacing="0" border="0">
232 <td class="md" nowrap valign="top"> bool Module::OnExtendedMode </td>
233 <td class="md" valign="top">( </td>
234 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
235 <td class="mdname" nowrap> <em>user</em>, </td>
240 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
241 <td class="mdname" nowrap> <em>chan</em>, </td>
246 <td class="md" nowrap>char </td>
247 <td class="mdname" nowrap> <em>modechar</em>, </td>
252 <td class="md" nowrap>int </td>
253 <td class="mdname" nowrap> <em>type</em>, </td>
258 <td class="md" nowrap>bool </td>
259 <td class="mdname" nowrap> <em>mode_on</em>, </td>
264 <td class="md" nowrap><a class="el" href="modules_8h.html#a10">string_list</a> & </td>
265 <td class="mdname" nowrap> <em>params</em></td>
269 <td class="md">) </td>
270 <td class="md" colspan="2"><code> [virtual]</code></td>
277 <table cellspacing=5 cellpadding=0 border=0>
285 Called whenever an extended mode is to be processed.
287 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#a19">Server::AddExtendedMode</a> If the mode is not a channel mode, chanrec* chan is null, and should not be read from or written to.
289 Definition at line <a class="el" href="modules_8cpp-source.html#l00098">98</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
291 <div class="fragment"><pre>00098 { }
295 <a name="a9" doxytag="Module::OnRehash"></a><p>
296 <table width="100%" cellpadding="2" cellspacing="0" border="0">
299 <table cellpadding="0" cellspacing="0" border="0">
301 <td class="md" nowrap valign="top"> void Module::OnRehash </td>
302 <td class="md" valign="top">( </td>
303 <td class="mdname1" valign="top" nowrap> </td>
304 <td class="md" valign="top">) </td>
305 <td class="md" nowrap><code> [virtual]</code></td>
312 <table cellspacing=5 cellpadding=0 border=0>
322 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.
324 Definition at line <a class="el" href="modules_8cpp-source.html#l00096">96</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
326 <div class="fragment"><pre>00096 { }
330 <a name="a10" doxytag="Module::OnServerRaw"></a><p>
331 <table width="100%" cellpadding="2" cellspacing="0" border="0">
334 <table cellpadding="0" cellspacing="0" border="0">
336 <td class="md" nowrap valign="top"> void Module::OnServerRaw </td>
337 <td class="md" valign="top">( </td>
338 <td class="md" nowrap valign="top">std::string & </td>
339 <td class="mdname" nowrap> <em>raw</em>, </td>
344 <td class="md" nowrap>bool </td>
345 <td class="mdname" nowrap> <em>inbound</em></td>
349 <td class="md">) </td>
350 <td class="md" colspan="2"><code> [virtual]</code></td>
357 <table cellspacing=5 cellpadding=0 border=0>
365 Called when a raw command is transmitted or received.
367 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.
369 Definition at line <a class="el" href="modules_8cpp-source.html#l00097">97</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
371 <div class="fragment"><pre>00097 { }
375 <a name="a3" doxytag="Module::OnUserConnect"></a><p>
376 <table width="100%" cellpadding="2" cellspacing="0" border="0">
379 <table cellpadding="0" cellspacing="0" border="0">
381 <td class="md" nowrap valign="top"> void Module::OnUserConnect </td>
382 <td class="md" valign="top">( </td>
383 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
384 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
385 <td class="md" valign="top">) </td>
386 <td class="md" nowrap><code> [virtual]</code></td>
393 <table cellspacing=5 cellpadding=0 border=0>
401 Called when a user connects.
403 The details of the connecting user are available to you in the parameter userrec *user
405 Definition at line <a class="el" href="modules_8cpp-source.html#l00090">90</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
407 <div class="fragment"><pre>00090 { }
411 <a name="a5" doxytag="Module::OnUserJoin"></a><p>
412 <table width="100%" cellpadding="2" cellspacing="0" border="0">
415 <table cellpadding="0" cellspacing="0" border="0">
417 <td class="md" nowrap valign="top"> void Module::OnUserJoin </td>
418 <td class="md" valign="top">( </td>
419 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
420 <td class="mdname" nowrap> <em>user</em>, </td>
425 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
426 <td class="mdname" nowrap> <em>channel</em></td>
430 <td class="md">) </td>
431 <td class="md" colspan="2"><code> [virtual]</code></td>
438 <table cellspacing=5 cellpadding=0 border=0>
446 Called when a user joins a channel.
448 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
450 Definition at line <a class="el" href="modules_8cpp-source.html#l00092">92</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
452 <div class="fragment"><pre>00092 { }
456 <a name="a6" doxytag="Module::OnUserPart"></a><p>
457 <table width="100%" cellpadding="2" cellspacing="0" border="0">
460 <table cellpadding="0" cellspacing="0" border="0">
462 <td class="md" nowrap valign="top"> void Module::OnUserPart </td>
463 <td class="md" valign="top">( </td>
464 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
465 <td class="mdname" nowrap> <em>user</em>, </td>
470 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
471 <td class="mdname" nowrap> <em>channel</em></td>
475 <td class="md">) </td>
476 <td class="md" colspan="2"><code> [virtual]</code></td>
483 <table cellspacing=5 cellpadding=0 border=0>
491 Called when a user parts a channel.
493 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
495 Definition at line <a class="el" href="modules_8cpp-source.html#l00093">93</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
497 <div class="fragment"><pre>00093 { }
501 <a name="a4" doxytag="Module::OnUserQuit"></a><p>
502 <table width="100%" cellpadding="2" cellspacing="0" border="0">
505 <table cellpadding="0" cellspacing="0" border="0">
507 <td class="md" nowrap valign="top"> void Module::OnUserQuit </td>
508 <td class="md" valign="top">( </td>
509 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
510 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
511 <td class="md" valign="top">) </td>
512 <td class="md" nowrap><code> [virtual]</code></td>
519 <table cellspacing=5 cellpadding=0 border=0>
527 Called when a user quits.
529 The details of the exiting user are available to you in the parameter userrec *user
531 Definition at line <a class="el" href="modules_8cpp-source.html#l00091">91</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
533 <div class="fragment"><pre>00091 { }
537 <hr>The documentation for this class was generated from the following files:<ul>
538 <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>
539 <hr><address style="align: right;"><small>Generated on Fri Apr 2 14:46:18 2004 for InspIRCd by
540 <a href="http://www.doxygen.org/index.html">
541 <img src="doxygen.png" alt="doxygen" align="middle" border=0
542 width=110 height=53></a>1.3-rc3 </small></address>