ircd-ratbox/ircd-ratbox-3.0.10/doc/hooks.txt

93 lines
2.9 KiB
Plaintext
Raw Normal View History

2023-08-20 17:26:10 +00:00
Hook documentation - <lee -at- leeh.co.uk>
------------------------------------------
Documentation on how to actually develop code to use hooks is contained in
contrib/example_module.c, this document simply describes which hooks are
available.
There are various hook structures available that may be passed to hooks:
hook_data - struct Client *client; const void *arg1;
const void *arg2;
hook_data_int - struct Client *client; const void *arg1; int arg2;
hook_data_client - struct Client *client; struct Client *target;
hook_data_channel - struct Client *client; struct Channel *chptr;
Spy Hooks
---------
The following spy hooks are called only when the request is handled by the
local server. They will not be called if the command is being sent remotely
for another server to handle:
"doing_admin" - Passes hook_data:
hdata->client = client requesting ADMIN
"doing_info" - Passes hook_data:
hdata->client = client requesting INFO
"doing_links" - Passes hook_data:
hdata->client = client doing LINKS
(const char *) hdata->arg1 = optional mask
"doing_motd" - Passes hook_data:
hdata->client = client doing MOTD
"doing_stats" - Passes hook_data_int:
hdata->client = client doing STATS
(const char *) hdata->arg1 = optional stats l target
(char) hdata->arg2 = statchar being requested
"doing_stats_p" - Passes hook_data:
hdata->client = client doing STATS p
"doing_trace" - Passes hook_data_client:
hdata->client = client doing TRACE
hdata->target = optional target of TRACE
"doing_whois" - Passes hook_data_client:
hdata->client = local client doing WHOIS
hdata->target = target of WHOIS
"doing_whois_global" - Passes hook_data_client:
hdata->client = remote client doing WHOIS
hdata->target = target of WHOIS
Netburst Hooks
--------------
The following burst hooks are called when we are sending a netburst to a
server.
"burst_client" - Sent after we have just burst a user.
Passes hook_data_client:
hdata->client = server we are bursting to
hdata->target = user we have just burst
"burst_channel" - Sent after we have just burst a channel.
Passes hook_data_channel:
hdata->client = server we are bursting to
hdata->chptr = channel we have just burst
"burst_finished" - Sent after we have just finished bursting users/chans
Passes hook_data_client:
hdata->client = server we are bursting to
Server Hooks
------------
The following hooks are called during server connects/exits.
"server_introduced" - Sent after a server is introduced to the network,
local or remote.
Passes hook_data_client:
hdata->client = uplink server (&me if local)
hdata->target = server being introduced
The following are for debugging and take struct hook_io_data for arguments.
These can be used for a variety of purposes, but are aimed at the developer
community.
"iosend"
"iorecv"
"iorecvctrl"
$Id: hooks.txt 23020 2006-09-01 18:20:19Z androsyn $