fakeclients patch lee -at- leeh.co.uk ------------------- This is against ircd-ratbox-1.5-3, and should be safe for hubs. Hook events are added before modules are loaded, so the services modules do not require any special ordering of loading. The patch requires the ircd is compiled with ENABLE_FAKE_CLIENTS defined, the easiest way to do this is to add "#define ENABLE_FAKE_CLIENTS" to include/setup.h CREATION -------- CLIENT: fake_p = create_fake_client(nick, username, host, gecos, opered); nick|username|host|gecos are strings, opered is an int SERVER: fake_p = create_fake_server(name, gecos, persist); name|gecos are strings, persist is an int, determining whether we reintroduce this server on squit DESTRUCTION ----------- CLIENT: destroy_fake_client(client_p); A quit will be issued for the client being destroyed. SERVER: destroy_fake_server(client_p, issue_squit); If issue_squit (int) is present, an SQUIT will be issued. HOOKS ----- "fake_message": Takes struct h_fake_message_data *hd as parameters. Called when a message to a service is detected. (struct Client *)hd->target_p: the service being messaged. (const char *)hd->message: the message (int)hd->direct: 1 for "nick", 0 for "user@server" (int)hd->notice: 1 for "NOTICE", 0 for "PRIVMSG" "fake_kill": Takes struct Client *target_p as parameters. Called when a service is KILLed by an oper. The service has already been reintroduced to the network when this hook is called. (struct Client *)target_p: the service being killed. "fake_skill": Takes struct Client *target_p as parameters. Called when a service is KILLed by a server. The service has already been reintroduced to the network when this hook is called. It is recommended that handlers track the amount of kills, to watch out for service fights. (struct Client *)target_p: the service being killed "fake_collision": Takes struct Client *target_p as parameters. Called when a service is collided. The service has already been reintroduced to the network when this hook is called. It is recommended that handlers track the amount of collisions, to watch out for service fights. (struct Client *)target_p: the service being collided "fake_squit": Takes struct Client *target_p as parameters. Called when a fake server is squit. If the fake server was marked to persist, this hook is called after the server has been reintroduced. If the fake server was not marked to persist, the handler *MUST* remove references to it, as the fake server will be destroyed after this hook is called. (struct Client *)target_p: the fake service being squit