// DO REMEMBER TO SET IT, otherwise it's annoying :P
std::string xlinedbpath;
public:
- ModuleXLineDB() {
+ void init()
+ {
Implementation eventlist[] = { I_OnAddLine, I_OnDelLine, I_OnExpireLine };
- ServerInstance->Modules->Attach(eventlist, this, 3);
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
/* Load the configuration
* Note:
return false;
}
+#ifdef _WIN32
+ if (remove(xlinedbpath.c_str()))
+ {
+ ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Cannot remove old database! %s (%d)", strerror(errno), errno);
+ ServerInstance->SNO->WriteToSnoMask('a', "database: cannot remove old database: %s (%d)", strerror(errno), errno);
+ return false;
+ }
+#endif
// Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash.
if (rename(xlinenewdbpath.c_str(), xlinedbpath.c_str()) < 0)
{