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_help.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_help.cpp')
-rw-r--r-- | modules/core/cs_help.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/core/cs_help.cpp b/modules/core/cs_help.cpp index 168c5fa07..2d012fbf6 100644 --- a/modules/core/cs_help.cpp +++ b/modules/core/cs_help.cpp @@ -29,7 +29,7 @@ class CommandCSHelp : public Command if (cmd.equals_ci("LEVELS DESC")) { int i; - notice_help(Config.s_ChanServ, u, CHAN_HELP_LEVELS_DESC); + notice_help(Config->s_ChanServ, u, CHAN_HELP_LEVELS_DESC); if (!levelinfo_maxwidth) for (i = 0; levelinfo[i].what >= 0; ++i) { @@ -38,7 +38,7 @@ class CommandCSHelp : public Command levelinfo_maxwidth = len; } for (i = 0; levelinfo[i].what >= 0; ++i) - notice_help(Config.s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name.c_str(), getstring(u, levelinfo[i].desc)); + notice_help(Config->s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name.c_str(), getstring(u, levelinfo[i].desc)); } else mod_help_cmd(ChanServ, u, cmd); @@ -48,14 +48,14 @@ class CommandCSHelp : public Command void OnSyntaxError(User *u, const Anope::string &subcommand) { - notice_help(Config.s_ChanServ, u, CHAN_HELP); + notice_help(Config->s_ChanServ, u, CHAN_HELP); for (CommandMap::const_iterator it = ChanServ->Commands.begin(); it != ChanServ->Commands.end(); ++it) - if (!Config.HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) + if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) it->second->OnServHelp(u); - if (Config.CSExpire >= 86400) - notice_help(Config.s_ChanServ, u, CHAN_HELP_EXPIRES, Config.CSExpire / 86400); + if (Config->CSExpire >= 86400) + notice_help(Config->s_ChanServ, u, CHAN_HELP_EXPIRES, Config->CSExpire / 86400); if (u->Account() && u->Account()->IsServicesOper()) - notice_help(Config.s_ChanServ, u, CHAN_SERVADMIN_HELP); + notice_help(Config->s_ChanServ, u, CHAN_SERVADMIN_HELP); } }; |