mirror of
https://github.com/anope/anope.git
synced 2026-07-01 01:46:39 +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:
@@ -65,12 +65,12 @@ class CommandNSSetHide : public Command
|
||||
if (arg.equals_ci("ON"))
|
||||
{
|
||||
nc->SetFlag(flag);
|
||||
notice_lang(Config.s_NickServ, u, onmsg, nc->display.c_str(), Config.s_NickServ.c_str());
|
||||
notice_lang(Config->s_NickServ, u, onmsg, nc->display.c_str(), Config->s_NickServ.c_str());
|
||||
}
|
||||
else if (arg.equals_ci("OFF"))
|
||||
{
|
||||
nc->UnsetFlag(flag);
|
||||
notice_lang(Config.s_NickServ, u, offmsg, nc->display.c_str(), Config.s_NickServ.c_str());
|
||||
notice_lang(Config->s_NickServ, u, offmsg, nc->display.c_str(), Config->s_NickServ.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(u, "HIDE");
|
||||
@@ -80,18 +80,18 @@ class CommandNSSetHide : public Command
|
||||
|
||||
bool OnHelp(User *u, const Anope::string &)
|
||||
{
|
||||
notice_help(Config.s_NickServ, u, NICK_HELP_SET_HIDE);
|
||||
notice_help(Config->s_NickServ, u, NICK_HELP_SET_HIDE);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u, const Anope::string &)
|
||||
{
|
||||
syntax_error(Config.s_NickServ, u, "SET HIDE", NICK_SET_HIDE_SYNTAX);
|
||||
syntax_error(Config->s_NickServ, u, "SET HIDE", NICK_SET_HIDE_SYNTAX);
|
||||
}
|
||||
|
||||
void OnServHelp(User *u)
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_SET_HIDE);
|
||||
notice_lang(Config->s_NickServ, u, NICK_HELP_CMD_SET_HIDE);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -104,18 +104,18 @@ class CommandNSSASetHide : public CommandNSSetHide
|
||||
|
||||
bool OnHelp(User *u, const Anope::string &)
|
||||
{
|
||||
notice_help(Config.s_NickServ, u, NICK_HELP_SASET_HIDE);
|
||||
notice_help(Config->s_NickServ, u, NICK_HELP_SASET_HIDE);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnSyntaxError(User *u, const Anope::string &)
|
||||
{
|
||||
syntax_error(Config.s_NickServ, u, "SASET HIDE", NICK_SASET_HIDE_SYNTAX);
|
||||
syntax_error(Config->s_NickServ, u, "SASET HIDE", NICK_SASET_HIDE_SYNTAX);
|
||||
}
|
||||
|
||||
void OnServHelp(User *u)
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_SASET_HIDE);
|
||||
notice_lang(Config->s_NickServ, u, NICK_HELP_CMD_SASET_HIDE);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user