1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 22:43:12 +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
+9 -9
View File
@@ -28,19 +28,19 @@ class CommandOSOLine : public Command
/* let's check whether the user is online */
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());
else if (u2 && flag[0] == '+')
{
ircdproto->SendSVSO(Config.s_OperServ, nick, flag);
ircdproto->SendSVSO(Config->s_OperServ, nick, flag);
u2->SetMode(OperServ, UMODE_OPER);
notice_lang(Config.s_OperServ, u2, OPER_OLINE_IRCOP);
notice_lang(Config.s_OperServ, u, OPER_OLINE_SUCCESS, flag.c_str(), nick.c_str());
notice_lang(Config->s_OperServ, u2, OPER_OLINE_IRCOP);
notice_lang(Config->s_OperServ, u, OPER_OLINE_SUCCESS, flag.c_str(), nick.c_str());
ircdproto->SendGlobops(OperServ, "\2%s\2 used OLINE for %s", u->nick.c_str(), nick.c_str());
}
else if (u2 && flag[0] == '-')
{
ircdproto->SendSVSO(Config.s_OperServ, nick, flag);
notice_lang(Config.s_OperServ, u, OPER_OLINE_SUCCESS, flag.c_str(), nick.c_str());
ircdproto->SendSVSO(Config->s_OperServ, nick, flag);
notice_lang(Config->s_OperServ, u, OPER_OLINE_SUCCESS, flag.c_str(), nick.c_str());
ircdproto->SendGlobops(OperServ, "\2%s\2 used OLINE for %s", u->nick.c_str(), nick.c_str());
}
else
@@ -50,18 +50,18 @@ class CommandOSOLine : public Command
bool OnHelp(User *u, const Anope::string &subcommand)
{
notice_help(Config.s_OperServ, u, OPER_HELP_OLINE);
notice_help(Config->s_OperServ, u, OPER_HELP_OLINE);
return true;
}
void OnSyntaxError(User *u, const Anope::string &subcommand)
{
syntax_error(Config.s_OperServ, u, "OLINE", OPER_OLINE_SYNTAX);
syntax_error(Config->s_OperServ, u, "OLINE", OPER_OLINE_SYNTAX);
}
void OnServHelp(User *u)
{
notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_OLINE);
notice_lang(Config->s_OperServ, u, OPER_HELP_CMD_OLINE);
}
};