diff options
Diffstat (limited to 'modules/database')
| -rw-r--r-- | modules/database/db_flatfile.cpp | 10 | ||||
| -rw-r--r-- | modules/database/db_old.cpp | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index 266b79379..a2226a0ef 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -128,7 +128,7 @@ class DBFlatFile : public Module, public Pipe const std::vector<Anope::string> &type_order = Serialize::Type::GetTypeOrder(); std::set<Anope::string> dbs; - dbs.insert(Config->GetModule(this)->Get<const Anope::string>("database")); + dbs.insert(Config->GetModule(this)->Get<const Anope::string>("database", "anope.db")); for (unsigned i = 0; i < type_order.size(); ++i) { @@ -151,10 +151,14 @@ class DBFlatFile : public Module, public Pipe Log(LOG_DEBUG) << "db_flatfile: Attempting to rename " << *it << " to " << newname; if (rename(oldname.c_str(), newname.c_str())) { - Log(this) << "Unable to back up database " << *it << "!"; + Anope::string err = Anope::LastError(); + Log(this) << "Unable to back up database " << *it << " (" << err << ")!"; if (!Config->GetModule(this)->Get<bool>("nobackupok")) + { Anope::Quitting = true; + Anope::QuitReason = "Unable to back up database " + *it + " (" + err + ")"; + } continue; } @@ -350,7 +354,7 @@ class DBFlatFile : public Module, public Pipe for (std::map<Module *, std::fstream *>::iterator it = databases.begin(), it_end = databases.end(); it != it_end; ++it) { std::fstream *f = it->second; - const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string>("database")); + const Anope::string &db_name = Anope::DataDir + "/" + (it->first ? (it->first->name + ".db") : Config->GetModule(this)->Get<const Anope::string>("database", "anope.db")); if (!f->is_open() || !f->good()) { diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp index c541104d9..587a8f227 100644 --- a/modules/database/db_old.cpp +++ b/modules/database/db_old.cpp @@ -732,7 +732,7 @@ static void LoadBots() READ(read_int32(&created, f)); READ(read_int16(&chancount, f)); - BotInfo *bi = BotInfo::Find(nick); + BotInfo *bi = BotInfo::Find(nick, true); if (!bi) bi = new BotInfo(nick, user, host, real); bi->created = created; @@ -914,7 +914,7 @@ static void LoadChannels() Anope::string mask; READ(read_string(mask, f)); if (access) - access->mask = mask; + access->SetMask(mask, ci); READ(read_int32(&tmp32, f)); if (access) @@ -1002,7 +1002,7 @@ static void LoadChannels() } READ(read_string(buffer, f)); - ci->bi = BotInfo::Find(buffer); + ci->bi = BotInfo::Find(buffer, true); READ(read_int32(&tmp32, f)); if (tmp32 & OLD_BS_DONTKICKOPS) |
