1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 07:26:38 +02:00

Rewrote the config reader to better handle invalid configs.

This prevents Anope from exploding when /os reload has errors.
This commit is contained in:
Adam
2010-08-17 19:27:37 -04:00
parent 2575008baa
commit e65d8b2f3d
195 changed files with 3133 additions and 3249 deletions
+8 -8
View File
@@ -30,12 +30,12 @@ class CommandOSClearModes : public Command
if (!(c = findchan(chan)))
{
notice_lang(Config.s_OperServ, u, CHAN_X_NOT_IN_USE, chan.c_str());
notice_lang(Config->s_OperServ, u, CHAN_X_NOT_IN_USE, chan.c_str());
return MOD_CONT;
}
else if (c->bouncy_modes)
{
notice_lang(Config.s_OperServ, u, OPER_BOUNCY_MODES_U_LINE);
notice_lang(Config->s_OperServ, u, OPER_BOUNCY_MODES_U_LINE);
return MOD_CONT;
}
else
@@ -52,7 +52,7 @@ class CommandOSClearModes : public Command
}
}
if (Config.WallOSClearmodes)
if (Config->WallOSClearmodes)
ircdproto->SendGlobops(OperServ, "%s used CLEARMODES%s on %s", u->nick.c_str(), all ? " ALL" : "", chan.c_str());
if (all)
{
@@ -148,27 +148,27 @@ class CommandOSClearModes : public Command
}
if (all)
notice_lang(Config.s_OperServ, u, OPER_CLEARMODES_ALL_DONE, chan.c_str());
notice_lang(Config->s_OperServ, u, OPER_CLEARMODES_ALL_DONE, chan.c_str());
else
notice_lang(Config.s_OperServ, u, OPER_CLEARMODES_DONE, chan.c_str());
notice_lang(Config->s_OperServ, u, OPER_CLEARMODES_DONE, chan.c_str());
return MOD_CONT;
}
bool OnHelp(User *u, const Anope::string &subcommand)
{
notice_help(Config.s_OperServ, u, OPER_HELP_CLEARMODES);
notice_help(Config->s_OperServ, u, OPER_HELP_CLEARMODES);
return true;
}
void OnSyntaxError(User *u, const Anope::string &subcommand)
{
syntax_error(Config.s_OperServ, u, "CLEARMODES", OPER_CLEARMODES_SYNTAX);
syntax_error(Config->s_OperServ, u, "CLEARMODES", OPER_CLEARMODES_SYNTAX);
}
void OnServHelp(User *u)
{
notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_CLEARMODES);
notice_lang(Config->s_OperServ, u, OPER_HELP_CMD_CLEARMODES);
}
};