1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 21:06:39 +02:00

Clean up some of the old now unused IRCDVar struct vars, and made the logchan bots join if the IRCd requires them to

This commit is contained in:
Adam
2010-08-28 02:25:33 -04:00
parent 2aac8b05ef
commit 5fbe0c845c
15 changed files with 81 additions and 185 deletions
+2 -1
View File
@@ -572,7 +572,8 @@ log
logage = 7
/*
* Enable to have the core services clients join and stay in the log channel(s) when logging
* Enable to have the core services clients join and stay in the log channel(s) when logging.
* Note on some IRCds this is not optional, and is enforced on.
*/
inhabitlogchannel = yes
+50 -90
View File
@@ -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.
7) 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.
8) SZLINE: Does the IRCd support SZLINES? 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.
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:
-5
View File
@@ -22,7 +22,6 @@ E void ModuleRunTimeDirCleanUp();
/* IRC Variables */
E IRCDVar *ircd;
E int UseTSMODE; /* hack to get around bahamut clones that don't send TSMODE */
E IRCDProto *ircdproto;
/**** actions.c ****/
@@ -159,8 +158,6 @@ E Uplink *uplink_server;
/**** ircd.c ****/
E void pmodule_ircd_proto(IRCDProto *);
E void pmodule_ircd_var(IRCDVar *ircdvar);
E void pmodule_ircd_version(const Anope::string &version);
E void pmodule_ircd_useTSMode(int use);
/**** language.c ****/
@@ -181,8 +178,6 @@ E void InitLogChannels(ServerConfig *);
/**** main.c ****/
E Anope::string version_protocol;
E Anope::string services_dir;
E Anope::string log_filename;
E int debug;
-5
View File
@@ -441,13 +441,11 @@ struct IRCDVar
const char *name; /* Name of the IRCd command */
const char *pseudoclient_mode; /* Mode used by BotServ Bots */
int max_symbols; /* Chan Max Symbols */
const char *botchanumode; /* Modes set when botserv joins a channel */
int svsnick; /* Supports SVSNICK */
int vhost; /* Supports vhost */
int snline; /* Supports SNline */
int sqline; /* Supports SQline */
int szline; /* Supports SZline */
int numservargs; /* Number of Server Args */
int join2set; /* Join 2 Set Modes */
int join2msg; /* Join 2 Message */
int topictsforward; /* TS on Topics Forward */
@@ -463,13 +461,10 @@ struct IRCDVar
int omode; /* On the fly o:lines */
int umode; /* change user modes */
int nickvhost; /* Users vhost sent during NICK */
int chgreal; /* Change RealName */
int knock_needs_i; /* Check if we needed +i when setting NOKNOCK */
int token; /* Does Anope support the tokens for the ircd */
int svsmode_ucmode; /* Can remove User Channel Modes with SVSMODE */
int sglineenforce;
int ts6; /* ircd is TS6 */
int p10; /* ircd is P10 */
int cidrchanbei; /* channel bans/excepts/invites support CIDR (syntax: +b *!*@192.168.0.0/15)
* 0 for no support, 1 for strict cidr support, anything else
* for ircd specific support (nefarious only cares about first /mask) */
+1 -8
View File
@@ -16,15 +16,13 @@
IRCDVar myIrcd[] = {
{"Bahamut 1.8.x", /* ircd name */
"+", /* Modes used by pseudoclients */
"+", /* Modes used by pseudoclients */
2, /* Chan Max Symbols */
"+o", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
0, /* Vhost */
1, /* Supports SNlines */
1, /* Supports SQlines */
1, /* Supports SZlines */
3, /* Number of server args */
0, /* Join 2 Set */
0, /* Join 2 Message */
0, /* TS Topic Forward */
@@ -40,13 +38,10 @@ IRCDVar myIrcd[] = {
0, /* O:LINE */
1, /* UMODE */
0, /* VHOST ON NICK */
0, /* Change RealName */
1, /* No Knock requires +i */
0, /* We support TOKENS */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
0, /* ts6 */
0, /* p10 */
0, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
6, /* Max number of modes we can send per line */
@@ -772,9 +767,7 @@ class ProtoBahamut : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
pmodule_ircd_version("BahamutIRCd 1.4.*/1.8.*");
pmodule_ircd_var(myIrcd);
pmodule_ircd_useTSMode(0);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_TSMODE, CAPAB_UNCONNECT, CAPAB_BURST, CAPAB_DKEY, CAPAB_DOZIP };
for (unsigned i = 0; i < 6; ++i)
-7
View File
@@ -19,13 +19,11 @@ IRCDVar myIrcd[] = {
{"InspIRCd 1.1", /* ircd name */
"+I", /* Modes used by pseudoclients */
5, /* Chan Max Symbols */
"+ao", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
1, /* Supports SNlines */
1, /* Supports SQlines */
1, /* Supports SZlines */
4, /* Number of server args */
0, /* Join 2 Set */
1, /* Join 2 Message */
1, /* TS Topic Forward */
@@ -41,13 +39,10 @@ IRCDVar myIrcd[] = {
1, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
0, /* Change RealName */
1, /* No Knock requires +i */
0, /* We support inspircd TOKENS */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
0, /* ts6 */
0, /* p10 */
1, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
20, /* Max number of modes we can send per line */
@@ -1092,9 +1087,7 @@ class ProtoInspIRCd : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
pmodule_ircd_version("InspIRCd 1.1");
pmodule_ircd_var(myIrcd);
pmodule_ircd_useTSMode(0);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT };
for (unsigned i = 0; i < 5; ++i)
-7
View File
@@ -19,13 +19,11 @@ IRCDVar myIrcd[] = {
{"InspIRCd 1.2", /* ircd name */
"+I", /* Modes used by pseudoclients */
5, /* Chan Max Symbols */
"+ao", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
0, /* Supports SNlines */
1, /* Supports SQlines */
1, /* Supports SZlines */
4, /* Number of server args */
0, /* Join 2 Set */
0, /* Join 2 Message */
1, /* TS Topic Forward */
@@ -41,13 +39,10 @@ IRCDVar myIrcd[] = {
0, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
0, /* Change RealName */
1, /* No Knock requires +i */
0, /* We support inspircd TOKENS */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
1, /* ts6 */
0, /* p10 */
1, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
20, /* Max number of modes we can send per line */
@@ -1270,9 +1265,7 @@ class ProtoInspIRCd : public Module
if (!Config->Numeric.empty())
TS6SID = Config->Numeric;
pmodule_ircd_version("InspIRCd 1.2");
pmodule_ircd_var(myIrcd);
pmodule_ircd_useTSMode(0);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT };
for (unsigned i = 0; i < 5; ++i)
-7
View File
@@ -19,13 +19,11 @@ IRCDVar myIrcd[] = {
{"InspIRCd 2.0", /* ircd name */
"+I", /* Modes used by pseudoclients */
5, /* Chan Max Symbols */
"+ao", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
0, /* Supports SNlines */
1, /* Supports SQlines */
1, /* Supports SZlines */
4, /* Number of server args */
0, /* Join 2 Set */
0, /* Join 2 Message */
1, /* TS Topic Forward */
@@ -41,13 +39,10 @@ IRCDVar myIrcd[] = {
0, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
0, /* Change RealName */
1, /* No Knock requires +i */
0, /* We support inspircd TOKENS */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
1, /* ts6 */
0, /* p10 */
1, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
20, /* Max number of modes we can send per line */
@@ -1244,9 +1239,7 @@ class ProtoInspIRCd : public Module
if (!Config->Numeric.empty())
TS6SID = Config->Numeric;
pmodule_ircd_version("InspIRCd 2.0");
pmodule_ircd_var(myIrcd);
pmodule_ircd_useTSMode(0);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT };
for (unsigned i = 0; i < 5; ++i)
+2 -10
View File
@@ -18,13 +18,11 @@ IRCDVar myIrcd[] = {
{"Ratbox 2.0+", /* ircd name */
"+oi", /* Modes used by pseudoclients */
2, /* Chan Max Symbols */
"+o", /* Channel Umode used by Botserv bots */
0, /* SVSNICK */
0, /* Vhost */
1, /* Supports SNlines */
1, /* Supports SQlines */
0, /* Supports SZlines */
3, /* Number of server args */
1, /* Join 2 Set */
1, /* Join 2 Message */
0, /* TS Topic Forward */
@@ -40,13 +38,10 @@ IRCDVar myIrcd[] = {
0, /* UMODE */
0, /* O:LINE */
0, /* VHOST ON NICK */
0, /* Change RealName */
0, /* No Knock requires +i */
0, /* We support TOKENS */
0, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
1, /* ts6 */
0, /* p10 */
0, /* CIDR channelbans */
"$$", /* TLD Prefix for Global */
4, /* Max number of modes we can send per line */
@@ -793,14 +788,11 @@ class ProtoRatbox : public Module
if (!Config->Numeric.empty())
TS6SID = Config->Numeric;
UseTSMODE = 1; /* TMODE */
pmodule_ircd_version("Ratbox IRCD 2.0+");
pmodule_ircd_var(myIrcd);
pmodule_ircd_useTSMode(1);
CapabType c[] = { CAPAB_ZIP, CAPAB_TS5, CAPAB_QS, CAPAB_UID, CAPAB_KNOCK };
for (unsigned i = 0; i < 5; ++i)
CapabType c[] = { CAPAB_ZIP, CAPAB_TS5, CAPAB_QS, CAPAB_UID, CAPAB_KNOCK, CAPAB_TSMODE };
for (unsigned i = 0; i < 6; ++i)
Capab.SetFlag(c[i]);
AddModes();
-7
View File
@@ -18,13 +18,11 @@ IRCDVar myIrcd[] = {
{"UnrealIRCd 3.2.x", /* ircd name */
"+Soi", /* Modes used by pseudoclients */
5, /* Chan Max Symbols */
"+ao", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
1, /* Supports SNlines */
1, /* Supports SQlines */
1, /* Supports SZlines */
3, /* Number of server args */
0, /* Join 2 Set */
0, /* Join 2 Message */
1, /* TS Topic Forward */
@@ -40,13 +38,10 @@ IRCDVar myIrcd[] = {
1, /* O:LINE */
1, /* UMODE */
1, /* VHOST ON NICK */
1, /* Change RealName */
1, /* No Knock requires +i */
1, /* We support Unreal TOKENS */
1, /* Can remove User Channel Modes with SVSMODE */
0, /* Sglines are not enforced until user reconnects */
0, /* ts6 */
0, /* p10 */
0, /* CIDR channelbans */
"$", /* TLD Prefix for Global */
12, /* Max number of modes we can send per line */
@@ -1265,9 +1260,7 @@ class ProtoUnreal : public Module
this->SetAuthor("Anope");
this->SetType(PROTOCOL);
pmodule_ircd_version("UnrealIRCd 3.2+");
pmodule_ircd_var(myIrcd);
pmodule_ircd_useTSMode(0);
CapabType c[] = { CAPAB_NOQUIT, CAPAB_NICKIP, CAPAB_ZIP, CAPAB_TOKEN, CAPAB_SSJ3, CAPAB_NICK2, CAPAB_VL, CAPAB_TLKEXT, CAPAB_CHANMODE, CAPAB_NICKCHARS };
for (unsigned i = 0; i < 10; ++i)
+1 -1
View File
@@ -1252,7 +1252,7 @@ void do_cmode(const Anope::string &source, int ac, const char **av)
unsigned i, end;
const char *t;
if (Capab.HasFlag(CAPAB_TSMODE) || UseTSMODE)
if (Capab.HasFlag(CAPAB_TSMODE))
{
for (i = 0, end = strlen(av[1]); i < end; ++i)
if (!isdigit(av[1][i]))
+20 -22
View File
@@ -835,33 +835,30 @@ bool InitLogs(ServerConfig *config, const Anope::string &)
{
LogInfo *l = config->LogInfos[i];
if (l->Inhabit)
for (std::list<Anope::string>::const_iterator sit = l->Targets.begin(), sit_end = l->Targets.end(); sit != sit_end; ++sit)
{
for (std::list<Anope::string>::const_iterator sit = l->Targets.begin(), sit_end = l->Targets.end(); sit != sit_end; ++sit)
const Anope::string &target = *sit;
if (target[0] == '#')
{
const Anope::string &target = *sit;
if (target[0] == '#')
Channel *c = findchan(target);
if (c && c->HasFlag(CH_LOGCHAN))
{
Channel *c = findchan(target);
if (c && c->HasFlag(CH_LOGCHAN))
for (CUserList::const_iterator cit = c->users.begin(), cit_end = c->users.end(); cit != cit_end; ++cit)
{
for (CUserList::const_iterator cit = c->users.begin(), cit_end = c->users.end(); cit != cit_end; ++cit)
UserContainer *uc = *cit;
BotInfo *bi = findbot(uc->user->nick);
if (bi && bi->HasFlag(BI_CORE))
{
UserContainer *uc = *cit;
BotInfo *bi = findbot(uc->user->nick);
if (bi && bi->HasFlag(BI_CORE))
{
bi->Part(c, "Reloading");
}
bi->Part(c, "Reloading configuration");
}
c->UnsetFlag(CH_PERSIST);
c->UnsetFlag(CH_LOGCHAN);
if (c->users.empty())
delete c;
}
c->UnsetFlag(CH_PERSIST);
c->UnsetFlag(CH_LOGCHAN);
if (c->users.empty())
delete c;
}
}
}
@@ -875,7 +872,7 @@ bool InitLogs(ServerConfig *config, const Anope::string &)
bool DoLogs(ServerConfig *config, const Anope::string &, const Anope::string *, ValueList &values, int *)
{
//{"target", "source", "logage", "admin", "override", "commands", "servers", "channels", "users", "normal", "rawio", "debug"},
//{"target", "source", "logage", "inhabit", "admin", "override", "commands", "servers", "channels", "users", "normal", "rawio", "debug"},
Anope::string targets = values[0].GetValue();
ValueItem vi(targets);
if (!ValidateNotEmpty(config, "log", "target", vi))
@@ -911,7 +908,8 @@ bool DoLogs(ServerConfig *config, const Anope::string &, const Anope::string *,
bool DoneLogs(ServerConfig *config, const Anope::string &)
{
InitLogChannels(config);
if (ircd)
InitLogChannels(config);
Log() << "Loaded " << config->LogInfos.size() << " log blocks";
+4 -3
View File
@@ -54,8 +54,6 @@ void introduce_user(const Anope::string &user)
/* Load MLock from the database now that we know what modes exist */
for (registered_channel_map::iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it)
it->second->LoadMLock();
/* Setup log chanels */
InitLogChannels(Config);
}
}
@@ -355,6 +353,9 @@ void Init(int ac, char **av)
if (!Config->s_GlobalNoticer.empty())
new BotInfo(Config->s_GlobalNoticer, Config->ServiceUser, Config->ServiceHost, Config->desc_GlobalNoticer);
/* Init the log channels */
InitLogChannels(Config);
/* Add Encryption Modules */
ModuleManager::LoadModuleList(Config->EncModuleList);
@@ -404,7 +405,7 @@ void Init(int ac, char **av)
write_pidfile();
/* Announce ourselves to the logfile. */
Log() << "Anope " << Anope::Version() << " (ircd protocol: " << version_protocol << ") starting up" << (debug || readonly ? " (options:" : "") << (debug ? " debug" : "") << (readonly ? " readonly" : "") << (debug || readonly ? ")" : "");
Log() << "Anope " << Anope::Version() << " (ircd protocol: " << ircd->name << ") starting up" << (debug || readonly ? " (options:" : "") << (debug ? " debug" : "") << (readonly ? " readonly" : "") << (debug || readonly ? ")" : "");
start_time = time(NULL);
/* Set signal handlers. Catch certain signals to let us do things or
-11
View File
@@ -18,8 +18,6 @@ IRCDProto *ircdproto;
* Globals we want from the protocol file
**/
IRCDVar *ircd;
Anope::string version_protocol;
int UseTSMODE;
void pmodule_ircd_proto(IRCDProto *proto)
{
@@ -34,12 +32,3 @@ void pmodule_ircd_var(IRCDVar *ircdvar)
ircd = ircdvar;
}
void pmodule_ircd_version(const Anope::string &version)
{
version_protocol = version;
}
void pmodule_ircd_useTSMode(int use)
{
UseTSMODE = use;
}
+1 -1
View File
@@ -17,7 +17,7 @@ void InitLogChannels(ServerConfig *config)
{
LogInfo *l = config->LogInfos[i];
if (!l->Inhabit)
if (!ircd->join2msg && !l->Inhabit)
continue;
for (std::list<Anope::string>::const_iterator sit = l->Targets.begin(), sit_end = l->Targets.end(); sit != sit_end; ++sit)