Modules:QuickList:Pseudoclients
From Anope Wiki
Contents |
Pseudoclients
You can introduce your own pseudoclients if the functionality you want to add doesn't fit in one of the existing pseudoclients. This page only handles the concepts of introducing and removing pseudoclients, take a look at Modules:QuickList:CommandTables for information on handling commands for your newly introduced pseudoclient.
Note that all commands for creating pseudoclients send out a SQLINE for the given nick if the IRCd supports it, unless noted otherwise.
anope_cmd_nick
Introduce a pseudoclient.
void anope_cmd_nick(char *nick, char *name char *modes)
This command provides a simple way to introduce a new pseudoclient. The nick is the nickname of the new pseudoclient you want to create and the name should contain the real name of the new pseudoclient. In modes, you specify the modes of the new pseudoclient. It is usually best to re-use the modes of an existing pseudoclient here, because it is ircd-dependent. Pass ircd->nickservmode to copy the modes from NickServ.
anope_cmd_bot_nick
Introduce a pseudoclient with a non-default user or host.
void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes)
This command allows control over the user and host when introducing a new pseudoclient. The nick contains the nickname, user contains the new pseudoclient's user (also called 'ident'), and host contains the wanted host. In real, you specify the wanted realname, and modes contains the modes for the new pseudoclient.
The default services user is ServiceUser and the default services host is ServiceHost. If you want to keep both values default, please use anope_cmd_nick instead of anope_cmd_bot_nick.
anope_cmd_quit
Remove a pseudoclient from the network.
void anope_cmd_quit(char *source, char *fmt, ...)
This command sends a QUIT message from the given source, effectively removing the pseudoclient from the network. A reason for the QUIT can be given printf-style as fmt; set this to NULL to give no reason.
NOTE: You should ALWAYS use anope_cmd_quit to remove your pseudoclient from the network when you no longer need it (unloading the module for example). Otherwise you will end up with a ghost pseudoclient on the network doing essentially nothing.
Example
#include <module.h>
char *s_ExampleServ = "ExampleServ";
int AnopeInit(int argc, char **argv)
{
anope_cmd_nick(s_ExampleServ, "Example Service", ircd->nickservmode);
return MOD_CONT;
}
void AnopeFini(void)
{
anope_cmd_quit(s_ExampleServ, "Out Of Service");
}

