From 5fbe0c845c00161fd62e1f2f65354553f42ef831 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 28 Aug 2010 02:25:33 -0400 Subject: Clean up some of the old now unused IRCDVar struct vars, and made the logchan bots join if the IRCd requires them to --- docs/IRCD | 140 ++++++++++++++++++++++---------------------------------------- 1 file changed, 50 insertions(+), 90 deletions(-) (limited to 'docs') diff --git a/docs/IRCD b/docs/IRCD index ad81c97f1..81b1482e5 100644 --- a/docs/IRCD +++ b/docs/IRCD @@ -26,32 +26,9 @@ How To Add IRCd Support than the one you used as a base. This section covers the majority of the code that is in use. - The first bit of code you will face is the IRCDVar structure, which is - explained in depth in the next section. - - Scroll down to the bottom and find the class for this module and rename it - to something reflecting your IRCd name. Find the function: - - pmodule_ircd_version("Unreal 3.2+"); - - This is the protocol name which will appear in various places; especially - when you do -version at the command prompt, this is where you state the - server name. The version is not always needed unless you are showing that - the support is for one branch of a ircd family, such as Unreal 3.1 and - Unreal 3.2. - - The next task that you will face is setting whether the IRCD sends time - stamps on modes but does not tell us that it will do so. If it does, set - UseTSMODE to 1; if it does not set it to be 0. If you're not sure refer - to your IRCd's documentation on how MODE is sent. - - pmodule_ircd_useTSMode(0); - -3) The IRCDVar struct - - Now you've come to the part where you setup your ircd. There are two - structs which hold this information; This allows you to quickly setup - your specific ircd. + The first bit of code you will face is the IRCDVar structure, This is one + of two structs which holds your IRCd information; This allows you to quickly + setup your specific ircd. IRCDVar myIrcd[] = { }; @@ -74,118 +51,103 @@ How To Add IRCd Support remember to count each possible mode, so +ov is 2. - 4) Channelmode for bots: When a BotServ bot joins a channel, this is the - mode set on them. Normally you will want them - opped (+o), and protected (+a) on IRCd's that - support it. - - 5) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise, + 4) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise, KILL is used. Use 1 for yes, 0 for no. - 6) VHOST: Can a user's host be changed on the fly? Enabling this allow + 5) VHOST: Can a user's host be changed on the fly? Enabling this allow HostServ online. Use 1 for yes, 0 for no. - 7) SNLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes, + 6) SNLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes, 0 for no. - 8) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no. - - 9) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no. + 7) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no. - 10) Number of Server Args: When an IRCd connects, this is the number of - parameters that are passed. + 8) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no. - 11) Join to Set: Services must join a channel to set any modes on that + 10) Join to Set: Services must join a channel to set any modes on that channel. Use 1 for yes, 0 for no. - 12) Join to Message: Services must join a channel to send any message to + 11) Join to Message: Services must join a channel to send any message to that channel (cannot override +n). Use 1 for yes, 0 for no. - 13) TS Topic Forward: Some IRCd's (like UnrealIRCd) like their topic TS + 12) TS Topic Forward: Some IRCd's (like UnrealIRCd) like their topic TS set forward by +1. Use 1 for yes, 0 for no. - 14) TS Topic Backward: Some IRCd's (mainly older DreamForge-like ones) + 13) TS Topic Backward: Some IRCd's (mainly older DreamForge-like ones) like their topic TS set back by -1. Use 1 for yes, 0 for no. - 15) SQline Channels: The IRCd's supports banning channel names via + 14) SQline Channels: The IRCd's supports banning channel names via SQLINES. Use 1 for yes, 0 for no. - 16) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a + 15) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a QUIT message for that user? Use 1 for yes, 0 for no. - 17) SVSMODE -b: We can use SVSMODE to unban hosts from a channel. Use + 16) SVSMODE -b: We can use SVSMODE to unban hosts from a channel. Use 1 for yes, 0 for no. - 18) Reverse: We can do a reverse check when unbanning. For use with + 17) Reverse: We can do a reverse check when unbanning. For use with DreamForge based IRCd's. Use 1 for yes, 0 for no. - 19) vIdent: Support for including a user's ident in their vHost. Use + 18) vIdent: Support for including a user's ident in their vHost. Use 1 for yes, 0 for no. - 20) SVSHOLD: Support for temporarily 'holding' a nick, instead of using + 19) SVSHOLD: Support for temporarily 'holding' a nick, instead of using a nick enforcer client. Use 1 for yes, 0 for no. - 21) TS on MODE: We need to send a timestamp when modes are being changed. + 20) TS on MODE: We need to send a timestamp when modes are being changed. Use 1 for yes, 0 for no. - 22) NICKIP: The IP address of new users is being sent along with their + 21) NICKIP: The IP address of new users is being sent along with their hostname when new users are being introduced on the network. Use 1 for yes, 0 for no. - 23) OMODE: We can use OperServ to give some user a temporary O:LINE. + 22) OMODE: We can use OperServ to give some user a temporary O:LINE. Use 1 for yes, 0 for no. - 24) Umode: We can use OperServ to change a user's mode. Use 1 for yes, + 23) Umode: We can use OperServ to change a user's mode. Use 1 for yes, 0 for no. - 25) Vhost On Nick: On NICK the IRCd sends the VHOST. Use 1 for yes, + 24) Vhost On Nick: On NICK the IRCd sends the VHOST. Use 1 for yes, 0 for no. - 26) Change Realname: Change real name. Use 1 for yes, 0 for no. - - 27) Check Nick ID: Should we check if a user should remain identified when + 25) Check Nick ID: Should we check if a user should remain identified when changing their nick? This is for IRCd's that remove their registered-user mode when someone changes their nick (like Bahamut does). Use 1 for yes, 0 for no. - 28) No Knock Requires +i: Does the No Knock channel mode require invite + 26) No Knock Requires +i: Does the No Knock channel mode require invite only channels? Use 1 for yes, 0 for no. - 29) Chan Modes: If sent in CAPAB/PROTOCOL, we store it in here. This is - NULL by default. - - 30) Tokens: Can we use tokens to talk to the IRCd? Use 1 for yes, + 27) Tokens: Can we use tokens to talk to the IRCd? Use 1 for yes, 0 for no. - 31) base64 SJOIN TS: Are the timestamps sent with a SJOIN in base64? Use + 28) base64 SJOIN TS: Are the timestamps sent with a SJOIN in base64? Use 1 for yes, 0 for no. - 32) SJOIN Ban Char: Character used to identify bans. Use ''. + 29) SJOIN Ban Char: Character used to identify bans. Use ''. - 33) SJOIN Except Char: Character used to identify exceptions. Use ''. + 30) SJOIN Except Char: Character used to identify exceptions. Use ''. - 34) SJOIN Invite char: Character used to idenfity invexs. Use ''. + 31) SJOIN Invite char: Character used to idenfity invexs. Use ''. - 35) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use + 32) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use 1 for yes, 0 for no. - 36) SGline Enforce: Does the IRCd enforce SNLINES for us or do we need to + 33) SGline Enforce: Does the IRCd enforce SNLINES for us or do we need to do so? Use 1 for yes, 0 for no. - 37) Vhost Character: The character used to represent the vHost mode, if + 34) Vhost Character: The character used to represent the vHost mode, if this is supported by the IRCd. - 38) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no. + 35) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no. - 39) P10: Is this IRCd a P10-style IRCd? Use 1 for yes, 0 for no. - - 40) Character Set: Unreal passes the character set during PROTOCTL, + 36) Character Set: Unreal passes the character set during PROTOCTL, the value is stored here. Set this NULL to start. - 41) Channel CIDR: Set to 1 if channel bans, excepts and invites + 37) Channel CIDR: Set to 1 if channel bans, excepts and invites support CIDR masks. Expected syntax: *!*@ip/mask. When set to 1, anope will only parse strict CIDR masks. IRCd's that try to correct invalid CIDR's (like nefarious) @@ -193,21 +155,21 @@ How To Add IRCd Support Contact the anope Dev Team if this is the case. Set to 0 if CIDR's are not supported by your IRCd. - 42) Global TLD Prefix: Prefix used to send global messages, should probably + 38) Global TLD Prefix: Prefix used to send global messages, should probably be "$" - 43) Max Modes: The max number of mode changes we can send in one line + 39) Max Modes: The max number of mode changes we can send in one line -4) Modes +3) Modes Anope is told about modes in the moduleAddModes() function. For the most part, the syntax for adding channel and user modes are: - ModeManager::AddUserMode(new UserMode(UMODE_NETADMIN, 'N')); + ModeManager::AddUserMode(new UserMode(UMODE_NETADMIN, "UMODE_NETADMIN", 'N')); Where 'N' is the char for the mode, and UMODE_NETADMIN shows what the mode does. Or: - ModeManager::AddChannelMode(new ChannelMode(CMODE_BLOCKCOLOR, 'c')); + ModeManager::AddChannelMode(new ChannelMode(CMODE_BLOCKCOLOR, "CMODE_BLOCKCOLOR", 'c')); Where 'c' is the char for the mode and CMODE_BLOCKCOLOR shows what the mode does @@ -220,7 +182,7 @@ How To Add IRCd Support arg of ChannelModeParam to false if the param should NOT be sent when unsetting it. Eg: - ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, 'j', true)); + ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, "CMODE_JOINFLOOD", 'j', true)); Anope will internally track the params, and they can be retrieved through Channel::GetParam(); @@ -238,22 +200,21 @@ How To Add IRCd Support valid parameters accepted across IRCds, your protocol module MUST have the IsValid function for this. - bool ChannelModeFlood::IsValid(const std::string &value) { } + bool ChannelModeFlood::IsValid(const Anope::string &value) { } -5) Functions and Events +4) Functions and Events A brief word about functions and events. All events are captured using: void moduleAddIRCDMsgs(void) { - m = createMessage("NICK", anope_event_nick); - addCoreMessage(IRCD,m); + Anope::AddMessage("NICK", anope_event_nick); } Each event should have a event handler if its important enough to be processed by services. All event functions should be formed like this: - int anope_event_capab(char *source, int ac, char **av) + int anope_event_nick(char *source, int ac, char **av) { return MOD_CONT; } @@ -276,7 +237,7 @@ How To Add IRCd Support should eventually come to a send_cmd(); this root function is how commands are sent to the IRCd. -6) CAPAB/PROTOCTL +5) CAPAB/PROTOCTL Most IRCD send a CAPAB or PROTOCTL line so that they can work out what the other end of the connection is capable of doing. Anope has a function @@ -344,9 +305,8 @@ How To Add IRCd Support A) In the function module constructor make sure that you have the following two lines: - - m = createMessage("CAPAB", anope_event_capab); - addCoreMessage(IRCD,m); + + Anope::AddMessage("CAPAB", anope_event_capab); B) Add the function to handle the event @@ -359,7 +319,7 @@ How To Add IRCd Support This function should call the CapabParse function which parses the received CAPAB/PROTOCTL line. -7) IRCDProto Class +6) IRCDProto Class The IRCDProto class is set up like: -- cgit