1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 04:43:13 +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
+7 -7
View File
@@ -28,40 +28,40 @@ class CommandOSKick : 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 if (!(u2 = finduser(nick)))
{
notice_lang(Config.s_OperServ, u, NICK_X_NOT_IN_USE, nick.c_str());
notice_lang(Config->s_OperServ, u, NICK_X_NOT_IN_USE, nick.c_str());
return MOD_CONT;
}
c->Kick(OperServ, u2, "%s (%s)", u->nick.c_str(), s.c_str());
if (Config.WallOSKick)
if (Config->WallOSKick)
ircdproto->SendGlobops(OperServ, "%s used KICK on %s/%s", u->nick.c_str(), u2->nick.c_str(), chan.c_str());
return MOD_CONT;
}
bool OnHelp(User *u, const Anope::string &subcommand)
{
notice_help(Config.s_OperServ, u, OPER_HELP_KICK);
notice_help(Config->s_OperServ, u, OPER_HELP_KICK);
return true;
}
void OnSyntaxError(User *u, const Anope::string &subcommand)
{
syntax_error(Config.s_OperServ, u, "KICK", OPER_KICK_SYNTAX);
syntax_error(Config->s_OperServ, u, "KICK", OPER_KICK_SYNTAX);
}
void OnServHelp(User *u)
{
notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_KICK);
notice_lang(Config->s_OperServ, u, OPER_HELP_CMD_KICK);
}
};