1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 04:03: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
+7 -7
View File
@@ -35,7 +35,7 @@ class CommandOSChanList : public Command
if (!pattern.empty() && (u2 = finduser(pattern)))
{
notice_lang(Config.s_OperServ, u, OPER_CHANLIST_HEADER_USER, u2->nick.c_str());
notice_lang(Config->s_OperServ, u, OPER_CHANLIST_HEADER_USER, u2->nick.c_str());
for (UChannelList::iterator uit = u2->chans.begin(), uit_end = u2->chans.end(); uit != uit_end; ++uit)
{
@@ -46,12 +46,12 @@ class CommandOSChanList : public Command
if (!cc->chan->HasMode(*it))
continue;
notice_lang(Config.s_OperServ, u, OPER_CHANLIST_RECORD, cc->chan->name.c_str(), cc->chan->users.size(), chan_get_modes(cc->chan, 1, 1).c_str(), !cc->chan->topic.empty() ? cc->chan->topic.c_str() : "");
notice_lang(Config->s_OperServ, u, OPER_CHANLIST_RECORD, cc->chan->name.c_str(), cc->chan->users.size(), chan_get_modes(cc->chan, 1, 1).c_str(), !cc->chan->topic.empty() ? cc->chan->topic.c_str() : "");
}
}
else
{
notice_lang(Config.s_OperServ, u, OPER_CHANLIST_HEADER);
notice_lang(Config->s_OperServ, u, OPER_CHANLIST_HEADER);
for (channel_map::const_iterator cit = ChannelList.begin(), cit_end = ChannelList.end(); cit != cit_end; ++cit)
{
@@ -64,23 +64,23 @@ class CommandOSChanList : public Command
if (!c->HasMode(*it))
continue;
notice_lang(Config.s_OperServ, u, OPER_CHANLIST_RECORD, c->name.c_str(), c->users.size(), chan_get_modes(c, 1, 1).c_str(), !c->topic.empty() ? c->topic.c_str() : "");
notice_lang(Config->s_OperServ, u, OPER_CHANLIST_RECORD, c->name.c_str(), c->users.size(), chan_get_modes(c, 1, 1).c_str(), !c->topic.empty() ? c->topic.c_str() : "");
}
}
notice_lang(Config.s_OperServ, u, OPER_CHANLIST_END);
notice_lang(Config->s_OperServ, u, OPER_CHANLIST_END);
return MOD_CONT;
}
bool OnHelp(User *u, const Anope::string &subcommand)
{
notice_help(Config.s_OperServ, u, OPER_HELP_CHANLIST);
notice_help(Config->s_OperServ, u, OPER_HELP_CHANLIST);
return true;
}
void OnServHelp(User *u)
{
notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_CHANLIST);
notice_lang(Config->s_OperServ, u, OPER_HELP_CMD_CHANLIST);
}
};