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/extra/db_mysql.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/extra/db_mysql.cpp')
-rw-r--r-- | modules/extra/db_mysql.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp index e93abba10..0e7c89bdc 100644 --- a/modules/extra/db_mysql.cpp +++ b/modules/extra/db_mysql.cpp @@ -298,13 +298,13 @@ class CommandSQLSync : public Command bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_OperServ, u, OPER_HELP_SYNC); + notice_help(Config->s_OperServ, u, OPER_HELP_SYNC); return true; } void OnServHelp(User *u) { - notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_SQLSYNC); + notice_lang(Config->s_OperServ, u, OPER_HELP_CMD_SQLSYNC); } }; @@ -347,7 +347,7 @@ class DBMySQL : public Module { time_t now = time(NULL); - if (now - Config.UpdateTimeout > lastwarn) + if (now - Config->UpdateTimeout > lastwarn) { ircdproto->SendGlobops(OperServ, "Unable to locate SQL reference, is m_mysql loaded? Going to readonly..."); readonly = this->ro = true; @@ -935,7 +935,7 @@ class DBMySQL : public Module void OnPostCommand(User *u, const Anope::string &service, const Anope::string &command, const std::vector<Anope::string> ¶ms) { - if (service == Config.s_NickServ) + if (service == Config->s_NickServ) { if (u->Account() && ((command.equals_ci("SET") && !params.empty()) || (command.equals_ci("SASET") && u->Account()->HasCommand("nickserv/saset") && params.size() > 1))) { @@ -965,7 +965,7 @@ class DBMySQL : public Module } } } - else if (service == Config.s_ChanServ) + else if (service == Config->s_ChanServ) { if (command.equals_ci("SET") && u->Account() && params.size() > 1) { @@ -1006,7 +1006,7 @@ class DBMySQL : public Module } } } - else if (service == Config.s_BotServ) + else if (service == Config->s_BotServ) { if (command.equals_ci("KICK") && params.size() > 2) { @@ -1542,7 +1542,7 @@ static void SaveDatabases() CommandReturn CommandSQLSync::Execute(User *u, const std::vector<Anope::string> ¶ms) { SaveDatabases(); - notice_lang(Config.s_OperServ, u, OPER_SYNC_UPDATED); + notice_lang(Config->s_OperServ, u, OPER_SYNC_UPDATED); return MOD_CONT; } |