diff options
author | Adam <Adam@anope.org> | 2010-08-17 19:27:37 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-08-17 19:27:37 -0400 |
commit | e65d8b2f3dfdb40858259b3bb48ef6998c31e62f (patch) | |
tree | fd845bdef5664d025ab19c262ae2c5e9d23d7bb2 /modules/core/cs_set_persist.cpp | |
parent | 2575008baa5c9d0ca789680da1a3b81dc74786f7 (diff) |
Rewrote the config reader to better handle invalid configs.
This prevents Anope from exploding when /os reload has errors.
Diffstat (limited to 'modules/core/cs_set_persist.cpp')
-rw-r--r-- | modules/core/cs_set_persist.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/core/cs_set_persist.cpp b/modules/core/cs_set_persist.cpp index 076cca95b..fe3c84242 100644 --- a/modules/core/cs_set_persist.cpp +++ b/modules/core/cs_set_persist.cpp @@ -44,7 +44,7 @@ class CommandCSSetPersist : public Command /* No botserv bot, no channel mode */ /* Give them ChanServ - * Yes, this works fine with no Config.s_BotServ + * Yes, this works fine with no Config->s_BotServ */ if (!ci->bi && !cm) { @@ -58,7 +58,7 @@ class CommandCSSetPersist : public Command ci->c->SetMode(NULL, cm); } - notice_lang(Config.s_ChanServ, u, CHAN_SET_PERSIST_ON, ci->name.c_str()); + notice_lang(Config->s_ChanServ, u, CHAN_SET_PERSIST_ON, ci->name.c_str()); } else if (params[1].equals_ci("OFF")) { @@ -73,12 +73,12 @@ class CommandCSSetPersist : public Command /* No channel mode, no BotServ, but using ChanServ as the botserv bot * which was assigned when persist was set on */ - if (!cm && Config.s_BotServ.empty() && ci->bi) + if (!cm && Config->s_BotServ.empty() && ci->bi) /* Unassign bot */ ChanServ->UnAssign(NULL, ci); } - notice_lang(Config.s_ChanServ, u, CHAN_SET_PERSIST_OFF, ci->name.c_str()); + notice_lang(Config->s_ChanServ, u, CHAN_SET_PERSIST_OFF, ci->name.c_str()); } else this->OnSyntaxError(u, "PERSIST"); @@ -88,18 +88,18 @@ class CommandCSSetPersist : public Command bool OnHelp(User *u, const Anope::string &) { - notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_PERSIST, "SET"); + notice_help(Config->s_ChanServ, u, CHAN_HELP_SET_PERSIST, "SET"); return true; } void OnSyntaxError(User *u, const Anope::string &) { - syntax_error(Config.s_ChanServ, u, "SET PERSIST", CHAN_SET_PERSIST_SYNTAX); + syntax_error(Config->s_ChanServ, u, "SET PERSIST", CHAN_SET_PERSIST_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config.s_ChanServ, u, CHAN_HELP_CMD_SET_PERSIST); + notice_lang(Config->s_ChanServ, u, CHAN_HELP_CMD_SET_PERSIST); } }; @@ -112,13 +112,13 @@ class CommandCSSASetPersist : public CommandCSSetPersist bool OnHelp(User *u, const Anope::string &) { - notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_PERSIST, "SASET"); + notice_help(Config->s_ChanServ, u, CHAN_HELP_SET_PERSIST, "SASET"); return true; } void OnSyntaxError(User *u, const Anope::string &) { - syntax_error(Config.s_ChanServ, u, "SASET PERSIST", CHAN_SASET_PERSIST_SYNTAX); + syntax_error(Config->s_ChanServ, u, "SASET PERSIST", CHAN_SASET_PERSIST_SYNTAX); } }; |