]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/Module.3
New documentation on today's new methods etc
[user/henk/code/inspircd.git] / docs / man / man3 / Module.3
1 .TH "Module" 3 "14 Apr 2005" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Module \- Base class for all InspIRCd modules This class is the base class for InspIRCd modules.  
6
7 .PP
8 .SH SYNOPSIS
9 .br
10 .PP
11 \fC#include <modules.h>\fP
12 .PP
13 Inherits \fBclassbase\fP.
14 .PP
15 .SS "Public Member Functions"
16
17 .in +1c
18 .ti -1c
19 .RI "\fBModule\fP ()"
20 .br
21 .RI "\fIDefault constructor creates a module class. \fP"
22 .ti -1c
23 .RI "virtual \fB~Module\fP ()"
24 .br
25 .RI "\fIDefault destructor destroys a module class. \fP"
26 .ti -1c
27 .RI "virtual \fBVersion\fP \fBGetVersion\fP ()"
28 .br
29 .RI "\fIReturns the version number of a Module. \fP"
30 .ti -1c
31 .RI "virtual void \fBOnUserConnect\fP (\fBuserrec\fP *user)"
32 .br
33 .RI "\fICalled when a user connects. \fP"
34 .ti -1c
35 .RI "virtual void \fBOnUserQuit\fP (\fBuserrec\fP *user)"
36 .br
37 .RI "\fICalled when a user quits. \fP"
38 .ti -1c
39 .RI "virtual void \fBOnUserJoin\fP (\fBuserrec\fP *user, \fBchanrec\fP *channel)"
40 .br
41 .RI "\fICalled when a user joins a channel. \fP"
42 .ti -1c
43 .RI "virtual void \fBOnUserPart\fP (\fBuserrec\fP *user, \fBchanrec\fP *channel)"
44 .br
45 .RI "\fICalled when a user parts a channel. \fP"
46 .ti -1c
47 .RI "virtual void \fBOnPacketTransmit\fP (std::string &data, std::string serv)"
48 .br
49 .RI "\fICalled before a packet is transmitted across the irc network between two irc servers. \fP"
50 .ti -1c
51 .RI "virtual void \fBOnPacketReceive\fP (std::string &data, std::string serv)"
52 .br
53 .RI "\fICalled after a packet is received from another irc server. \fP"
54 .ti -1c
55 .RI "virtual void \fBOnRehash\fP ()"
56 .br
57 .RI "\fICalled on rehash. \fP"
58 .ti -1c
59 .RI "virtual void \fBOnServerRaw\fP (std::string &raw, bool inbound, \fBuserrec\fP *user)"
60 .br
61 .RI "\fICalled when a raw command is transmitted or received. \fP"
62 .ti -1c
63 .RI "virtual int \fBOnExtendedMode\fP (\fBuserrec\fP *user, void *target, char modechar, int type, bool mode_on, \fBstring_list\fP &params)"
64 .br
65 .RI "\fICalled whenever an extended mode is to be processed. \fP"
66 .ti -1c
67 .RI "virtual int \fBOnUserPreJoin\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan, const char *cname)"
68 .br
69 .RI "\fICalled whenever a user is about to join a channel, before any processing is done. \fP"
70 .ti -1c
71 .RI "virtual int \fBOnUserPreKick\fP (\fBuserrec\fP *source, \fBuserrec\fP *user, \fBchanrec\fP *chan, std::string reason)"
72 .br
73 .RI "\fICalled whenever a user is about to be kicked. \fP"
74 .ti -1c
75 .RI "virtual void \fBOnUserKick\fP (\fBuserrec\fP *source, \fBuserrec\fP *user, \fBchanrec\fP *chan, std::string reason)"
76 .br
77 .RI "\fICalled whenever a user is kicked. \fP"
78 .ti -1c
79 .RI "virtual void \fBOnOper\fP (\fBuserrec\fP *user)"
80 .br
81 .RI "\fICalled whenever a user opers locally. \fP"
82 .ti -1c
83 .RI "virtual void \fBOnInfo\fP (\fBuserrec\fP *user)"
84 .br
85 .RI "\fICalled whenever a user types /INFO. \fP"
86 .ti -1c
87 .RI "virtual void \fBOnWhois\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest)"
88 .br
89 .RI "\fICalled whenever a /WHOIS is performed on a local user. \fP"
90 .ti -1c
91 .RI "virtual int \fBOnUserPreInvite\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel)"
92 .br
93 .RI "\fICalled whenever a user is about to invite another user into a channel, before any processing is done. \fP"
94 .ti -1c
95 .RI "virtual int \fBOnUserPreMessage\fP (\fBuserrec\fP *user, void *dest, int target_type, std::string &text)"
96 .br
97 .RI "\fICalled whenever a user is about to PRIVMSG A user or a channel, before any processing is done. \fP"
98 .ti -1c
99 .RI "virtual int \fBOnUserPreNotice\fP (\fBuserrec\fP *user, void *dest, int target_type, std::string &text)"
100 .br
101 .RI "\fICalled whenever a user is about to NOTICE A user or a channel, before any processing is done. \fP"
102 .ti -1c
103 .RI "virtual int \fBOnUserPreNick\fP (\fBuserrec\fP *user, std::string newnick)"
104 .br
105 .RI "\fICalled before any nickchange, local or remote. \fP"
106 .ti -1c
107 .RI "virtual void \fBOnUserPostNick\fP (\fBuserrec\fP *user, std::string oldnick)"
108 .br
109 .RI "\fICalled after any nickchange, local or remote. \fP"
110 .ti -1c
111 .RI "virtual int \fBOnAccessCheck\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel, int access_type)"
112 .br
113 .RI "\fICalled before an action which requires a channel privilage check. \fP"
114 .ti -1c
115 .RI "virtual \fBstring_list\fP \fBOnUserSync\fP (\fBuserrec\fP *user)"
116 .br
117 .RI "\fICalled during a netburst to sync user data. \fP"
118 .ti -1c
119 .RI "virtual \fBstring_list\fP \fBOnChannelSync\fP (\fBchanrec\fP *chan)"
120 .br
121 .RI "\fICalled during a netburst to sync channel data. \fP"
122 .ti -1c
123 .RI "virtual void \fBOn005Numeric\fP (std::string &output)"
124 .br
125 .RI "\fICalled when a 005 numeric is about to be output. \fP"
126 .ti -1c
127 .RI "virtual int \fBOnKill\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, std::string reason)"
128 .br
129 .RI "\fICalled when a client is disconnected by KILL. \fP"
130 .ti -1c
131 .RI "virtual void \fBOnLoadModule\fP (\fBModule\fP *mod, std::string name)"
132 .br
133 .RI "\fICalled whenever a module is loaded. \fP"
134 .ti -1c
135 .RI "virtual void \fBOnBackgroundTimer\fP (time_t curtime)"
136 .br
137 .RI "\fICalled once every five seconds for background processing. \fP"
138 .ti -1c
139 .RI "virtual void \fBOnSendList\fP (\fBuserrec\fP *user, \fBchanrec\fP *channel, char mode)"
140 .br
141 .RI "\fICalled whenever a list is needed for a listmode. \fP"
142 .ti -1c
143 .RI "virtual int \fBOnPreCommand\fP (std::string command, char **parameters, int pcnt, \fBuserrec\fP *user)"
144 .br
145 .RI "\fICalled whenever any command is about to be executed. \fP"
146 .ti -1c
147 .RI "virtual bool \fBOnCheckReady\fP (\fBuserrec\fP *user)"
148 .br
149 .RI "\fICalled to check if a user who is connecting can now be allowed to register If any modules return false for this function, the user is held in the waiting state until all modules return true. \fP"
150 .ti -1c
151 .RI "virtual void \fBOnUserRegister\fP (\fBuserrec\fP *user)"
152 .br
153 .RI "\fICalled whenever a user is about to register their connection (e.g. \fP"
154 .in -1c
155 .SH "Detailed Description"
156 .PP 
157 Base class for all InspIRCd modules This class is the base class for InspIRCd modules. 
158
159 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 \fBModuleFactory\fP class (see relevent section) for the plugin to be initialised. 
160 .PP
161 Definition at line 135 of file modules.h.
162 .SH "Constructor & Destructor Documentation"
163 .PP 
164 .SS "Module::Module ()"
165 .PP
166 Default constructor creates a module class. Definition at line 306 of file modules.cpp.
167 .PP
168 .nf
169 306 { }
170 .fi
171 .SS "Module::~\fBModule\fP ()\fC [virtual]\fP"
172 .PP
173 Default destructor destroys a module class. Definition at line 307 of file modules.cpp.
174 .PP
175 .nf
176 307 { }
177 .fi
178 .SH "Member Function Documentation"
179 .PP 
180 .SS "\fBVersion\fP Module::GetVersion ()\fC [virtual]\fP"
181 .PP
182 Returns the version number of a Module. The method should return a \fBVersion\fP object with its version information assigned via \fBVersion::Version\fPDefinition at line 318 of file modules.cpp.
183 .PP
184 References VF_VENDOR.
185 .PP
186 .nf
187 318 { return Version(1,0,0,0,VF_VENDOR); }
188 .fi
189 .SS "void Module::On005Numeric (std::string & output)\fC [virtual]\fP"
190 .PP
191 Called when a 005 numeric is about to be output. The module should modify the 005 numeric if needed to indicate its features.Definition at line 330 of file modules.cpp.
192 .PP
193 .nf
194 330 { };
195 .fi
196 .SS "int Module::OnAccessCheck (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBchanrec\fP * channel, int access_type)\fC [virtual]\fP"
197 .PP
198 Called before an action which requires a channel privilage check. 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:
199 .br
200
201 .br
202  AC_KICK (0) - A user is being kicked
203 .br
204  AC_DEOP (1) - a user is being deopped
205 .br
206  AC_OP (2) - a user is being opped
207 .br
208  AC_VOICE (3) - a user is being voiced
209 .br
210  AC_DEVOICE (4) - a user is being devoiced
211 .br
212  AC_HALFOP (5) - a user is being halfopped
213 .br
214  AC_DEHALFOP (6) - a user is being dehalfopped
215 .br
216  AC_INVITE (7) - a user is being invited
217 .br
218  AC_GENERAL_MODE (8) - a user channel mode is being changed
219 .br
220
221 .br
222  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).Definition at line 327 of file modules.cpp.
223 .PP
224 References ACR_DEFAULT.
225 .PP
226 .nf
227 327 { return ACR_DEFAULT; };
228 .fi
229 .SS "void Module::OnBackgroundTimer (time_t curtime)\fC [virtual]\fP"
230 .PP
231 Called once every five seconds for background processing. This timer can be used to control timed features. Its period is not accurate enough to be used as a clock, but it is gauranteed to be called at least once in any five second period, directly from the main loop of the server.Definition at line 333 of file modules.cpp.
232 .PP
233 .nf
234 333 { };
235 .fi
236 .SS "\fBstring_list\fP Module::OnChannelSync (\fBchanrec\fP * chan)\fC [virtual]\fP"
237 .PP
238 Called during a netburst to sync channel data. 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.Definition at line 329 of file modules.cpp.
239 .PP
240 References string_list.
241 .PP
242 .nf
243 329 { string_list empty; return empty; }
244 .fi
245 .SS "bool Module::OnCheckReady (\fBuserrec\fP * user)\fC [virtual]\fP"
246 .PP
247 Called to check if a user who is connecting can now be allowed to register If any modules return false for this function, the user is held in the waiting state until all modules return true. For example a module which implements ident lookups will continue to return false for a user until their ident lookup is completed. Note that the registration timeout for a user overrides these checks, if the registration timeout is reached, the user is disconnected even if modules report that the user is not ready to connect.Definition at line 336 of file modules.cpp.
248 .PP
249 .nf
250 336 { return true; };
251 .fi
252 .SS "int Module::OnExtendedMode (\fBuserrec\fP * user, void * target, char modechar, int type, bool mode_on, \fBstring_list\fP & params)\fC [virtual]\fP"
253 .PP
254 Called whenever an extended mode is to be processed. 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 \fBServer::AddExtendedMode\fP 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.Definition at line 317 of file modules.cpp.
255 .PP
256 .nf
257 317 { return false; }
258 .fi
259 .SS "void Module::OnInfo (\fBuserrec\fP * user)\fC [virtual]\fP"
260 .PP
261 Called whenever a user types /INFO. 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:
262 .PP
263 <nick> :information hereDefinition at line 320 of file modules.cpp.
264 .PP
265 .nf
266 320 { };
267 .fi
268 .SS "int Module::OnKill (\fBuserrec\fP * source, \fBuserrec\fP * dest, std::string reason)\fC [virtual]\fP"
269 .PP
270 Called when a client is disconnected by KILL. If a client is killed by a server, e.g. a nickname collision or protocol error, source is NULL. Return 1 from this function to prevent the kill, and 0 from this function to allow it as normal. If you prevent the kill no output will be sent to the client, it is down to your module to generate this information. NOTE: It is NOT advisable to stop kills which originate from servers. If you do so youre risking race conditions, desyncs and worse!Definition at line 331 of file modules.cpp.
271 .PP
272 .nf
273 331 { return 0; };
274 .fi
275 .SS "void Module::OnLoadModule (\fBModule\fP * mod, std::string name)\fC [virtual]\fP"
276 .PP
277 Called whenever a module is loaded. mod will contain a pointer to the module, and string will contain its name, for example m_widgets.so. This function is primary for dependency checking, your module may decide to enable some extra features if it sees that you have for example loaded 'm_killwidgets.so' with 'm_makewidgets.so'. It is highly recommended that modules do *NOT* bail if they cannot satisfy dependencies, but instead operate under reduced functionality, unless the dependency is absolutely neccessary (e.g. a module that extends the features of another module).Definition at line 332 of file modules.cpp.
278 .PP
279 .nf
280 332 { };
281 .fi
282 .SS "void Module::OnOper (\fBuserrec\fP * user)\fC [virtual]\fP"
283 .PP
284 Called whenever a user opers locally. 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.Definition at line 319 of file modules.cpp.
285 .PP
286 .nf
287 319 { };
288 .fi
289 .SS "void Module::OnPacketReceive (std::string & data, std::string serv)\fC [virtual]\fP"
290 .PP
291 Called after a packet is received from another irc server. 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.Definition at line 313 of file modules.cpp.
292 .PP
293 .nf
294 313 { }
295 .fi
296 .SS "void Module::OnPacketTransmit (std::string & data, std::string serv)\fC [virtual]\fP"
297 .PP
298 Called before a packet is transmitted across the irc network between two irc servers. 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.Definition at line 312 of file modules.cpp.
299 .PP
300 .nf
301 312 { }
302 .fi
303 .SS "int Module::OnPreCommand (std::string command, char ** parameters, int pcnt, \fBuserrec\fP * user)\fC [virtual]\fP"
304 .PP
305 Called whenever any command is about to be executed. This event occurs for all registered commands, wether they are registered in the core, or another module, but it will not occur for invalid commands (e.g. ones which do not exist within the command table). By returning 1 from this method you may prevent the command being executed. If you do this, no output is created by the core, and it is down to your module to produce any output neccessary. Note that unless you return 1, you should not destroy any structures (e.g. by using \fBServer::QuitUser\fP) otherwise when the command's handler function executes after your method returns, it will be passed an invalid pointer to the user object and crash!)Definition at line 335 of file modules.cpp.
306 .PP
307 .nf
308 335 { return 0; };
309 .fi
310 .SS "void Module::OnRehash ()\fC [virtual]\fP"
311 .PP
312 Called on rehash. 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.Definition at line 314 of file modules.cpp.
313 .PP
314 .nf
315 314 { }
316 .fi
317 .SS "void Module::OnSendList (\fBuserrec\fP * user, \fBchanrec\fP * channel, char mode)\fC [virtual]\fP"
318 .PP
319 Called whenever a list is needed for a listmode. For example, when a /MODE #channel +b (without any other parameters) is called, if a module was handling +b this function would be called. The function can then output any lists it wishes to. Please note that all modules will see all mode characters to provide the ability to extend each other, so please only output a list if the mode character given matches the one(s) you want to handle.Definition at line 334 of file modules.cpp.
320 .PP
321 .nf
322 334 { };
323 .fi
324 .SS "void Module::OnServerRaw (std::string & raw, bool inbound, \fBuserrec\fP * user)\fC [virtual]\fP"
325 .PP
326 Called when a raw command is transmitted or received. 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.Definition at line 315 of file modules.cpp.
327 .PP
328 .nf
329 315 { }
330 .fi
331 .SS "void Module::OnUserConnect (\fBuserrec\fP * user)\fC [virtual]\fP"
332 .PP
333 Called when a user connects. The details of the connecting user are available to you in the parameter userrec *userDefinition at line 308 of file modules.cpp.
334 .PP
335 .nf
336 308 { }
337 .fi
338 .SS "void Module::OnUserJoin (\fBuserrec\fP * user, \fBchanrec\fP * channel)\fC [virtual]\fP"
339 .PP
340 Called when a user joins a channel. 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 *channelDefinition at line 310 of file modules.cpp.
341 .PP
342 .nf
343 310 { }
344 .fi
345 .SS "void Module::OnUserKick (\fBuserrec\fP * source, \fBuserrec\fP * user, \fBchanrec\fP * chan, std::string reason)\fC [virtual]\fP"
346 .PP
347 Called whenever a user is kicked. If this method is called, the kick is already underway and cannot be prevented, so to prevent a kick, please use \fBModule::OnUserPreKick\fP instead of this method.Definition at line 339 of file modules.cpp.
348 .PP
349 .nf
350 339 { };
351 .fi
352 .SS "void Module::OnUserPart (\fBuserrec\fP * user, \fBchanrec\fP * channel)\fC [virtual]\fP"
353 .PP
354 Called when a user parts a channel. 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 *channelDefinition at line 311 of file modules.cpp.
355 .PP
356 .nf
357 311 { }
358 .fi
359 .SS "void Module::OnUserPostNick (\fBuserrec\fP * user, std::string oldnick)\fC [virtual]\fP"
360 .PP
361 Called after any nickchange, local or remote. This can be used to track users after nickchanges have been applied. 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). Because this method is called after the nickchange is taken place, no return values are possible to indicate forbidding of the nick change. Use OnUserPreNick for this. Definition at line 326 of file modules.cpp.
362 .PP
363 .nf
364 326 { };
365 .fi
366 .SS "int Module::OnUserPreInvite (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBchanrec\fP * channel)\fC [virtual]\fP"
367 .PP
368 Called whenever a user is about to invite another user into a channel, before any processing is done. 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.Definition at line 322 of file modules.cpp.
369 .PP
370 .nf
371 322 { return 0; };
372 .fi
373 .SS "int Module::OnUserPreJoin (\fBuserrec\fP * user, \fBchanrec\fP * chan, const char * cname)\fC [virtual]\fP"
374 .PP
375 Called whenever a user is about to join a channel, before any processing is done. 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.
376 .PP
377 IMPORTANT NOTE!
378 .PP
379 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.Definition at line 316 of file modules.cpp.
380 .PP
381 .nf
382 316 { return 0; }
383 .fi
384 .SS "int Module::OnUserPreKick (\fBuserrec\fP * source, \fBuserrec\fP * user, \fBchanrec\fP * chan, std::string reason)\fC [virtual]\fP"
385 .PP
386 Called whenever a user is about to be kicked. 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. Definition at line 338 of file modules.cpp.
387 .PP
388 .nf
389 338 { return 0; };
390 .fi
391 .SS "int Module::OnUserPreMessage (\fBuserrec\fP * user, void * dest, int target_type, std::string & text)\fC [virtual]\fP"
392 .PP
393 Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. 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.Definition at line 323 of file modules.cpp.
394 .PP
395 .nf
396 323 { return 0; };
397 .fi
398 .SS "int Module::OnUserPreNick (\fBuserrec\fP * user, std::string newnick)\fC [virtual]\fP"
399 .PP
400 Called before any nickchange, local or remote. 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.Definition at line 325 of file modules.cpp.
401 .PP
402 .nf
403 325 { return 0; };
404 .fi
405 .SS "int Module::OnUserPreNotice (\fBuserrec\fP * user, void * dest, int target_type, std::string & text)\fC [virtual]\fP"
406 .PP
407 Called whenever a user is about to NOTICE A user or a channel, before any processing is done. 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.Definition at line 324 of file modules.cpp.
408 .PP
409 .nf
410 324 { return 0; };
411 .fi
412 .SS "void Module::OnUserQuit (\fBuserrec\fP * user)\fC [virtual]\fP"
413 .PP
414 Called when a user quits. The details of the exiting user are available to you in the parameter userrec *userDefinition at line 309 of file modules.cpp.
415 .PP
416 .nf
417 309 { }
418 .fi
419 .SS "void Module::OnUserRegister (\fBuserrec\fP * user)\fC [virtual]\fP"
420 .PP
421 Called whenever a user is about to register their connection (e.g. before the user is sent the MOTD etc). Modules can use this method if they are performing a function which must be done before the actual connection is completed (e.g. ident lookups, dnsbl lookups, etc). Note that you should NOT delete the user record here by causing a disconnection! Use OnUserConnect for that instead.Definition at line 337 of file modules.cpp.
422 .PP
423 .nf
424 337 { };
425 .fi
426 .SS "\fBstring_list\fP Module::OnUserSync (\fBuserrec\fP * user)\fC [virtual]\fP"
427 .PP
428 Called during a netburst to sync user data. 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.Definition at line 328 of file modules.cpp.
429 .PP
430 References string_list.
431 .PP
432 .nf
433 328 { string_list empty; return empty; }
434 .fi
435 .SS "void Module::OnWhois (\fBuserrec\fP * source, \fBuserrec\fP * dest)\fC [virtual]\fP"
436 .PP
437 Called whenever a /WHOIS is performed on a local user. 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.Definition at line 321 of file modules.cpp.
438 .PP
439 .nf
440 321 { };
441 .fi
442
443
444 .SH "Author"
445 .PP 
446 Generated automatically by Doxygen for InspIRCd from the source code.