]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/Module.3
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2578 e03df62e-2008...
[user/henk/code/inspircd.git] / docs / man / man3 / Module.3
1 .TH "Module" 3 "19 Dec 2005" "Version 1.0Betareleases" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Module \- Base class for all \fBInspIRCd\fP modules This class is the base class for \fBInspIRCd\fP 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 (\fBServer\fP *Me)"
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, \fBstd::string\fP message)"
36 .br
37 .RI "\fICalled when a user quits. \fP"
38 .ti -1c
39 .RI "virtual void \fBOnUserDisconnect\fP (\fBuserrec\fP *user)"
40 .br
41 .RI "\fICalled whenever a user's socket is closed. \fP"
42 .ti -1c
43 .RI "virtual void \fBOnUserJoin\fP (\fBuserrec\fP *user, \fBchanrec\fP *channel)"
44 .br
45 .RI "\fICalled when a user joins a channel. \fP"
46 .ti -1c
47 .RI "virtual void \fBOnUserPart\fP (\fBuserrec\fP *user, \fBchanrec\fP *channel)"
48 .br
49 .RI "\fICalled when a user parts a channel. \fP"
50 .ti -1c
51 .RI "virtual void \fBOnRehash\fP (\fBstd::string\fP parameter)"
52 .br
53 .RI "\fICalled on rehash. \fP"
54 .ti -1c
55 .RI "virtual void \fBOnServerRaw\fP (\fBstd::string\fP &raw, bool inbound, \fBuserrec\fP *user)"
56 .br
57 .RI "\fICalled when a raw command is transmitted or received. \fP"
58 .ti -1c
59 .RI "virtual int \fBOnExtendedMode\fP (\fBuserrec\fP *user, void *target, char modechar, int type, bool mode_on, \fBstring_list\fP &params)"
60 .br
61 .RI "\fICalled whenever an extended mode is to be processed. \fP"
62 .ti -1c
63 .RI "virtual int \fBOnUserPreJoin\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan, const char *cname)"
64 .br
65 .RI "\fICalled whenever a user is about to join a channel, before any processing is done. \fP"
66 .ti -1c
67 .RI "virtual int \fBOnUserPreKick\fP (\fBuserrec\fP *source, \fBuserrec\fP *user, \fBchanrec\fP *chan, \fBstd::string\fP reason)"
68 .br
69 .RI "\fICalled whenever a user is about to be kicked. \fP"
70 .ti -1c
71 .RI "virtual void \fBOnUserKick\fP (\fBuserrec\fP *source, \fBuserrec\fP *user, \fBchanrec\fP *chan, \fBstd::string\fP reason)"
72 .br
73 .RI "\fICalled whenever a user is kicked. \fP"
74 .ti -1c
75 .RI "virtual void \fBOnOper\fP (\fBuserrec\fP *user, \fBstd::string\fP opertype)"
76 .br
77 .RI "\fICalled whenever a user opers locally. \fP"
78 .ti -1c
79 .RI "virtual void \fBOnInfo\fP (\fBuserrec\fP *user)"
80 .br
81 .RI "\fICalled whenever a user types /INFO. \fP"
82 .ti -1c
83 .RI "virtual void \fBOnWhois\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest)"
84 .br
85 .RI "\fICalled whenever a /WHOIS is performed on a local user. \fP"
86 .ti -1c
87 .RI "virtual int \fBOnUserPreInvite\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel)"
88 .br
89 .RI "\fICalled whenever a user is about to invite another user into a channel, before any processing is done. \fP"
90 .ti -1c
91 .RI "virtual void \fBOnUserInvite\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel)"
92 .br
93 .RI "\fICalled after a user has been successfully invited to a channel. \fP"
94 .ti -1c
95 .RI "virtual int \fBOnUserPreMessage\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP &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, \fBstd::string\fP &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, \fBstd::string\fP newnick)"
104 .br
105 .RI "\fICalled before any nickchange, local or remote. \fP"
106 .ti -1c
107 .RI "virtual void \fBOnUserMessage\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP text)"
108 .br
109 .RI "\fICalled after any PRIVMSG sent from a user. \fP"
110 .ti -1c
111 .RI "virtual void \fBOnUserNotice\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP text)"
112 .br
113 .RI "\fICalled after any NOTICE sent from a user. \fP"
114 .ti -1c
115 .RI "virtual void \fBOnMode\fP (\fBuserrec\fP *user, void *dest, int target_type, \fBstd::string\fP text)"
116 .br
117 .RI "\fICalled after every MODE command sent from a user The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. \fP"
118 .ti -1c
119 .RI "virtual void \fBOnGetServerDescription\fP (\fBstd::string\fP servername, \fBstd::string\fP &description)"
120 .br
121 .RI "\fIAllows modules to alter or create server descriptions Whenever a module requires a server description, for example for display in WHOIS, this function is called in all modules. \fP"
122 .ti -1c
123 .RI "virtual void \fBOnSyncUser\fP (\fBuserrec\fP *user, \fBModule\fP *proto, void *opaque)"
124 .br
125 .RI "\fIAllows modules to synchronize data which relates to users during a netburst. \fP"
126 .ti -1c
127 .RI "virtual void \fBOnSyncChannel\fP (\fBchanrec\fP *chan, \fBModule\fP *proto, void *opaque)"
128 .br
129 .RI "\fIAllows modules to synchronize data which relates to channels during a netburst. \fP"
130 .ti -1c
131 .RI "virtual void \fBOnSyncChannelMetaData\fP (\fBchanrec\fP *chan, \fBModule\fP *proto, void *opaque, \fBstd::string\fP extname)"
132 .br
133 .ti -1c
134 .RI "virtual void \fBOnSyncUserMetaData\fP (\fBuserrec\fP *user, \fBModule\fP *proto, void *opaque, \fBstd::string\fP extname)"
135 .br
136 .ti -1c
137 .RI "virtual void \fBOnDecodeMetaData\fP (int target_type, void *target, \fBstd::string\fP extname, \fBstd::string\fP extdata)"
138 .br
139 .RI "\fIAllows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. \fP"
140 .ti -1c
141 .RI "virtual void \fBProtoSendMode\fP (void *opaque, int target_type, void *target, \fBstd::string\fP modeline)"
142 .br
143 .RI "\fIImplemented by modules which provide the ability to link servers. \fP"
144 .ti -1c
145 .RI "virtual void \fBProtoSendMetaData\fP (void *opaque, int target_type, void *target, \fBstd::string\fP extname, \fBstd::string\fP extdata)"
146 .br
147 .RI "\fIImplemented by modules which provide the ability to link servers. \fP"
148 .ti -1c
149 .RI "virtual void \fBOnWallops\fP (\fBuserrec\fP *user, \fBstd::string\fP text)"
150 .br
151 .RI "\fICalled after every WALLOPS command. \fP"
152 .ti -1c
153 .RI "virtual void \fBOnChangeHost\fP (\fBuserrec\fP *user, \fBstd::string\fP newhost)"
154 .br
155 .RI "\fICalled whenever a user's hostname is changed. \fP"
156 .ti -1c
157 .RI "virtual void \fBOnChangeName\fP (\fBuserrec\fP *user, \fBstd::string\fP gecos)"
158 .br
159 .RI "\fICalled whenever a user's GECOS (realname) is changed. \fP"
160 .ti -1c
161 .RI "virtual void \fBOnAddGLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)"
162 .br
163 .RI "\fICalled whenever a gline is added by a local user. \fP"
164 .ti -1c
165 .RI "virtual void \fBOnAddZLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP ipmask)"
166 .br
167 .RI "\fICalled whenever a zline is added by a local user. \fP"
168 .ti -1c
169 .RI "virtual void \fBOnAddKLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)"
170 .br
171 .RI "\fICalled whenever a kline is added by a local user. \fP"
172 .ti -1c
173 .RI "virtual void \fBOnAddQLine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP nickmask)"
174 .br
175 .RI "\fICalled whenever a qline is added by a local user. \fP"
176 .ti -1c
177 .RI "virtual void \fBOnAddELine\fP (long duration, \fBuserrec\fP *source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)"
178 .br
179 .RI "\fICalled whenever a eline is added by a local user. \fP"
180 .ti -1c
181 .RI "virtual void \fBOnDelGLine\fP (\fBuserrec\fP *source, \fBstd::string\fP hostmask)"
182 .br
183 .RI "\fICalled whenever a gline is deleted. \fP"
184 .ti -1c
185 .RI "virtual void \fBOnDelZLine\fP (\fBuserrec\fP *source, \fBstd::string\fP ipmask)"
186 .br
187 .RI "\fICalled whenever a zline is deleted. \fP"
188 .ti -1c
189 .RI "virtual void \fBOnDelKLine\fP (\fBuserrec\fP *source, \fBstd::string\fP hostmask)"
190 .br
191 .RI "\fICalled whenever a kline is deleted. \fP"
192 .ti -1c
193 .RI "virtual void \fBOnDelQLine\fP (\fBuserrec\fP *source, \fBstd::string\fP nickmask)"
194 .br
195 .RI "\fICalled whenever a qline is deleted. \fP"
196 .ti -1c
197 .RI "virtual void \fBOnDelELine\fP (\fBuserrec\fP *source, \fBstd::string\fP hostmask)"
198 .br
199 .RI "\fICalled whenever a eline is deleted. \fP"
200 .ti -1c
201 .RI "virtual void \fBOnCleanup\fP (int target_type, void *item)"
202 .br
203 .RI "\fICalled before your module is unloaded to clean up Extensibles. \fP"
204 .ti -1c
205 .RI "virtual void \fBOnUserPostNick\fP (\fBuserrec\fP *user, \fBstd::string\fP oldnick)"
206 .br
207 .RI "\fICalled after any nickchange, local or remote. \fP"
208 .ti -1c
209 .RI "virtual int \fBOnAccessCheck\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBchanrec\fP *channel, int access_type)"
210 .br
211 .RI "\fICalled before an action which requires a channel privilage check. \fP"
212 .ti -1c
213 .RI "virtual void \fBOn005Numeric\fP (\fBstd::string\fP &output)"
214 .br
215 .RI "\fICalled when a 005 numeric is about to be output. \fP"
216 .ti -1c
217 .RI "virtual int \fBOnKill\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBstd::string\fP reason)"
218 .br
219 .RI "\fICalled when a client is disconnected by KILL. \fP"
220 .ti -1c
221 .RI "virtual void \fBOnRemoteKill\fP (\fBuserrec\fP *source, \fBuserrec\fP *dest, \fBstd::string\fP reason)"
222 .br
223 .RI "\fICalled when an oper wants to disconnect a remote user via KILL. \fP"
224 .ti -1c
225 .RI "virtual void \fBOnLoadModule\fP (\fBModule\fP *mod, \fBstd::string\fP name)"
226 .br
227 .RI "\fICalled whenever a module is loaded. \fP"
228 .ti -1c
229 .RI "virtual void \fBOnUnloadModule\fP (\fBModule\fP *mod, \fBstd::string\fP name)"
230 .br
231 .RI "\fICalled whenever a module is unloaded. \fP"
232 .ti -1c
233 .RI "virtual void \fBOnBackgroundTimer\fP (time_t curtime)"
234 .br
235 .RI "\fICalled once every five seconds for background processing. \fP"
236 .ti -1c
237 .RI "virtual void \fBOnSendList\fP (\fBuserrec\fP *user, \fBchanrec\fP *channel, char mode)"
238 .br
239 .RI "\fICalled whenever a list is needed for a listmode. \fP"
240 .ti -1c
241 .RI "virtual int \fBOnPreCommand\fP (\fBstd::string\fP command, char **parameters, int pcnt, \fBuserrec\fP *user)"
242 .br
243 .RI "\fICalled whenever any command is about to be executed. \fP"
244 .ti -1c
245 .RI "virtual bool \fBOnCheckReady\fP (\fBuserrec\fP *user)"
246 .br
247 .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"
248 .ti -1c
249 .RI "virtual void \fBOnUserRegister\fP (\fBuserrec\fP *user)"
250 .br
251 .RI "\fICalled whenever a user is about to register their connection (e.g. \fP"
252 .ti -1c
253 .RI "virtual int \fBOnRawMode\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan, char mode, \fBstd::string\fP param, bool adding, int pcnt)"
254 .br
255 .RI "\fICalled whenever a mode character is processed. \fP"
256 .ti -1c
257 .RI "virtual int \fBOnCheckInvite\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan)"
258 .br
259 .RI "\fICalled whenever a user joins a channel, to determine if invite checks should go ahead or not. \fP"
260 .ti -1c
261 .RI "virtual int \fBOnCheckKey\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan, \fBstd::string\fP keygiven)"
262 .br
263 .RI "\fICalled whenever a user joins a channel, to determine if key checks should go ahead or not. \fP"
264 .ti -1c
265 .RI "virtual int \fBOnCheckLimit\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan)"
266 .br
267 .RI "\fICalled whenever a user joins a channel, to determine if channel limit checks should go ahead or not. \fP"
268 .ti -1c
269 .RI "virtual int \fBOnCheckBan\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan)"
270 .br
271 .RI "\fICalled whenever a user joins a channel, to determine if banlist checks should go ahead or not. \fP"
272 .ti -1c
273 .RI "virtual void \fBOnStats\fP (char symbol)"
274 .br
275 .RI "\fICalled on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core. \fP"
276 .ti -1c
277 .RI "virtual int \fBOnChangeLocalUserHost\fP (\fBuserrec\fP *user, \fBstd::string\fP newhost)"
278 .br
279 .RI "\fICalled whenever a change of a local users displayed host is attempted. \fP"
280 .ti -1c
281 .RI "virtual int \fBOnChangeLocalUserGECOS\fP (\fBuserrec\fP *user, \fBstd::string\fP newhost)"
282 .br
283 .RI "\fICalled whenever a change of a local users GECOS (fullname field) is attempted. \fP"
284 .ti -1c
285 .RI "virtual int \fBOnLocalTopicChange\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan, \fBstd::string\fP topic)"
286 .br
287 .RI "\fICalled whenever a topic is changed by a local user. \fP"
288 .ti -1c
289 .RI "virtual void \fBOnPostLocalTopicChange\fP (\fBuserrec\fP *user, \fBchanrec\fP *chan, \fBstd::string\fP topic)"
290 .br
291 .RI "\fICalled whenever a local topic has been changed. \fP"
292 .ti -1c
293 .RI "virtual void \fBOnEvent\fP (\fBEvent\fP *event)"
294 .br
295 .RI "\fICalled whenever an \fBEvent\fP class is sent to all module by another module. \fP"
296 .ti -1c
297 .RI "virtual char * \fBOnRequest\fP (\fBRequest\fP *request)"
298 .br
299 .RI "\fICalled whenever a \fBRequest\fP class is sent to your module by another module. \fP"
300 .ti -1c
301 .RI "virtual int \fBOnOperCompare\fP (\fBstd::string\fP password, \fBstd::string\fP input)"
302 .br
303 .RI "\fICalled whenever an oper password is to be compared to what a user has input. \fP"
304 .ti -1c
305 .RI "virtual void \fBOnGlobalOper\fP (\fBuserrec\fP *user)"
306 .br
307 .RI "\fICalled whenever a user is given usermode +o, anywhere on the network. \fP"
308 .ti -1c
309 .RI "virtual void \fBOnGlobalConnect\fP (\fBuserrec\fP *user)"
310 .br
311 .RI "\fICalled whenever a user connects, anywhere on the network. \fP"
312 .ti -1c
313 .RI "virtual int \fBOnAddBan\fP (\fBuserrec\fP *source, \fBchanrec\fP *channel, \fBstd::string\fP banmask)"
314 .br
315 .RI "\fICalled whenever a ban is added to a channel's list. \fP"
316 .ti -1c
317 .RI "virtual int \fBOnDelBan\fP (\fBuserrec\fP *source, \fBchanrec\fP *channel, \fBstd::string\fP banmask)"
318 .br
319 .RI "\fICalled whenever a ban is removed from a channel's list. \fP"
320 .ti -1c
321 .RI "virtual void \fBOnRawSocketAccept\fP (int fd, \fBstd::string\fP ip, int localport)"
322 .br
323 .RI "\fICalled immediately after any connection is accepted. \fP"
324 .ti -1c
325 .RI "virtual int \fBOnRawSocketWrite\fP (int fd, char *buffer, int count)"
326 .br
327 .RI "\fICalled immediately before any write() operation on a user's socket in the core. \fP"
328 .ti -1c
329 .RI "virtual void \fBOnRawSocketClose\fP (int fd)"
330 .br
331 .RI "\fICalled immediately before any socket is closed. \fP"
332 .ti -1c
333 .RI "virtual int \fBOnRawSocketRead\fP (int fd, char *buffer, unsigned int count, int &readresult)"
334 .br
335 .RI "\fICalled immediately before any read() operation on a client socket in the core. \fP"
336 .in -1c
337 .SH "Detailed Description"
338 .PP 
339 Base class for all \fBInspIRCd\fP modules This class is the base class for \fBInspIRCd\fP modules. 
340
341 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.
342 .PP
343 Definition at line 272 of file modules.h.
344 .SH "Constructor & Destructor Documentation"
345 .PP 
346 .SS "Module::Module (\fBServer\fP * Me)"
347 .PP
348 Default constructor Creates a module class. 
349 .PP
350 \fBParameters:\fP
351 .RS 4
352 \fIMe\fP An instance of the \fBServer\fP class which can be saved for future use
353 .RE
354 .PP
355
356 .PP
357 Definition at line 219 of file modules.cpp.
358 .PP
359 .nf
360 219 { }
361 .fi
362 .PP
363 .SS "Module::~Module ()\fC [virtual]\fP"
364 .PP
365 Default destructor destroys a module class. 
366 .PP
367 Definition at line 220 of file modules.cpp.
368 .PP
369 .nf
370 220 { }
371 .fi
372 .PP
373 .SH "Member Function Documentation"
374 .PP 
375 .SS "\fBVersion\fP Module::GetVersion ()\fC [virtual]\fP"
376 .PP
377 Returns the version number of a Module. 
378 .PP
379 The method should return a \fBVersion\fP object with its version information assigned via \fBVersion::Version\fP
380 .PP
381 Definition at line 231 of file modules.cpp.
382 .PP
383 References VF_VENDOR.
384 .PP
385 .nf
386 231 { return Version(1,0,0,0,VF_VENDOR); }
387 .fi
388 .PP
389 .SS "void Module::On005Numeric (\fBstd::string\fP & output)\fC [virtual]\fP"
390 .PP
391 Called when a 005 numeric is about to be output. 
392 .PP
393 The module should modify the 005 numeric if needed to indicate its features. 
394 .PP
395 \fBParameters:\fP
396 .RS 4
397 \fIoutput\fP The 005 string to be modified if neccessary.
398 .RE
399 .PP
400
401 .PP
402 Definition at line 241 of file modules.cpp.
403 .PP
404 .nf
405 241 { };
406 .fi
407 .PP
408 .SS "int Module::OnAccessCheck (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBchanrec\fP * channel, int access_type)\fC [virtual]\fP"
409 .PP
410 Called before an action which requires a channel privilage check. 
411 .PP
412 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:
413 .br
414
415 .br
416  AC_KICK (0) - A user is being kicked
417 .br
418  AC_DEOP (1) - a user is being deopped
419 .br
420  AC_OP (2) - a user is being opped
421 .br
422  AC_VOICE (3) - a user is being voiced
423 .br
424  AC_DEVOICE (4) - a user is being devoiced
425 .br
426  AC_HALFOP (5) - a user is being halfopped
427 .br
428  AC_DEHALFOP (6) - a user is being dehalfopped
429 .br
430  AC_INVITE (7) - a user is being invited
431 .br
432  AC_GENERAL_MODE (8) - a user channel mode is being changed<br>
433 .br
434  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). 
435 .PP
436 \fBParameters:\fP
437 .RS 4
438 \fIsource\fP The source of the access check 
439 .br
440 \fIdest\fP The destination of the access check 
441 .br
442 \fIchannel\fP The channel which is being checked 
443 .br
444 \fIaccess_type\fP See above
445 .RE
446 .PP
447
448 .PP
449 Definition at line 240 of file modules.cpp.
450 .PP
451 References ACR_DEFAULT.
452 .PP
453 .nf
454 240 { return ACR_DEFAULT; };
455 .fi
456 .PP
457 .SS "int Module::OnAddBan (\fBuserrec\fP * source, \fBchanrec\fP * channel, \fBstd::string\fP banmask)\fC [virtual]\fP"
458 .PP
459 Called whenever a ban is added to a channel's list. 
460 .PP
461 Return a non-zero value to 'eat' the mode change and prevent the ban from being added. 
462 .PP
463 \fBParameters:\fP
464 .RS 4
465 \fIsource\fP The user adding the ban 
466 .br
467 \fIchannel\fP The channel the ban is being added to 
468 .br
469 \fIbanmask\fP The ban mask being added 
470 .RE
471 .PP
472 \fBReturns:\fP
473 .RS 4
474 1 to block the ban, 0 to continue as normal
475 .RE
476 .PP
477
478 .PP
479 Definition at line 266 of file modules.cpp.
480 .PP
481 .nf
482 266 { return 0; };
483 .fi
484 .PP
485 .SS "void Module::OnAddELine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP"
486 .PP
487 Called whenever a eline is added by a local user. 
488 .PP
489 This method is triggered after the line is added. 
490 .PP
491 \fBParameters:\fP
492 .RS 4
493 \fIduration\fP The duration of the line in seconds 
494 .br
495 \fIsource\fP The sender of the line 
496 .br
497 \fIreason\fP The reason text to be displayed 
498 .br
499 \fIhostmask\fP The hostmask to add
500 .RE
501 .PP
502
503 .PP
504 Definition at line 292 of file modules.cpp.
505 .PP
506 .nf
507 292 { };
508 .fi
509 .PP
510 .SS "void Module::OnAddGLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP"
511 .PP
512 Called whenever a gline is added by a local user. 
513 .PP
514 This method is triggered after the line is added. 
515 .PP
516 \fBParameters:\fP
517 .RS 4
518 \fIduration\fP The duration of the line in seconds 
519 .br
520 \fIsource\fP The sender of the line 
521 .br
522 \fIreason\fP The reason text to be displayed 
523 .br
524 \fIhostmask\fP The hostmask to add
525 .RE
526 .PP
527
528 .PP
529 Definition at line 288 of file modules.cpp.
530 .PP
531 .nf
532 288 { };
533 .fi
534 .PP
535 .SS "void Module::OnAddKLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP hostmask)\fC [virtual]\fP"
536 .PP
537 Called whenever a kline is added by a local user. 
538 .PP
539 This method is triggered after the line is added. 
540 .PP
541 \fBParameters:\fP
542 .RS 4
543 \fIduration\fP The duration of the line in seconds 
544 .br
545 \fIsource\fP The sender of the line 
546 .br
547 \fIreason\fP The reason text to be displayed 
548 .br
549 \fIhostmask\fP The hostmask to add
550 .RE
551 .PP
552
553 .PP
554 Definition at line 290 of file modules.cpp.
555 .PP
556 .nf
557 290 { };
558 .fi
559 .PP
560 .SS "void Module::OnAddQLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP nickmask)\fC [virtual]\fP"
561 .PP
562 Called whenever a qline is added by a local user. 
563 .PP
564 This method is triggered after the line is added. 
565 .PP
566 \fBParameters:\fP
567 .RS 4
568 \fIduration\fP The duration of the line in seconds 
569 .br
570 \fIsource\fP The sender of the line 
571 .br
572 \fIreason\fP The reason text to be displayed 
573 .br
574 \fInickmask\fP The hostmask to add
575 .RE
576 .PP
577
578 .PP
579 Definition at line 291 of file modules.cpp.
580 .PP
581 .nf
582 291 { };
583 .fi
584 .PP
585 .SS "void Module::OnAddZLine (long duration, \fBuserrec\fP * source, \fBstd::string\fP reason, \fBstd::string\fP ipmask)\fC [virtual]\fP"
586 .PP
587 Called whenever a zline is added by a local user. 
588 .PP
589 This method is triggered after the line is added. 
590 .PP
591 \fBParameters:\fP
592 .RS 4
593 \fIduration\fP The duration of the line in seconds 
594 .br
595 \fIsource\fP The sender of the line 
596 .br
597 \fIreason\fP The reason text to be displayed 
598 .br
599 \fIipmask\fP The hostmask to add
600 .RE
601 .PP
602
603 .PP
604 Definition at line 289 of file modules.cpp.
605 .PP
606 .nf
607 289 { };
608 .fi
609 .PP
610 .SS "void Module::OnBackgroundTimer (time_t curtime)\fC [virtual]\fP"
611 .PP
612 Called once every five seconds for background processing. 
613 .PP
614 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. 
615 .PP
616 \fBParameters:\fP
617 .RS 4
618 \fIcurtime\fP The current timer derived from time(2)
619 .RE
620 .PP
621
622 .PP
623 Definition at line 245 of file modules.cpp.
624 .PP
625 .nf
626 245 { };
627 .fi
628 .PP
629 .SS "void Module::OnChangeHost (\fBuserrec\fP * user, \fBstd::string\fP newhost)\fC [virtual]\fP"
630 .PP
631 Called whenever a user's hostname is changed. 
632 .PP
633 This event triggers after the host has been set. 
634 .PP
635 \fBParameters:\fP
636 .RS 4
637 \fIuser\fP The user whos host is being changed 
638 .br
639 \fInewhost\fP The new hostname being set
640 .RE
641 .PP
642
643 .PP
644 Definition at line 286 of file modules.cpp.
645 .PP
646 .nf
647 286 { };
648 .fi
649 .PP
650 .SS "int Module::OnChangeLocalUserGECOS (\fBuserrec\fP * user, \fBstd::string\fP newhost)\fC [virtual]\fP"
651 .PP
652 Called whenever a change of a local users GECOS (fullname field) is attempted. 
653 .PP
654 return 1 to deny the name change, or 0 to allow it. 
655 .PP
656 \fBParameters:\fP
657 .RS 4
658 \fIuser\fP The user whos GECOS will be changed 
659 .br
660 \fInewhost\fP The new GECOS 
661 .RE
662 .PP
663 \fBReturns:\fP
664 .RS 4
665 1 to deny the GECOS change, 0 to allow
666 .RE
667 .PP
668
669 .PP
670 Definition at line 259 of file modules.cpp.
671 .PP
672 .nf
673 259 { return 0; };
674 .fi
675 .PP
676 .SS "int Module::OnChangeLocalUserHost (\fBuserrec\fP * user, \fBstd::string\fP newhost)\fC [virtual]\fP"
677 .PP
678 Called whenever a change of a local users displayed host is attempted. 
679 .PP
680 Return 1 to deny the host change, or 0 to allow it. 
681 .PP
682 \fBParameters:\fP
683 .RS 4
684 \fIuser\fP The user whos host will be changed 
685 .br
686 \fInewhost\fP The new hostname 
687 .RE
688 .PP
689 \fBReturns:\fP
690 .RS 4
691 1 to deny the host change, 0 to allow
692 .RE
693 .PP
694
695 .PP
696 Definition at line 258 of file modules.cpp.
697 .PP
698 .nf
699 258 { return 0; };
700 .fi
701 .PP
702 .SS "void Module::OnChangeName (\fBuserrec\fP * user, \fBstd::string\fP gecos)\fC [virtual]\fP"
703 .PP
704 Called whenever a user's GECOS (realname) is changed. 
705 .PP
706 This event triggers after the name has been set. 
707 .PP
708 \fBParameters:\fP
709 .RS 4
710 \fIuser\fP The user who's GECOS is being changed 
711 .br
712 \fIgecos\fP The new GECOS being set on the user
713 .RE
714 .PP
715
716 .PP
717 Definition at line 287 of file modules.cpp.
718 .PP
719 .nf
720 287 { };
721 .fi
722 .PP
723 .SS "int Module::OnCheckBan (\fBuserrec\fP * user, \fBchanrec\fP * chan)\fC [virtual]\fP"
724 .PP
725 Called whenever a user joins a channel, to determine if banlist checks should go ahead or not. 
726 .PP
727 This method will always be called for each join, wether or not the user actually matches a channel ban, and determines the outcome of an if statement around the whole section of ban checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. 
728 .PP
729 \fBParameters:\fP
730 .RS 4
731 \fIuser\fP The user joining the channel 
732 .br
733 \fIchan\fP The channel being joined 
734 .RE
735 .PP
736 \fBReturns:\fP
737 .RS 4
738 1 to explicitly allow the join, 0 to proceed as normal
739 .RE
740 .PP
741
742 .PP
743 Definition at line 256 of file modules.cpp.
744 .PP
745 .nf
746 256 { return 0; };
747 .fi
748 .PP
749 .SS "int Module::OnCheckInvite (\fBuserrec\fP * user, \fBchanrec\fP * chan)\fC [virtual]\fP"
750 .PP
751 Called whenever a user joins a channel, to determine if invite checks should go ahead or not. 
752 .PP
753 This method will always be called for each join, wether or not the channel is actually +i, and determines the outcome of an if statement around the whole section of invite checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. 
754 .PP
755 \fBParameters:\fP
756 .RS 4
757 \fIuser\fP The user joining the channel 
758 .br
759 \fIchan\fP The channel being joined 
760 .RE
761 .PP
762 \fBReturns:\fP
763 .RS 4
764 1 to explicitly allow the join, 0 to proceed as normal
765 .RE
766 .PP
767
768 .PP
769 Definition at line 253 of file modules.cpp.
770 .PP
771 .nf
772 253 { return 0; };
773 .fi
774 .PP
775 .SS "int Module::OnCheckKey (\fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP keygiven)\fC [virtual]\fP"
776 .PP
777 Called whenever a user joins a channel, to determine if key checks should go ahead or not. 
778 .PP
779 This method will always be called for each join, wether or not the channel is actually +k, and determines the outcome of an if statement around the whole section of key checking code. if the user specified no key, the keygiven string will be a valid but empty value. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. 
780 .PP
781 \fBParameters:\fP
782 .RS 4
783 \fIuser\fP The user joining the channel 
784 .br
785 \fIchan\fP The channel being joined 
786 .RE
787 .PP
788 \fBReturns:\fP
789 .RS 4
790 1 to explicitly allow the join, 0 to proceed as normal
791 .RE
792 .PP
793
794 .PP
795 Definition at line 254 of file modules.cpp.
796 .PP
797 .nf
798 254 { return 0; };
799 .fi
800 .PP
801 .SS "int Module::OnCheckLimit (\fBuserrec\fP * user, \fBchanrec\fP * chan)\fC [virtual]\fP"
802 .PP
803 Called whenever a user joins a channel, to determine if channel limit checks should go ahead or not. 
804 .PP
805 This method will always be called for each join, wether or not the channel is actually +l, and determines the outcome of an if statement around the whole section of channel limit checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event. 
806 .PP
807 \fBParameters:\fP
808 .RS 4
809 \fIuser\fP The user joining the channel 
810 .br
811 \fIchan\fP The channel being joined 
812 .RE
813 .PP
814 \fBReturns:\fP
815 .RS 4
816 1 to explicitly allow the join, 0 to proceed as normal
817 .RE
818 .PP
819
820 .PP
821 Definition at line 255 of file modules.cpp.
822 .PP
823 .nf
824 255 { return 0; };
825 .fi
826 .PP
827 .SS "bool Module::OnCheckReady (\fBuserrec\fP * user)\fC [virtual]\fP"
828 .PP
829 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. 
830 .PP
831 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. 
832 .PP
833 \fBParameters:\fP
834 .RS 4
835 \fIuser\fP The user to check 
836 .RE
837 .PP
838 \fBReturns:\fP
839 .RS 4
840 true to indicate readiness, false if otherwise
841 .RE
842 .PP
843
844 .PP
845 Definition at line 248 of file modules.cpp.
846 .PP
847 .nf
848 248 { return true; };
849 .fi
850 .PP
851 .SS "void Module::OnCleanup (int target_type, void * item)\fC [virtual]\fP"
852 .PP
853 Called before your module is unloaded to clean up Extensibles. 
854 .PP
855 This method is called once for every user and channel on the network, so that when your module unloads it may clear up any remaining data in the form of Extensibles added using \fBExtensible::Extend()\fP. If the target_type variable is TYPE_USER, then void* item refers to a userrec*, otherwise it refers to a chanrec*. 
856 .PP
857 \fBParameters:\fP
858 .RS 4
859 \fItarget_type\fP The type of item being cleaned 
860 .br
861 \fIitem\fP A pointer to the item's class
862 .RE
863 .PP
864
865 .PP
866 Definition at line 298 of file modules.cpp.
867 .PP
868 .nf
869 298 { };
870 .fi
871 .PP
872 .SS "void Module::OnDecodeMetaData (int target_type, void * target, \fBstd::string\fP extname, \fBstd::string\fP extdata)\fC [virtual]\fP"
873 .PP
874 Allows module data, sent via ProtoSendMetaData, to be decoded again by a receiving module. 
875 .PP
876 Please see src/modules/m_swhois.cpp for a working example of how to use this method call. 
877 .PP
878 \fBParameters:\fP
879 .RS 4
880 \fItarget_type\fP The type of item to decode data for, TYPE_USER or TYPE_CHANNEL 
881 .br
882 \fItarget\fP The chanrec* or userrec* that data should be added to 
883 .br
884 \fIextname\fP The extension name which is being sent 
885 .br
886 \fIextdata\fP The extension data, encoded at the other end by an identical module through OnSyncChannelMetaData or OnSyncUserMetaData
887 .RE
888 .PP
889
890 .PP
891 Definition at line 283 of file modules.cpp.
892 .PP
893 .nf
894 283 { };
895 .fi
896 .PP
897 .SS "int Module::OnDelBan (\fBuserrec\fP * source, \fBchanrec\fP * channel, \fBstd::string\fP banmask)\fC [virtual]\fP"
898 .PP
899 Called whenever a ban is removed from a channel's list. 
900 .PP
901 Return a non-zero value to 'eat' the mode change and prevent the ban from being removed. 
902 .PP
903 \fBParameters:\fP
904 .RS 4
905 \fIsource\fP The user deleting the ban 
906 .br
907 \fIchannel\fP The channel the ban is being deleted from 
908 .br
909 \fIbanmask\fP The ban mask being deleted 
910 .RE
911 .PP
912 \fBReturns:\fP
913 .RS 4
914 1 to block the unban, 0 to continue as normal
915 .RE
916 .PP
917
918 .PP
919 Definition at line 267 of file modules.cpp.
920 .PP
921 .nf
922 267 { return 0; };
923 .fi
924 .PP
925 .SS "void Module::OnDelELine (\fBuserrec\fP * source, \fBstd::string\fP hostmask)\fC [virtual]\fP"
926 .PP
927 Called whenever a eline is deleted. 
928 .PP
929 This method is triggered after the line is deleted. 
930 .PP
931 \fBParameters:\fP
932 .RS 4
933 \fIsource\fP The user removing the line 
934 .br
935 \fIhostmask\fP The hostmask to delete
936 .RE
937 .PP
938
939 .PP
940 Definition at line 297 of file modules.cpp.
941 .PP
942 .nf
943 297 { };
944 .fi
945 .PP
946 .SS "void Module::OnDelGLine (\fBuserrec\fP * source, \fBstd::string\fP hostmask)\fC [virtual]\fP"
947 .PP
948 Called whenever a gline is deleted. 
949 .PP
950 This method is triggered after the line is deleted. 
951 .PP
952 \fBParameters:\fP
953 .RS 4
954 \fIsource\fP The user removing the line 
955 .br
956 \fIhostmask\fP The hostmask to delete
957 .RE
958 .PP
959
960 .PP
961 Definition at line 293 of file modules.cpp.
962 .PP
963 .nf
964 293 { };
965 .fi
966 .PP
967 .SS "void Module::OnDelKLine (\fBuserrec\fP * source, \fBstd::string\fP hostmask)\fC [virtual]\fP"
968 .PP
969 Called whenever a kline is deleted. 
970 .PP
971 This method is triggered after the line is deleted. 
972 .PP
973 \fBParameters:\fP
974 .RS 4
975 \fIsource\fP The user removing the line 
976 .br
977 \fIhostmask\fP The hostmask to delete
978 .RE
979 .PP
980
981 .PP
982 Definition at line 295 of file modules.cpp.
983 .PP
984 .nf
985 295 { };
986 .fi
987 .PP
988 .SS "void Module::OnDelQLine (\fBuserrec\fP * source, \fBstd::string\fP nickmask)\fC [virtual]\fP"
989 .PP
990 Called whenever a qline is deleted. 
991 .PP
992 This method is triggered after the line is deleted. 
993 .PP
994 \fBParameters:\fP
995 .RS 4
996 \fIsource\fP The user removing the line 
997 .br
998 \fIhostmask\fP The hostmask to delete
999 .RE
1000 .PP
1001
1002 .PP
1003 Definition at line 296 of file modules.cpp.
1004 .PP
1005 .nf
1006 296 { };
1007 .fi
1008 .PP
1009 .SS "void Module::OnDelZLine (\fBuserrec\fP * source, \fBstd::string\fP ipmask)\fC [virtual]\fP"
1010 .PP
1011 Called whenever a zline is deleted. 
1012 .PP
1013 This method is triggered after the line is deleted. 
1014 .PP
1015 \fBParameters:\fP
1016 .RS 4
1017 \fIsource\fP The user removing the line 
1018 .br
1019 \fIhostmask\fP The hostmask to delete
1020 .RE
1021 .PP
1022
1023 .PP
1024 Definition at line 294 of file modules.cpp.
1025 .PP
1026 .nf
1027 294 { };
1028 .fi
1029 .PP
1030 .SS "void Module::OnEvent (\fBEvent\fP * event)\fC [virtual]\fP"
1031 .PP
1032 Called whenever an \fBEvent\fP class is sent to all module by another module. 
1033 .PP
1034 Please see the documentation of \fBEvent::Send()\fP for further information. The \fBEvent\fP sent can always be assumed to be non-NULL, you should *always* check the value of \fBEvent::GetEventID()\fP before doing anything to the event data, and you should *not* change the event data in any way! 
1035 .PP
1036 \fBParameters:\fP
1037 .RS 4
1038 \fIevent\fP The \fBEvent\fP class being received
1039 .RE
1040 .PP
1041
1042 .PP
1043 Definition at line 261 of file modules.cpp.
1044 .PP
1045 .nf
1046 261 { return; };
1047 .fi
1048 .PP
1049 .SS "int Module::OnExtendedMode (\fBuserrec\fP * user, void * target, char modechar, int type, bool mode_on, \fBstring_list\fP & params)\fC [virtual]\fP"
1050 .PP
1051 Called whenever an extended mode is to be processed. 
1052 .PP
1053 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. 
1054 .PP
1055 \fBParameters:\fP
1056 .RS 4
1057 \fIuser\fP The user issuing the mode 
1058 .br
1059 \fItarget\fP The user or channel having the mode set on them 
1060 .br
1061 \fImodechar\fP The mode character being set 
1062 .br
1063 \fItype\fP The type of mode (user or channel) being set 
1064 .br
1065 \fImode_on\fP True if the mode is being set, false if it is being unset 
1066 .br
1067 \fIparams\fP A list of parameters for any channel mode (currently supports either 0 or 1 parameters)
1068 .RE
1069 .PP
1070
1071 .PP
1072 Definition at line 229 of file modules.cpp.
1073 .PP
1074 .nf
1075 229 { return false; }
1076 .fi
1077 .PP
1078 .SS "void Module::OnGetServerDescription (\fBstd::string\fP servername, \fBstd::string\fP & description)\fC [virtual]\fP"
1079 .PP
1080 Allows modules to alter or create server descriptions Whenever a module requires a server description, for example for display in WHOIS, this function is called in all modules. 
1081 .PP
1082 You may change or define the description given in \fBstd::string\fP &description. If you do, this description will be shown in the WHOIS fields. 
1083 .PP
1084 \fBParameters:\fP
1085 .RS 4
1086 \fIservername\fP The servername being searched for 
1087 .br
1088 \fIdescription\fP Alterable server description for this server
1089 .RE
1090 .PP
1091
1092 .PP
1093 Definition at line 277 of file modules.cpp.
1094 .PP
1095 .nf
1096 277 { };
1097 .fi
1098 .PP
1099 .SS "void Module::OnGlobalConnect (\fBuserrec\fP * user)\fC [virtual]\fP"
1100 .PP
1101 Called whenever a user connects, anywhere on the network. 
1102 .PP
1103 This event is informational only. You should not change any user information in this event. To do so, use the OnUserConnect method to change the state of local users. 
1104 .PP
1105 \fBParameters:\fP
1106 .RS 4
1107 \fIuser\fP The user who is connecting
1108 .RE
1109 .PP
1110
1111 .PP
1112 Definition at line 265 of file modules.cpp.
1113 .PP
1114 .nf
1115 265 { };
1116 .fi
1117 .PP
1118 .SS "void Module::OnGlobalOper (\fBuserrec\fP * user)\fC [virtual]\fP"
1119 .PP
1120 Called whenever a user is given usermode +o, anywhere on the network. 
1121 .PP
1122 You cannot override this and prevent it from happening as it is already happened and such a task must be performed by another server. You can however bounce modes by sending servermodes out to reverse mode changes. 
1123 .PP
1124 \fBParameters:\fP
1125 .RS 4
1126 \fIuser\fP The user who is opering
1127 .RE
1128 .PP
1129
1130 .PP
1131 Definition at line 264 of file modules.cpp.
1132 .PP
1133 .nf
1134 264 { };
1135 .fi
1136 .PP
1137 .SS "void Module::OnInfo (\fBuserrec\fP * user)\fC [virtual]\fP"
1138 .PP
1139 Called whenever a user types /INFO. 
1140 .PP
1141 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:
1142 .PP
1143 <nick> :information here
1144 .PP
1145 \fBParameters:\fP
1146 .RS 4
1147 \fIuser\fP The user issuing /INFO
1148 .RE
1149 .PP
1150
1151 .PP
1152 Definition at line 233 of file modules.cpp.
1153 .PP
1154 .nf
1155 233 { };
1156 .fi
1157 .PP
1158 .SS "int Module::OnKill (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBstd::string\fP reason)\fC [virtual]\fP"
1159 .PP
1160 Called when a client is disconnected by KILL. 
1161 .PP
1162 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 or remote users. If you do so youre risking race conditions, desyncs and worse! 
1163 .PP
1164 \fBParameters:\fP
1165 .RS 4
1166 \fIsource\fP The user sending the KILL 
1167 .br
1168 \fIdest\fP The user being killed 
1169 .br
1170 \fIreason\fP The kill reason 
1171 .RE
1172 .PP
1173 \fBReturns:\fP
1174 .RS 4
1175 1 to prevent the kill, 0 to allow
1176 .RE
1177 .PP
1178
1179 .PP
1180 Definition at line 242 of file modules.cpp.
1181 .PP
1182 .nf
1183 242 { return 0; };
1184 .fi
1185 .PP
1186 .SS "void Module::OnLoadModule (\fBModule\fP * mod, \fBstd::string\fP name)\fC [virtual]\fP"
1187 .PP
1188 Called whenever a module is loaded. 
1189 .PP
1190 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). 
1191 .PP
1192 \fBParameters:\fP
1193 .RS 4
1194 \fImod\fP A pointer to the new module 
1195 .br
1196 \fIname\fP The new module's filename
1197 .RE
1198 .PP
1199
1200 .PP
1201 Definition at line 243 of file modules.cpp.
1202 .PP
1203 .nf
1204 243 { };
1205 .fi
1206 .PP
1207 .SS "int Module::OnLocalTopicChange (\fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP topic)\fC [virtual]\fP"
1208 .PP
1209 Called whenever a topic is changed by a local user. 
1210 .PP
1211 Return 1 to deny the topic change, or 0 to allow it. 
1212 .PP
1213 \fBParameters:\fP
1214 .RS 4
1215 \fIuser\fP The user changing the topic 
1216 .br
1217 \fIchan\fP The channels who's topic is being changed 
1218 .br
1219 \fItopic\fP The actual topic text 
1220 .br
1221 \fI1\fP to block the topic change, 0 to allow
1222 .RE
1223 .PP
1224
1225 .PP
1226 Definition at line 260 of file modules.cpp.
1227 .PP
1228 .nf
1229 260 { return 0; };
1230 .fi
1231 .PP
1232 .SS "void Module::OnMode (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP text)\fC [virtual]\fP"
1233 .PP
1234 Called after every MODE command sent from a user The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. 
1235 .PP
1236 The text variable contains the remainder of the mode string after the target, e.g. '+wsi' or '+ooo nick1 nick2 nick3'. 
1237 .PP
1238 \fBParameters:\fP
1239 .RS 4
1240 \fIuser\fP The user sending the MODEs 
1241 .br
1242 \fIdest\fP The target of the modes (userrec* or chanrec*) 
1243 .br
1244 \fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) 
1245 .br
1246 \fItext\fP The actual modes and their parameters if any
1247 .RE
1248 .PP
1249
1250 .PP
1251 Definition at line 230 of file modules.cpp.
1252 .PP
1253 .nf
1254 230 { };
1255 .fi
1256 .PP
1257 .SS "void Module::OnOper (\fBuserrec\fP * user, \fBstd::string\fP opertype)\fC [virtual]\fP"
1258 .PP
1259 Called whenever a user opers locally. 
1260 .PP
1261 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. 
1262 .PP
1263 \fBParameters:\fP
1264 .RS 4
1265 \fIuser\fP The user who is opering up 
1266 .br
1267 \fIopertype\fP The opers type name
1268 .RE
1269 .PP
1270
1271 .PP
1272 Definition at line 232 of file modules.cpp.
1273 .PP
1274 .nf
1275 232 { };
1276 .fi
1277 .PP
1278 .SS "int Module::OnOperCompare (\fBstd::string\fP password, \fBstd::string\fP input)\fC [virtual]\fP"
1279 .PP
1280 Called whenever an oper password is to be compared to what a user has input. 
1281 .PP
1282 The password field (from the config file) is in 'password' and is to be compared against 'input'. This method allows for encryption of oper passwords and much more besides. You should return a nonzero value if you want to allow the comparison or zero if you wish to do nothing. 
1283 .PP
1284 \fBParameters:\fP
1285 .RS 4
1286 \fIpassword\fP The oper's password 
1287 .br
1288 \fIinput\fP The password entered 
1289 .RE
1290 .PP
1291 \fBReturns:\fP
1292 .RS 4
1293 1 to match the passwords, 0 to do nothing
1294 .RE
1295 .PP
1296
1297 .PP
1298 Definition at line 263 of file modules.cpp.
1299 .PP
1300 .nf
1301 263 { return 0; };
1302 .fi
1303 .PP
1304 .SS "void Module::OnPostLocalTopicChange (\fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP topic)\fC [virtual]\fP"
1305 .PP
1306 Called whenever a local topic has been changed. 
1307 .PP
1308 To block topic changes you must use OnLocalTopicChange instead. 
1309 .PP
1310 \fBParameters:\fP
1311 .RS 4
1312 \fIuser\fP The user changing the topic 
1313 .br
1314 \fIchan\fP The channels who's topic is being changed 
1315 .br
1316 \fItopic\fP The actual topic text
1317 .RE
1318 .PP
1319
1320 .PP
1321 Definition at line 276 of file modules.cpp.
1322 .PP
1323 .nf
1324 276 { };
1325 .fi
1326 .PP
1327 .SS "int Module::OnPreCommand (\fBstd::string\fP command, char ** parameters, int pcnt, \fBuserrec\fP * user)\fC [virtual]\fP"
1328 .PP
1329 Called whenever any command is about to be executed. 
1330 .PP
1331 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!) 
1332 .PP
1333 \fBParameters:\fP
1334 .RS 4
1335 \fIcommand\fP The command being executed 
1336 .br
1337 \fIparameters\fP An array of array of characters containing the parameters for the command 
1338 .br
1339 \fIpcnt\fP The nuimber of parameters passed to the command 
1340 .br
1341 \fIuser\fP the user issuing the command 
1342 .RE
1343 .PP
1344 \fBReturns:\fP
1345 .RS 4
1346 1 to block the command, 0 to allow
1347 .RE
1348 .PP
1349
1350 .PP
1351 Definition at line 247 of file modules.cpp.
1352 .PP
1353 .nf
1354 247 { return 0; };
1355 .fi
1356 .PP
1357 .SS "int Module::OnRawMode (\fBuserrec\fP * user, \fBchanrec\fP * chan, char mode, \fBstd::string\fP param, bool adding, int pcnt)\fC [virtual]\fP"
1358 .PP
1359 Called whenever a mode character is processed. 
1360 .PP
1361 Return 1 from this function to block the mode character from being processed entirely, so that you may perform your own code instead. Note that this method allows you to override modes defined by other modes, but this is NOT RECOMMENDED! 
1362 .PP
1363 \fBParameters:\fP
1364 .RS 4
1365 \fIuser\fP The user who is sending the mode 
1366 .br
1367 \fIchan\fP The channel the mode is being sent to 
1368 .br
1369 \fImode\fP The mode character being set 
1370 .br
1371 \fIparam\fP The parameter for the mode or an empty string 
1372 .br
1373 \fIadding\fP true of the mode is being added, false if it is being removed 
1374 .br
1375 \fIpcnt\fP The parameter count for the mode (0 or 1) 
1376 .RE
1377 .PP
1378 \fBReturns:\fP
1379 .RS 4
1380 1 to deny the mode, 0 to allow
1381 .RE
1382 .PP
1383
1384 .PP
1385 Definition at line 252 of file modules.cpp.
1386 .PP
1387 .nf
1388 252 { return 0; };
1389 .fi
1390 .PP
1391 .SS "void Module::OnRawSocketAccept (int fd, \fBstd::string\fP ip, int localport)\fC [virtual]\fP"
1392 .PP
1393 Called immediately after any connection is accepted. 
1394 .PP
1395 This is intended for raw socket processing (e.g. modules which wrap the tcp connection within another library) and provides no information relating to a user record as the connection has not been assigned yet. There are no return values from this call as all modules get an opportunity if required to process the connection. 
1396 .PP
1397 \fBParameters:\fP
1398 .RS 4
1399 \fIfd\fP The file descriptor returned from accept() 
1400 .br
1401 \fIip\fP The IP address of the connecting user 
1402 .br
1403 \fIlocalport\fP The local port number the user connected to
1404 .RE
1405 .PP
1406
1407 .PP
1408 Definition at line 268 of file modules.cpp.
1409 .PP
1410 .nf
1411 268 { };
1412 .fi
1413 .PP
1414 .SS "void Module::OnRawSocketClose (int fd)\fC [virtual]\fP"
1415 .PP
1416 Called immediately before any socket is closed. 
1417 .PP
1418 When this event is called, shutdown() has not yet been called on the socket. 
1419 .PP
1420 \fBParameters:\fP
1421 .RS 4
1422 \fIfd\fP The file descriptor of the socket prior to close()
1423 .RE
1424 .PP
1425
1426 .PP
1427 Definition at line 270 of file modules.cpp.
1428 .PP
1429 Referenced by kill_link(), and kill_link_silent().
1430 .PP
1431 .nf
1432 270 { };
1433 .fi
1434 .PP
1435 .SS "int Module::OnRawSocketRead (int fd, char * buffer, unsigned int count, int & readresult)\fC [virtual]\fP"
1436 .PP
1437 Called immediately before any read() operation on a client socket in the core. 
1438 .PP
1439 This occurs AFTER the select() or poll() so there is always data waiting to be read when this event occurs. Your event should return 1 if it has handled the reading itself, which prevents the core just using read(). You should place any data read into buffer, up to but NOT GREATER THAN the value of count. The value of readresult must be identical to an actual result that might be returned from the read() system call, for example, number of bytes read upon success, 0 upon EOF or closed socket, and -1 for error. If your function returns a nonzero value, you MUST set readresult. 
1440 .PP
1441 \fBParameters:\fP
1442 .RS 4
1443 \fIfd\fP The file descriptor of the socket 
1444 .br
1445 \fIbuffer\fP A char* buffer being read to 
1446 .br
1447 \fIcount\fP The size of the buffer 
1448 .br
1449 \fIreadresult\fP The amount of characters read, or 0 
1450 .RE
1451 .PP
1452 \fBReturns:\fP
1453 .RS 4
1454 nonzero if the event was handled, in which case readresult must be valid on exit
1455 .RE
1456 .PP
1457
1458 .PP
1459 Definition at line 271 of file modules.cpp.
1460 .PP
1461 .nf
1462 271 { return 0; };
1463 .fi
1464 .PP
1465 .SS "int Module::OnRawSocketWrite (int fd, char * buffer, int count)\fC [virtual]\fP"
1466 .PP
1467 Called immediately before any write() operation on a user's socket in the core. 
1468 .PP
1469 Because this event is a low level event no user information is associated with it. It is intended for use by modules which may wrap connections within another API such as SSL for example. return a non-zero result if you have handled the write operation, in which case the core will not call write(). 
1470 .PP
1471 \fBParameters:\fP
1472 .RS 4
1473 \fIfd\fP The file descriptor of the socket 
1474 .br
1475 \fIbuffer\fP A char* buffer being written 
1476 .br
1477 \fINumber\fP of characters to write 
1478 .RE
1479 .PP
1480 \fBReturns:\fP
1481 .RS 4
1482 Number of characters actually written or 0 if you didn't handle the operation
1483 .RE
1484 .PP
1485
1486 .PP
1487 Definition at line 269 of file modules.cpp.
1488 .PP
1489 .nf
1490 269 { return 0; };
1491 .fi
1492 .PP
1493 .SS "void Module::OnRehash (\fBstd::string\fP parameter)\fC [virtual]\fP"
1494 .PP
1495 Called on rehash. 
1496 .PP
1497 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. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it. 
1498 .PP
1499 \fBParameters:\fP
1500 .RS 4
1501 \fIparameter\fP The (optional) parameter given to REHASH from the user.
1502 .RE
1503 .PP
1504
1505 .PP
1506 Definition at line 226 of file modules.cpp.
1507 .PP
1508 .nf
1509 226 { }
1510 .fi
1511 .PP
1512 .SS "void Module::OnRemoteKill (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBstd::string\fP reason)\fC [virtual]\fP"
1513 .PP
1514 Called when an oper wants to disconnect a remote user via KILL. 
1515 .PP
1516 \fBParameters:\fP
1517 .RS 4
1518 \fIsource\fP The user sending the KILL 
1519 .br
1520 \fIdest\fP The user being killed 
1521 .br
1522 \fIreason\fP The kill reason
1523 .RE
1524 .PP
1525
1526 .PP
1527 Definition at line 274 of file modules.cpp.
1528 .PP
1529 .nf
1530 274 { };
1531 .fi
1532 .PP
1533 .SS "char * Module::OnRequest (\fBRequest\fP * request)\fC [virtual]\fP"
1534 .PP
1535 Called whenever a \fBRequest\fP class is sent to your module by another module. 
1536 .PP
1537 Please see the documentation of \fBRequest::Send()\fP for further information. The \fBRequest\fP sent can always be assumed to be non-NULL, you should not change the request object or its data. Your method may return arbitary data in the char* result which the requesting module may be able to use for pre-determined purposes (e.g. the results of an SQL query, etc). 
1538 .PP
1539 \fBParameters:\fP
1540 .RS 4
1541 \fIrequest\fP The \fBRequest\fP class being received
1542 .RE
1543 .PP
1544
1545 .PP
1546 Definition at line 262 of file modules.cpp.
1547 .PP
1548 Referenced by Request::Send().
1549 .PP
1550 .nf
1551 262 { return NULL; };
1552 .fi
1553 .PP
1554 .SS "void Module::OnSendList (\fBuserrec\fP * user, \fBchanrec\fP * channel, char mode)\fC [virtual]\fP"
1555 .PP
1556 Called whenever a list is needed for a listmode. 
1557 .PP
1558 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. 
1559 .PP
1560 \fBParameters:\fP
1561 .RS 4
1562 \fIuser\fP The user requesting the list 
1563 .br
1564 \fIchannel\fP The channel the list is for 
1565 .br
1566 \fImode\fP The listmode which a list is being requested on
1567 .RE
1568 .PP
1569
1570 .PP
1571 Definition at line 246 of file modules.cpp.
1572 .PP
1573 .nf
1574 246 { };
1575 .fi
1576 .PP
1577 .SS "void Module::OnServerRaw (\fBstd::string\fP & raw, bool inbound, \fBuserrec\fP * user)\fC [virtual]\fP"
1578 .PP
1579 Called when a raw command is transmitted or received. 
1580 .PP
1581 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. 
1582 .PP
1583 \fBParameters:\fP
1584 .RS 4
1585 \fIraw\fP The raw string in RFC1459 format 
1586 .br
1587 \fIinbound\fP A flag to indicate wether the data is coming into the daemon or going out to the user 
1588 .br
1589 \fIuser\fP The user record sending the text, when inbound == true.
1590 .RE
1591 .PP
1592
1593 .PP
1594 Definition at line 227 of file modules.cpp.
1595 .PP
1596 .nf
1597 227 { }
1598 .fi
1599 .PP
1600 .SS "void Module::OnStats (char symbol)\fC [virtual]\fP"
1601 .PP
1602 Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core. 
1603 .PP
1604 \fBParameters:\fP
1605 .RS 4
1606 \fIsymbol\fP the symbol provided to /STATS
1607 .RE
1608 .PP
1609
1610 .PP
1611 Definition at line 257 of file modules.cpp.
1612 .PP
1613 .nf
1614 257 { };
1615 .fi
1616 .PP
1617 .SS "void Module::OnSyncChannel (\fBchanrec\fP * chan, \fBModule\fP * proto, void * opaque)\fC [virtual]\fP"
1618 .PP
1619 Allows modules to synchronize data which relates to channels during a netburst. 
1620 .PP
1621 When this function is called, it will be called from the module which implements the linking protocol. This currently is m_spanningtree.so. A pointer to this module is given in Module* proto, so that you may call its methods such as ProtoSendMode (see below). This function will be called for every user visible on your side of the burst, allowing you to for example set modes, etc. Do not use this call to synchronize data which you have stored using class \fBExtensible\fP -- There is a specialist function OnSyncUserMetaData and OnSyncChannelMetaData for this!
1622 .PP
1623 For a good example of how to use this function, please see src/modules/m_chanprotect.cpp
1624 .PP
1625 \fBParameters:\fP
1626 .RS 4
1627 \fIchan\fP The channel being syncronized 
1628 .br
1629 \fIproto\fP A pointer to the module handling network protocol 
1630 .br
1631 \fIopaque\fP An opaque pointer set by the protocol module, should not be modified!
1632 .RE
1633 .PP
1634
1635 .PP
1636 Definition at line 279 of file modules.cpp.
1637 .PP
1638 .nf
1639 279 { };
1640 .fi
1641 .PP
1642 .SS "void Module::OnSyncChannelMetaData (\fBchanrec\fP * chan, \fBModule\fP * proto, void * opaque, \fBstd::string\fP extname)\fC [virtual]\fP"
1643 .PP
1644 Definition at line 281 of file modules.cpp.
1645 .PP
1646 .nf
1647 281 { };
1648 .fi
1649 .PP
1650 .SS "void Module::OnSyncUser (\fBuserrec\fP * user, \fBModule\fP * proto, void * opaque)\fC [virtual]\fP"
1651 .PP
1652 Allows modules to synchronize data which relates to users during a netburst. 
1653 .PP
1654 When this function is called, it will be called from the module which implements the linking protocol. This currently is m_spanningtree.so. A pointer to this module is given in Module* proto, so that you may call its methods such as ProtoSendMode (see below). This function will be called for every user visible on your side of the burst, allowing you to for example set modes, etc. Do not use this call to synchronize data which you have stored using class \fBExtensible\fP -- There is a specialist function OnSyncUserMetaData and OnSyncChannelMetaData for this! 
1655 .PP
1656 \fBParameters:\fP
1657 .RS 4
1658 \fIuser\fP The user being syncronized 
1659 .br
1660 \fIproto\fP A pointer to the module handling network protocol 
1661 .br
1662 \fIopaque\fP An opaque pointer set by the protocol module, should not be modified!
1663 .RE
1664 .PP
1665
1666 .PP
1667 Definition at line 278 of file modules.cpp.
1668 .PP
1669 .nf
1670 278 { };
1671 .fi
1672 .PP
1673 .SS "void Module::OnSyncUserMetaData (\fBuserrec\fP * user, \fBModule\fP * proto, void * opaque, \fBstd::string\fP extname)\fC [virtual]\fP"
1674 .PP
1675 Definition at line 282 of file modules.cpp.
1676 .PP
1677 .nf
1678 282 { };
1679 .fi
1680 .PP
1681 .SS "void Module::OnUnloadModule (\fBModule\fP * mod, \fBstd::string\fP name)\fC [virtual]\fP"
1682 .PP
1683 Called whenever a module is unloaded. 
1684 .PP
1685 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). 
1686 .PP
1687 \fBParameters:\fP
1688 .RS 4
1689 \fImod\fP Pointer to the module being unloaded (still valid) 
1690 .br
1691 \fIname\fP The filename of the module being unloaded
1692 .RE
1693 .PP
1694
1695 .PP
1696 Definition at line 244 of file modules.cpp.
1697 .PP
1698 .nf
1699 244 { };
1700 .fi
1701 .PP
1702 .SS "void Module::OnUserConnect (\fBuserrec\fP * user)\fC [virtual]\fP"
1703 .PP
1704 Called when a user connects. 
1705 .PP
1706 The details of the connecting user are available to you in the parameter userrec *user 
1707 .PP
1708 \fBParameters:\fP
1709 .RS 4
1710 \fIuser\fP The user who is connecting
1711 .RE
1712 .PP
1713
1714 .PP
1715 Definition at line 221 of file modules.cpp.
1716 .PP
1717 .nf
1718 221 { }
1719 .fi
1720 .PP
1721 .SS "void Module::OnUserDisconnect (\fBuserrec\fP * user)\fC [virtual]\fP"
1722 .PP
1723 Called whenever a user's socket is closed. 
1724 .PP
1725 The details of the exiting user are available to you in the parameter userrec *user This event is called for all users, registered or not, as a cleanup method for modules which might assign resources to user, such as dns lookups, objects and sockets. 
1726 .PP
1727 \fBParameters:\fP
1728 .RS 4
1729 \fIuser\fP The user who is disconnecting
1730 .RE
1731 .PP
1732
1733 .PP
1734 Definition at line 223 of file modules.cpp.
1735 .PP
1736 .nf
1737 223 { }
1738 .fi
1739 .PP
1740 .SS "void Module::OnUserInvite (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBchanrec\fP * channel)\fC [virtual]\fP"
1741 .PP
1742 Called after a user has been successfully invited to a channel. 
1743 .PP
1744 You cannot prevent the invite from occuring using this function, to do that, use OnUserPreInvite instead. 
1745 .PP
1746 \fBParameters:\fP
1747 .RS 4
1748 \fIsource\fP The user who is issuing the INVITE 
1749 .br
1750 \fIdest\fP The user being invited 
1751 .br
1752 \fIchannel\fP The channel the user is being invited to
1753 .RE
1754 .PP
1755
1756 .PP
1757 Definition at line 275 of file modules.cpp.
1758 .PP
1759 .nf
1760 275 { };
1761 .fi
1762 .PP
1763 .SS "void Module::OnUserJoin (\fBuserrec\fP * user, \fBchanrec\fP * channel)\fC [virtual]\fP"
1764 .PP
1765 Called when a user joins a channel. 
1766 .PP
1767 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 
1768 .PP
1769 \fBParameters:\fP
1770 .RS 4
1771 \fIuser\fP The user who is joining 
1772 .br
1773 \fIchannel\fP The channel being joined
1774 .RE
1775 .PP
1776
1777 .PP
1778 Definition at line 224 of file modules.cpp.
1779 .PP
1780 .nf
1781 224 { }
1782 .fi
1783 .PP
1784 .SS "void Module::OnUserKick (\fBuserrec\fP * source, \fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP reason)\fC [virtual]\fP"
1785 .PP
1786 Called whenever a user is kicked. 
1787 .PP
1788 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. 
1789 .PP
1790 \fBParameters:\fP
1791 .RS 4
1792 \fIsource\fP The user issuing the kick 
1793 .br
1794 \fIuser\fP The user being kicked 
1795 .br
1796 \fIchan\fP The channel the user is being kicked from 
1797 .br
1798 \fIreason\fP The kick reason
1799 .RE
1800 .PP
1801
1802 .PP
1803 Definition at line 251 of file modules.cpp.
1804 .PP
1805 .nf
1806 251 { };
1807 .fi
1808 .PP
1809 .SS "void Module::OnUserMessage (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP text)\fC [virtual]\fP"
1810 .PP
1811 Called after any PRIVMSG sent from a user. 
1812 .PP
1813 The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. 
1814 .PP
1815 \fBParameters:\fP
1816 .RS 4
1817 \fIuser\fP The user sending the message 
1818 .br
1819 \fIdest\fP The target of the message 
1820 .br
1821 \fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) 
1822 .br
1823 \fItext\fP the text being sent by the user
1824 .RE
1825 .PP
1826
1827 .PP
1828 Definition at line 272 of file modules.cpp.
1829 .PP
1830 .nf
1831 272 { };
1832 .fi
1833 .PP
1834 .SS "void Module::OnUserNotice (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP text)\fC [virtual]\fP"
1835 .PP
1836 Called after any NOTICE sent from a user. 
1837 .PP
1838 The dest variable contains a userrec* if target_type is TYPE_USER and a chanrec* if target_type is TYPE_CHANNEL. 
1839 .PP
1840 \fBParameters:\fP
1841 .RS 4
1842 \fIuser\fP The user sending the message 
1843 .br
1844 \fIdest\fP The target of the message 
1845 .br
1846 \fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) 
1847 .br
1848 \fItext\fP the text being sent by the user
1849 .RE
1850 .PP
1851
1852 .PP
1853 Definition at line 273 of file modules.cpp.
1854 .PP
1855 .nf
1856 273 { };
1857 .fi
1858 .PP
1859 .SS "void Module::OnUserPart (\fBuserrec\fP * user, \fBchanrec\fP * channel)\fC [virtual]\fP"
1860 .PP
1861 Called when a user parts a channel. 
1862 .PP
1863 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 
1864 .PP
1865 \fBParameters:\fP
1866 .RS 4
1867 \fIuser\fP The user who is parting 
1868 .br
1869 \fIchannel\fP The channel being parted
1870 .RE
1871 .PP
1872
1873 .PP
1874 Definition at line 225 of file modules.cpp.
1875 .PP
1876 .nf
1877 225 { }
1878 .fi
1879 .PP
1880 .SS "void Module::OnUserPostNick (\fBuserrec\fP * user, \fBstd::string\fP oldnick)\fC [virtual]\fP"
1881 .PP
1882 Called after any nickchange, local or remote. 
1883 .PP
1884 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. 
1885 .PP
1886 \fBParameters:\fP
1887 .RS 4
1888 \fIuser\fP The user changing their nick 
1889 .br
1890 \fIoldnick\fP The old nickname of the user before the nickchange
1891 .RE
1892 .PP
1893
1894 .PP
1895 Definition at line 239 of file modules.cpp.
1896 .PP
1897 .nf
1898 239 { };
1899 .fi
1900 .PP
1901 .SS "int Module::OnUserPreInvite (\fBuserrec\fP * source, \fBuserrec\fP * dest, \fBchanrec\fP * channel)\fC [virtual]\fP"
1902 .PP
1903 Called whenever a user is about to invite another user into a channel, before any processing is done. 
1904 .PP
1905 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. 
1906 .PP
1907 \fBParameters:\fP
1908 .RS 4
1909 \fIsource\fP The user who is issuing the INVITE 
1910 .br
1911 \fIdest\fP The user being invited 
1912 .br
1913 \fIchannel\fP The channel the user is being invited to 
1914 .RE
1915 .PP
1916 \fBReturns:\fP
1917 .RS 4
1918 1 to deny the invite, 0 to allow
1919 .RE
1920 .PP
1921
1922 .PP
1923 Definition at line 235 of file modules.cpp.
1924 .PP
1925 .nf
1926 235 { return 0; };
1927 .fi
1928 .PP
1929 .SS "int Module::OnUserPreJoin (\fBuserrec\fP * user, \fBchanrec\fP * chan, const char * cname)\fC [virtual]\fP"
1930 .PP
1931 Called whenever a user is about to join a channel, before any processing is done. 
1932 .PP
1933 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.
1934 .PP
1935 IMPORTANT NOTE!
1936 .PP
1937 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. 
1938 .PP
1939 \fBParameters:\fP
1940 .RS 4
1941 \fIuser\fP The user joining the channel 
1942 .br
1943 \fIcname\fP The channel name being joined 
1944 .RE
1945 .PP
1946 \fBReturns:\fP
1947 .RS 4
1948 1 To prevent the join, 0 to allow it.
1949 .RE
1950 .PP
1951
1952 .PP
1953 Definition at line 228 of file modules.cpp.
1954 .PP
1955 .nf
1956 228 { return 0; }
1957 .fi
1958 .PP
1959 .SS "int Module::OnUserPreKick (\fBuserrec\fP * source, \fBuserrec\fP * user, \fBchanrec\fP * chan, \fBstd::string\fP reason)\fC [virtual]\fP"
1960 .PP
1961 Called whenever a user is about to be kicked. 
1962 .PP
1963 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. 
1964 .PP
1965 \fBParameters:\fP
1966 .RS 4
1967 \fIsource\fP The user issuing the kick 
1968 .br
1969 \fIuser\fP The user being kicked 
1970 .br
1971 \fIchan\fP The channel the user is being kicked from 
1972 .br
1973 \fIreason\fP The kick reason 
1974 .RE
1975 .PP
1976 \fBReturns:\fP
1977 .RS 4
1978 1 to prevent the kick, 0 to allow it
1979 .RE
1980 .PP
1981
1982 .PP
1983 Definition at line 250 of file modules.cpp.
1984 .PP
1985 .nf
1986 250 { return 0; };
1987 .fi
1988 .PP
1989 .SS "int Module::OnUserPreMessage (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP & text)\fC [virtual]\fP"
1990 .PP
1991 Called whenever a user is about to PRIVMSG A user or a channel, before any processing is done. 
1992 .PP
1993 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. 
1994 .PP
1995 \fBParameters:\fP
1996 .RS 4
1997 \fIuser\fP The user sending the message 
1998 .br
1999 \fIdest\fP The target of the message (chanrec* or userrec*) 
2000 .br
2001 \fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) 
2002 .br
2003 \fItext\fP Changeable text being sent by the user 
2004 .RE
2005 .PP
2006 \fBReturns:\fP
2007 .RS 4
2008 1 to deny the NOTICE, 0 to allow it
2009 .RE
2010 .PP
2011
2012 .PP
2013 Definition at line 236 of file modules.cpp.
2014 .PP
2015 .nf
2016 236 { return 0; };
2017 .fi
2018 .PP
2019 .SS "int Module::OnUserPreNick (\fBuserrec\fP * user, \fBstd::string\fP newnick)\fC [virtual]\fP"
2020 .PP
2021 Called before any nickchange, local or remote. 
2022 .PP
2023 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. 
2024 .PP
2025 \fBParameters:\fP
2026 .RS 4
2027 \fIuser\fP The username changing their nick 
2028 .br
2029 \fInewnick\fP Their new nickname 
2030 .RE
2031 .PP
2032 \fBReturns:\fP
2033 .RS 4
2034 1 to deny the change, 0 to allow
2035 .RE
2036 .PP
2037
2038 .PP
2039 Definition at line 238 of file modules.cpp.
2040 .PP
2041 .nf
2042 238 { return 0; };
2043 .fi
2044 .PP
2045 .SS "int Module::OnUserPreNotice (\fBuserrec\fP * user, void * dest, int target_type, \fBstd::string\fP & text)\fC [virtual]\fP"
2046 .PP
2047 Called whenever a user is about to NOTICE A user or a channel, before any processing is done. 
2048 .PP
2049 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. 
2050 .PP
2051 \fBParameters:\fP
2052 .RS 4
2053 \fIuser\fP The user sending the message 
2054 .br
2055 \fIdest\fP The target of the message (chanrec* or userrec*) 
2056 .br
2057 \fItarget_type\fP The type of target (TYPE_USER or TYPE_CHANNEL) 
2058 .br
2059 \fItext\fP Changeable text being sent by the user 
2060 .RE
2061 .PP
2062 \fBReturns:\fP
2063 .RS 4
2064 1 to deny the NOTICE, 0 to allow it
2065 .RE
2066 .PP
2067
2068 .PP
2069 Definition at line 237 of file modules.cpp.
2070 .PP
2071 .nf
2072 237 { return 0; };
2073 .fi
2074 .PP
2075 .SS "void Module::OnUserQuit (\fBuserrec\fP * user, \fBstd::string\fP message)\fC [virtual]\fP"
2076 .PP
2077 Called when a user quits. 
2078 .PP
2079 The details of the exiting user are available to you in the parameter userrec *user This event is only called when the user is fully registered when they quit. To catch raw disconnections, use the OnUserDisconnect method. 
2080 .PP
2081 \fBParameters:\fP
2082 .RS 4
2083 \fIuser\fP The user who is quitting 
2084 .br
2085 \fImessage\fP The user's quit message
2086 .RE
2087 .PP
2088
2089 .PP
2090 Definition at line 222 of file modules.cpp.
2091 .PP
2092 .nf
2093 222 { }
2094 .fi
2095 .PP
2096 .SS "void Module::OnUserRegister (\fBuserrec\fP * user)\fC [virtual]\fP"
2097 .PP
2098 Called whenever a user is about to register their connection (e.g. 
2099 .PP
2100 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. 
2101 .PP
2102 \fBParameters:\fP
2103 .RS 4
2104 \fIuser\fP The user registering
2105 .RE
2106 .PP
2107
2108 .PP
2109 Definition at line 249 of file modules.cpp.
2110 .PP
2111 .nf
2112 249 { };
2113 .fi
2114 .PP
2115 .SS "void Module::OnWallops (\fBuserrec\fP * user, \fBstd::string\fP text)\fC [virtual]\fP"
2116 .PP
2117 Called after every WALLOPS command. 
2118 .PP
2119 \fBParameters:\fP
2120 .RS 4
2121 \fIuser\fP The user sending the WALLOPS 
2122 .br
2123 \fItext\fP The content of the WALLOPS message
2124 .RE
2125 .PP
2126
2127 .PP
2128 Definition at line 285 of file modules.cpp.
2129 .PP
2130 .nf
2131 285 { };
2132 .fi
2133 .PP
2134 .SS "void Module::OnWhois (\fBuserrec\fP * source, \fBuserrec\fP * dest)\fC [virtual]\fP"
2135 .PP
2136 Called whenever a /WHOIS is performed on a local user. 
2137 .PP
2138 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. 
2139 .PP
2140 \fBParameters:\fP
2141 .RS 4
2142 \fIsource\fP The user issuing the WHOIS command 
2143 .br
2144 \fIdest\fP The user who is being WHOISed
2145 .RE
2146 .PP
2147
2148 .PP
2149 Definition at line 234 of file modules.cpp.
2150 .PP
2151 .nf
2152 234 { };
2153 .fi
2154 .PP
2155 .SS "void Module::ProtoSendMetaData (void * opaque, int target_type, void * target, \fBstd::string\fP extname, \fBstd::string\fP extdata)\fC [virtual]\fP"
2156 .PP
2157 Implemented by modules which provide the ability to link servers. 
2158 .PP
2159 These modules will implement this method, which allows metadata (extra data added to user and channel records using class \fBExtensible\fP, \fBExtensible::Extend\fP, etc) to be sent to other servers on a netburst and decoded at the other end by the same module on a different server.
2160 .PP
2161 More documentation to follow soon. Please see src/modules/m_swhois.cpp for example of how to use this function. 
2162 .PP
2163 \fBParameters:\fP
2164 .RS 4
2165 \fIopaque\fP An opaque pointer set by the protocol module, should not be modified! 
2166 .br
2167 \fItarget_type\fP The type of item to decode data for, TYPE_USER or TYPE_CHANNEL 
2168 .br
2169 \fItarget\fP The chanrec* or userrec* that metadata should be sent for 
2170 .br
2171 \fIextname\fP The extension name to send metadata for 
2172 .br
2173 \fIextdata\fP Encoded data for this extension name, which will be encoded at the oppsite end by an identical module using OnDecodeMetaData
2174 .RE
2175 .PP
2176
2177 .PP
2178 Definition at line 284 of file modules.cpp.
2179 .PP
2180 .nf
2181 284 { };
2182 .fi
2183 .PP
2184 .SS "void Module::ProtoSendMode (void * opaque, int target_type, void * target, \fBstd::string\fP modeline)\fC [virtual]\fP"
2185 .PP
2186 Implemented by modules which provide the ability to link servers. 
2187 .PP
2188 These modules will implement this method, which allows transparent sending of servermodes down the network link as a broadcast, without a module calling it having to know the format of the MODE command before the actual mode string.
2189 .PP
2190 More documentation to follow soon. Please see src/modules/m_chanprotect.cpp for examples of how to use this function.
2191 .PP
2192 \fBParameters:\fP
2193 .RS 4
2194 \fIopaque\fP An opaque pointer set by the protocol module, should not be modified! 
2195 .br
2196 \fItarget_type\fP The type of item to decode data for, TYPE_USER or TYPE_CHANNEL 
2197 .br
2198 \fItarget\fP The chanrec* or userrec* that modes should be sent for 
2199 .br
2200 \fImodeline\fP The modes and parameters to be sent
2201 .RE
2202 .PP
2203
2204 .PP
2205 Definition at line 280 of file modules.cpp.
2206 .PP
2207 .nf
2208 280 { };
2209 .fi
2210 .PP
2211
2212
2213 .SH "Author"
2214 .PP 
2215 Generated automatically by Doxygen for InspIRCd from the source code.