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>InspIRCd: Module class Reference</title>
4 <link href="inspircd.css" rel="stylesheet" type="text/css">
6 <!-- Generated by Doxygen 1.3.3 -->
7 <div class="qindex"><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></div>
8 <h1>Module Class Reference</h1>Base class for all InspIRCd modules This class is the base class for InspIRCd modules.
9 <a href="#_details">More...</a>
11 <code>#include <<a class="el" href="modules_8h-source.html">modules.h</a>></code>
13 Inherits <a class="el" href="classclassbase.html">classbase</a>.
15 <a href="classModule-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
17 <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a0">Module</a> ()</td></tr>
20 <tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor creates a module class. </em> <a href="#a0"></a><em><br><br></td></tr>
21 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a1">~Module</a> ()</td></tr>
23 <tr><td class="mdescLeft"> </td><td class="mdescRight">Default destructor destroys a module class. </em> <a href="#a1"></a><em><br><br></td></tr>
24 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="classVersion.html">Version</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a2">GetVersion</a> ()</td></tr>
26 <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the version number of a Module. </em> <a href="#a2"></a><em><br><br></td></tr>
27 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a3">OnUserConnect</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
29 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called when a user connects. </em> <a href="#a3"></a><em><br><br></td></tr>
30 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a4">OnUserQuit</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
32 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called when a user quits. </em> <a href="#a4"></a><em><br><br></td></tr>
33 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" 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>
35 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called when a user joins a channel. </em> <a href="#a5"></a><em><br><br></td></tr>
36 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" 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 class="mdescLeft"> </td><td class="mdescRight">Called when a user parts a channel. </em> <a href="#a6"></a><em><br><br></td></tr>
39 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a7">OnPacketTransmit</a> (char *p)</td></tr>
41 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called before a packet is transmitted across the irc network between two irc servers. </em> <a href="#a7"></a><em><br><br></td></tr>
42 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a8">OnPacketReceive</a> (char *p)</td></tr>
44 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called after a packet is received from another irc server. </em> <a href="#a8"></a><em><br><br></td></tr>
45 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a9">OnRehash</a> ()</td></tr>
47 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called on rehash. </em> <a href="#a9"></a><em><br><br></td></tr>
48 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" 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>
50 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called when a raw command is transmitted or received. </em> <a href="#a10"></a><em><br><br></td></tr>
51 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" 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#a27">string_list</a> &params)</td></tr>
53 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever an extended mode is to be processed. </em> <a href="#a11"></a><em><br><br></td></tr>
54 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" 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>
56 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever a user is about to join a channel, before any processing is done. </em> <a href="#a12"></a><em><br><br></td></tr>
57 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a13">OnOper</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
59 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever a user opers locally. </em> <a href="#a13"></a><em><br><br></td></tr>
60 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a14">OnInfo</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
62 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever a user types /INFO. </em> <a href="#a14"></a><em><br><br></td></tr>
63 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" 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>
65 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever a /WHOIS is performed on a local user. </em> <a href="#a15"></a><em><br><br></td></tr>
66 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a16">OnUserPreInvite</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)</td></tr>
68 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever a user is about to invite another user into a channel, before any processing is done. </em> <a href="#a16"></a><em><br><br></td></tr>
69 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a17">OnUserPreMessage</a> (<a class="el" href="classuserrec.html">userrec</a> *user, void *dest, int target_type, std::string &text)</td></tr>
71 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. </em> <a href="#a17"></a><em><br><br></td></tr>
72 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a18">OnUserPreNotice</a> (<a class="el" href="classuserrec.html">userrec</a> *user, void *dest, int target_type, std::string &text)</td></tr>
74 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called whenever a user is about to NOTICE A user or a channel, before any processing is done. </em> <a href="#a18"></a><em><br><br></td></tr>
75 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a19">OnUserPreNick</a> (<a class="el" href="classuserrec.html">userrec</a> *user, std::string newnick)</td></tr>
77 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called before any nickchange, local or remote. </em> <a href="#a19"></a><em><br><br></td></tr>
78 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual int </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a20">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>
80 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called before an action which requires a channel privilage check. </em> <a href="#a20"></a><em><br><br></td></tr>
81 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="modules_8h.html#a27">string_list</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a21">OnUserSync</a> (<a class="el" href="classuserrec.html">userrec</a> *user)</td></tr>
83 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called during a netburst to sync user data. </em> <a href="#a21"></a><em><br><br></td></tr>
84 <tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="modules_8h.html#a27">string_list</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classModule.html#a22">OnChannelSync</a> (<a class="el" href="classchanrec.html">chanrec</a> *chan)</td></tr>
86 <tr><td class="mdescLeft"> </td><td class="mdescRight">Called during a netburst to sync channel data. </em> <a href="#a22"></a><em><br><br></td></tr>
88 <hr><a name="_details"></a><h2>Detailed Description</h2>
89 Base class for all InspIRCd modules This class is the base class for InspIRCd modules.
91 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.
95 Definition at line <a class="el" href="modules_8h-source.html#l00126">126</a> of file <a class="el" href="modules_8h-source.html">modules.h</a>.<hr><h2>Constructor & Destructor Documentation</h2>
96 <a name="a0" doxytag="Module::Module"></a><p>
97 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
100 <table cellpadding="0" cellspacing="0" border="0">
102 <td class="md" nowrap valign="top"> Module::Module </td>
103 <td class="md" valign="top">( </td>
104 <td class="mdname1" valign="top" nowrap> </td>
105 <td class="md" valign="top"> ) </td>
106 <td class="md" nowrap></td>
113 <table cellspacing=5 cellpadding=0 border=0>
121 Default constructor creates a module class.
125 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>.
127 <div class="fragment"><pre>00297 { }
131 <a name="a1" doxytag="Module::~Module"></a><p>
132 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
135 <table cellpadding="0" cellspacing="0" border="0">
137 <td class="md" nowrap valign="top"> Module::~<a class="el" href="classModule.html">Module</a> </td>
138 <td class="md" valign="top">( </td>
139 <td class="mdname1" valign="top" nowrap> </td>
140 <td class="md" valign="top"> ) </td>
141 <td class="md" nowrap><code> [virtual]</code></td>
148 <table cellspacing=5 cellpadding=0 border=0>
156 Default destructor destroys a module class.
160 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>.
162 <div class="fragment"><pre>00298 { }
166 <hr><h2>Member Function Documentation</h2>
167 <a name="a2" doxytag="Module::GetVersion"></a><p>
168 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
171 <table cellpadding="0" cellspacing="0" border="0">
173 <td class="md" nowrap valign="top"> <a class="el" href="classVersion.html">Version</a> Module::GetVersion </td>
174 <td class="md" valign="top">( </td>
175 <td class="mdname1" valign="top" nowrap> </td>
176 <td class="md" valign="top"> ) </td>
177 <td class="md" nowrap><code> [virtual]</code></td>
184 <table cellspacing=5 cellpadding=0 border=0>
192 Returns the version number of a Module.
194 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>
196 Definition at line <a class="el" href="modules_8cpp-source.html#l00309">309</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
198 <div class="fragment"><pre>00309 { <span class="keywordflow">return</span> <a class="code" href="classVersion.html">Version</a>(1,0,0,0); }
202 <a name="a20" doxytag="Module::OnAccessCheck"></a><p>
203 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
206 <table cellpadding="0" cellspacing="0" border="0">
208 <td class="md" nowrap valign="top"> int Module::OnAccessCheck </td>
209 <td class="md" valign="top">( </td>
210 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
211 <td class="mdname" nowrap> <em>source</em>, </td>
216 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
217 <td class="mdname" nowrap> <em>dest</em>, </td>
222 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
223 <td class="mdname" nowrap> <em>channel</em>, </td>
228 <td class="md" nowrap>int </td>
229 <td class="mdname" nowrap> <em>access_type</em></td>
233 <td class="md">) </td>
234 <td class="md" colspan="2"><code> [virtual]</code></td>
241 <table cellspacing=5 cellpadding=0 border=0>
249 Called before an action which requires a channel privilage check.
251 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>
253 AC_KICK (0) - A user is being kicked<br>
254 AC_DEOP (1) - a user is being deopped<br>
255 AC_OP (2) - a user is being opped<br>
256 AC_VOICE (3) - a user is being voiced<br>
257 AC_DEVOICE (4) - a user is being devoiced<br>
258 AC_HALFOP (5) - a user is being halfopped<br>
259 AC_DEHALFOP (6) - a user is being dehalfopped<br>
260 AC_INVITE (7) - a user is being invited<br>
261 AC_GENERAL_MODE (8) - a user channel mode is being changed<br>
263 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).
265 Definition at line <a class="el" href="modules_8cpp-source.html#l00317">317</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
267 References <a class="el" href="modules_8h-source.html#l00037">ACR_DEFAULT</a>.
269 <div class="fragment"><pre>00317 { <span class="keywordflow">return</span> <a class="code" href="modules_8h.html#a8">ACR_DEFAULT</a>; };
273 <a name="a22" doxytag="Module::OnChannelSync"></a><p>
274 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
277 <table cellpadding="0" cellspacing="0" border="0">
279 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a27">string_list</a> Module::OnChannelSync </td>
280 <td class="md" valign="top">( </td>
281 <td class="md" nowrap valign="top"><a class="el" href="classchanrec.html">chanrec</a> * </td>
282 <td class="mdname1" valign="top" nowrap> <em>chan</em> </td>
283 <td class="md" valign="top"> ) </td>
284 <td class="md" nowrap><code> [virtual]</code></td>
291 <table cellspacing=5 cellpadding=0 border=0>
299 Called during a netburst to sync channel data.
301 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.
303 Definition at line <a class="el" href="modules_8cpp-source.html#l00319">319</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
305 References <a class="el" href="modules_8h-source.html#l00061">string_list</a>.
307 <div class="fragment"><pre>00319 { <a class="code" href="modules_8h.html#a27">string_list</a> empty; <span class="keywordflow">return</span> empty; }
311 <a name="a11" doxytag="Module::OnExtendedMode"></a><p>
312 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
315 <table cellpadding="0" cellspacing="0" border="0">
317 <td class="md" nowrap valign="top"> int Module::OnExtendedMode </td>
318 <td class="md" valign="top">( </td>
319 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
320 <td class="mdname" nowrap> <em>user</em>, </td>
325 <td class="md" nowrap>void * </td>
326 <td class="mdname" nowrap> <em>target</em>, </td>
331 <td class="md" nowrap>char </td>
332 <td class="mdname" nowrap> <em>modechar</em>, </td>
337 <td class="md" nowrap>int </td>
338 <td class="mdname" nowrap> <em>type</em>, </td>
343 <td class="md" nowrap>bool </td>
344 <td class="mdname" nowrap> <em>mode_on</em>, </td>
349 <td class="md" nowrap><a class="el" href="modules_8h.html#a27">string_list</a> & </td>
350 <td class="mdname" nowrap> <em>params</em></td>
354 <td class="md">) </td>
355 <td class="md" colspan="2"><code> [virtual]</code></td>
362 <table cellspacing=5 cellpadding=0 border=0>
370 Called whenever an extended mode is to be processed.
372 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.
374 Definition at line <a class="el" href="modules_8cpp-source.html#l00308">308</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
376 <div class="fragment"><pre>00308 { <span class="keywordflow">return</span> <span class="keyword">false</span>; }
380 <a name="a14" doxytag="Module::OnInfo"></a><p>
381 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
384 <table cellpadding="0" cellspacing="0" border="0">
386 <td class="md" nowrap valign="top"> void Module::OnInfo </td>
387 <td class="md" valign="top">( </td>
388 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
389 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
390 <td class="md" valign="top"> ) </td>
391 <td class="md" nowrap><code> [virtual]</code></td>
398 <table cellspacing=5 cellpadding=0 border=0>
406 Called whenever a user types /INFO.
408 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>
409 <nick> :information here
411 Definition at line <a class="el" href="modules_8cpp-source.html#l00311">311</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
413 <div class="fragment"><pre>00311 { };
417 <a name="a13" doxytag="Module::OnOper"></a><p>
418 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
421 <table cellpadding="0" cellspacing="0" border="0">
423 <td class="md" nowrap valign="top"> void Module::OnOper </td>
424 <td class="md" valign="top">( </td>
425 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
426 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
427 <td class="md" valign="top"> ) </td>
428 <td class="md" nowrap><code> [virtual]</code></td>
435 <table cellspacing=5 cellpadding=0 border=0>
443 Called whenever a user opers locally.
445 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.
447 Definition at line <a class="el" href="modules_8cpp-source.html#l00310">310</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
449 <div class="fragment"><pre>00310 { };
453 <a name="a8" doxytag="Module::OnPacketReceive"></a><p>
454 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
457 <table cellpadding="0" cellspacing="0" border="0">
459 <td class="md" nowrap valign="top"> void Module::OnPacketReceive </td>
460 <td class="md" valign="top">( </td>
461 <td class="md" nowrap valign="top">char * </td>
462 <td class="mdname1" valign="top" nowrap> <em>p</em> </td>
463 <td class="md" valign="top"> ) </td>
464 <td class="md" nowrap><code> [virtual]</code></td>
471 <table cellspacing=5 cellpadding=0 border=0>
479 Called after a packet is received from another irc server.
481 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.
483 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>.
485 <div class="fragment"><pre>00304 { }
489 <a name="a7" doxytag="Module::OnPacketTransmit"></a><p>
490 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
493 <table cellpadding="0" cellspacing="0" border="0">
495 <td class="md" nowrap valign="top"> void Module::OnPacketTransmit </td>
496 <td class="md" valign="top">( </td>
497 <td class="md" nowrap valign="top">char * </td>
498 <td class="mdname1" valign="top" nowrap> <em>p</em> </td>
499 <td class="md" valign="top"> ) </td>
500 <td class="md" nowrap><code> [virtual]</code></td>
507 <table cellspacing=5 cellpadding=0 border=0>
515 Called before a packet is transmitted across the irc network between two irc servers.
517 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.
519 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>.
521 <div class="fragment"><pre>00303 { }
525 <a name="a9" doxytag="Module::OnRehash"></a><p>
526 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
529 <table cellpadding="0" cellspacing="0" border="0">
531 <td class="md" nowrap valign="top"> void Module::OnRehash </td>
532 <td class="md" valign="top">( </td>
533 <td class="mdname1" valign="top" nowrap> </td>
534 <td class="md" valign="top"> ) </td>
535 <td class="md" nowrap><code> [virtual]</code></td>
542 <table cellspacing=5 cellpadding=0 border=0>
552 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.
554 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>.
556 <div class="fragment"><pre>00305 { }
560 <a name="a10" doxytag="Module::OnServerRaw"></a><p>
561 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
564 <table cellpadding="0" cellspacing="0" border="0">
566 <td class="md" nowrap valign="top"> void Module::OnServerRaw </td>
567 <td class="md" valign="top">( </td>
568 <td class="md" nowrap valign="top">std::string & </td>
569 <td class="mdname" nowrap> <em>raw</em>, </td>
574 <td class="md" nowrap>bool </td>
575 <td class="mdname" nowrap> <em>inbound</em>, </td>
580 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
581 <td class="mdname" nowrap> <em>user</em></td>
585 <td class="md">) </td>
586 <td class="md" colspan="2"><code> [virtual]</code></td>
593 <table cellspacing=5 cellpadding=0 border=0>
601 Called when a raw command is transmitted or received.
603 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.
605 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>.
607 <div class="fragment"><pre>00306 { }
611 <a name="a3" doxytag="Module::OnUserConnect"></a><p>
612 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
615 <table cellpadding="0" cellspacing="0" border="0">
617 <td class="md" nowrap valign="top"> void Module::OnUserConnect </td>
618 <td class="md" valign="top">( </td>
619 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
620 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
621 <td class="md" valign="top"> ) </td>
622 <td class="md" nowrap><code> [virtual]</code></td>
629 <table cellspacing=5 cellpadding=0 border=0>
637 Called when a user connects.
639 The details of the connecting user are available to you in the parameter userrec *user
641 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>.
643 <div class="fragment"><pre>00299 { }
647 <a name="a5" doxytag="Module::OnUserJoin"></a><p>
648 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
651 <table cellpadding="0" cellspacing="0" border="0">
653 <td class="md" nowrap valign="top"> void Module::OnUserJoin </td>
654 <td class="md" valign="top">( </td>
655 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
656 <td class="mdname" nowrap> <em>user</em>, </td>
661 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
662 <td class="mdname" nowrap> <em>channel</em></td>
666 <td class="md">) </td>
667 <td class="md" colspan="2"><code> [virtual]</code></td>
674 <table cellspacing=5 cellpadding=0 border=0>
682 Called when a user joins a channel.
684 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
686 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>.
688 <div class="fragment"><pre>00301 { }
692 <a name="a6" doxytag="Module::OnUserPart"></a><p>
693 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
696 <table cellpadding="0" cellspacing="0" border="0">
698 <td class="md" nowrap valign="top"> void Module::OnUserPart </td>
699 <td class="md" valign="top">( </td>
700 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
701 <td class="mdname" nowrap> <em>user</em>, </td>
706 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
707 <td class="mdname" nowrap> <em>channel</em></td>
711 <td class="md">) </td>
712 <td class="md" colspan="2"><code> [virtual]</code></td>
719 <table cellspacing=5 cellpadding=0 border=0>
727 Called when a user parts a channel.
729 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
731 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>.
733 <div class="fragment"><pre>00302 { }
737 <a name="a16" doxytag="Module::OnUserPreInvite"></a><p>
738 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
741 <table cellpadding="0" cellspacing="0" border="0">
743 <td class="md" nowrap valign="top"> int Module::OnUserPreInvite </td>
744 <td class="md" valign="top">( </td>
745 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
746 <td class="mdname" nowrap> <em>source</em>, </td>
751 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
752 <td class="mdname" nowrap> <em>dest</em>, </td>
757 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
758 <td class="mdname" nowrap> <em>channel</em></td>
762 <td class="md">) </td>
763 <td class="md" colspan="2"><code> [virtual]</code></td>
770 <table cellspacing=5 cellpadding=0 border=0>
778 Called whenever a user is about to invite another user into a channel, before any processing is done.
780 Returning 1 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 invites to channels.
782 Definition at line <a class="el" href="modules_8cpp-source.html#l00313">313</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
784 <div class="fragment"><pre>00313 { <span class="keywordflow">return</span> 0; };
788 <a name="a12" doxytag="Module::OnUserPreJoin"></a><p>
789 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
792 <table cellpadding="0" cellspacing="0" border="0">
794 <td class="md" nowrap valign="top"> int Module::OnUserPreJoin </td>
795 <td class="md" valign="top">( </td>
796 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
797 <td class="mdname" nowrap> <em>user</em>, </td>
802 <td class="md" nowrap><a class="el" href="classchanrec.html">chanrec</a> * </td>
803 <td class="mdname" nowrap> <em>chan</em>, </td>
808 <td class="md" nowrap>const char * </td>
809 <td class="mdname" nowrap> <em>cname</em></td>
813 <td class="md">) </td>
814 <td class="md" colspan="2"><code> [virtual]</code></td>
821 <table cellspacing=5 cellpadding=0 border=0>
829 Called whenever a user is about to join a channel, before any processing is done.
831 Returning a value of 1 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. Returning -1 from this function forces the join to be allowed, bypassing restrictions such as banlists, invite, keys etc.<p>
833 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.
835 Definition at line <a class="el" href="modules_8cpp-source.html#l00307">307</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
837 <div class="fragment"><pre>00307 { <span class="keywordflow">return</span> 0; }
841 <a name="a17" doxytag="Module::OnUserPreMessage"></a><p>
842 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
845 <table cellpadding="0" cellspacing="0" border="0">
847 <td class="md" nowrap valign="top"> int Module::OnUserPreMessage </td>
848 <td class="md" valign="top">( </td>
849 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
850 <td class="mdname" nowrap> <em>user</em>, </td>
855 <td class="md" nowrap>void * </td>
856 <td class="mdname" nowrap> <em>dest</em>, </td>
861 <td class="md" nowrap>int </td>
862 <td class="mdname" nowrap> <em>target_type</em>, </td>
867 <td class="md" nowrap>std::string & </td>
868 <td class="mdname" nowrap> <em>text</em></td>
872 <td class="md">) </td>
873 <td class="md" colspan="2"><code> [virtual]</code></td>
880 <table cellspacing=5 cellpadding=0 border=0>
888 Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done.
890 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.
892 Definition at line <a class="el" href="modules_8cpp-source.html#l00314">314</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
894 <div class="fragment"><pre>00314 { <span class="keywordflow">return</span> 0; };
898 <a name="a19" doxytag="Module::OnUserPreNick"></a><p>
899 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
902 <table cellpadding="0" cellspacing="0" border="0">
904 <td class="md" nowrap valign="top"> int Module::OnUserPreNick </td>
905 <td class="md" valign="top">( </td>
906 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
907 <td class="mdname" nowrap> <em>user</em>, </td>
912 <td class="md" nowrap>std::string </td>
913 <td class="mdname" nowrap> <em>newnick</em></td>
917 <td class="md">) </td>
918 <td class="md" colspan="2"><code> [virtual]</code></td>
925 <table cellspacing=5 cellpadding=0 border=0>
933 Called before any nickchange, local or remote.
935 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. You may alter the message text as you wish before relinquishing control to the next module in the chain, and if no other modules block the text this altered form of the text will be sent out to the user and possibly to other servers.
937 Definition at line <a class="el" href="modules_8cpp-source.html#l00316">316</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
939 <div class="fragment"><pre>00316 { <span class="keywordflow">return</span> 0; };
943 <a name="a18" doxytag="Module::OnUserPreNotice"></a><p>
944 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
947 <table cellpadding="0" cellspacing="0" border="0">
949 <td class="md" nowrap valign="top"> int Module::OnUserPreNotice </td>
950 <td class="md" valign="top">( </td>
951 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
952 <td class="mdname" nowrap> <em>user</em>, </td>
957 <td class="md" nowrap>void * </td>
958 <td class="mdname" nowrap> <em>dest</em>, </td>
963 <td class="md" nowrap>int </td>
964 <td class="mdname" nowrap> <em>target_type</em>, </td>
969 <td class="md" nowrap>std::string & </td>
970 <td class="mdname" nowrap> <em>text</em></td>
974 <td class="md">) </td>
975 <td class="md" colspan="2"><code> [virtual]</code></td>
982 <table cellspacing=5 cellpadding=0 border=0>
990 Called whenever a user is about to NOTICE A user or a channel, before any processing is done.
992 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. You may alter the message text as you wish before relinquishing control to the next module in the chain, and if no other modules block the text this altered form of the text will be sent out to the user and possibly to other servers.
994 Definition at line <a class="el" href="modules_8cpp-source.html#l00315">315</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
996 <div class="fragment"><pre>00315 { <span class="keywordflow">return</span> 0; };
1000 <a name="a4" doxytag="Module::OnUserQuit"></a><p>
1001 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1004 <table cellpadding="0" cellspacing="0" border="0">
1006 <td class="md" nowrap valign="top"> void Module::OnUserQuit </td>
1007 <td class="md" valign="top">( </td>
1008 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1009 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
1010 <td class="md" valign="top"> ) </td>
1011 <td class="md" nowrap><code> [virtual]</code></td>
1018 <table cellspacing=5 cellpadding=0 border=0>
1026 Called when a user quits.
1028 The details of the exiting user are available to you in the parameter userrec *user
1030 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>.
1032 <div class="fragment"><pre>00300 { }
1036 <a name="a21" doxytag="Module::OnUserSync"></a><p>
1037 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1040 <table cellpadding="0" cellspacing="0" border="0">
1042 <td class="md" nowrap valign="top"> <a class="el" href="modules_8h.html#a27">string_list</a> Module::OnUserSync </td>
1043 <td class="md" valign="top">( </td>
1044 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1045 <td class="mdname1" valign="top" nowrap> <em>user</em> </td>
1046 <td class="md" valign="top"> ) </td>
1047 <td class="md" nowrap><code> [virtual]</code></td>
1054 <table cellspacing=5 cellpadding=0 border=0>
1062 Called during a netburst to sync user data.
1064 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.
1066 Definition at line <a class="el" href="modules_8cpp-source.html#l00318">318</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1068 References <a class="el" href="modules_8h-source.html#l00061">string_list</a>.
1070 <div class="fragment"><pre>00318 { <a class="code" href="modules_8h.html#a27">string_list</a> empty; <span class="keywordflow">return</span> empty; }
1074 <a name="a15" doxytag="Module::OnWhois"></a><p>
1075 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
1078 <table cellpadding="0" cellspacing="0" border="0">
1080 <td class="md" nowrap valign="top"> void Module::OnWhois </td>
1081 <td class="md" valign="top">( </td>
1082 <td class="md" nowrap valign="top"><a class="el" href="classuserrec.html">userrec</a> * </td>
1083 <td class="mdname" nowrap> <em>source</em>, </td>
1088 <td class="md" nowrap><a class="el" href="classuserrec.html">userrec</a> * </td>
1089 <td class="mdname" nowrap> <em>dest</em></td>
1093 <td class="md">) </td>
1094 <td class="md" colspan="2"><code> [virtual]</code></td>
1101 <table cellspacing=5 cellpadding=0 border=0>
1109 Called whenever a /WHOIS is performed on a local user.
1111 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.
1113 Definition at line <a class="el" href="modules_8cpp-source.html#l00312">312</a> of file <a class="el" href="modules_8cpp-source.html">modules.cpp</a>.
1115 <div class="fragment"><pre>00312 { };
1119 <hr>The documentation for this class was generated from the following files:<ul>
1120 <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>
1121 <hr size="1"><address style="align: right;"><small>Generated on Fri Mar 25 03:49:33 2005 for InspIRCd by
1122 <a href="http://www.doxygen.org/index.html">
1123 <img src="doxygen.png" alt="doxygen" align="middle" border=0 >
1124 </a>1.3.3 </small></address>