summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-29 00:05:19 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-29 00:05:19 +0000
commit4700c1df2dfd616a0e8dba06144224c6e0aa52ac (patch)
tree33b298a0af85bf460b9dd3d5d599098ecda1b0ff
parent59bd18f2a0b43b71ee32124add9d40d1d3a54919 (diff)
Also using new interface methods, and maybe less crashage.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6150 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/extra/m_sqllog.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index b284e10cf..867e07ff6 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -252,26 +252,33 @@ class ModuleSQLLog : public Module
ConfigReader* Conf;
public:
- bool ReadConfig()
- {
- ConfigReader Conf(Srv);
-
- dbid = Conf.ReadValue("sqllog","dbid",0); // database id of a database configured in sql module
-
- SQLModule = Srv->FindFeature("SQL");
- if (!SQLModule)
- ServerInstance->Log(DEFAULT,"WARNING: m_sqllog.so could not initialize because an SQL module is not loaded. Load the module and rehash your server.");
- return (SQLModule);
- }
-
ModuleSQLLog(InspIRCd* Me)
: Module::Module(Me), Srv(Me)
{
+ ServerInstance->UseInterface("SQLutils");
+ ServerInstance->UseInterface("SQL");
+
+ Module* SQLutils = ServerInstance->FindModule("m_sqlutils.so");
+ if (!SQLutils)
+ throw ModuleException("Can't find m_sqlutils.so. Please load m_sqlutils.so before m_sqlauth.so.");
+
ReadConfig();
MyMod = this;
active_queries.clear();
}
+ virtual ~ModuleSQLLog()
+ {
+ ServerInstance->DoneWithInterface("SQL");
+ ServerInstance->DoneWithInterface("SQLutils");
+ }
+
+ void ReadConfig()
+ {
+ ConfigReader Conf(Srv);
+ dbid = Conf.ReadValue("sqllog","dbid",0); // database id of a database configured in sql module
+ }
+
void Implements(char* List)
{
List[I_OnRehash] = List[I_OnOper] = List[I_OnGlobalOper] = List[I_OnKill] = 1;
@@ -374,10 +381,6 @@ class ModuleSQLLog : public Module
AddLogEntry(LT_LOADMODULE,name,Srv->Config->ServerName, Srv->Config->ServerName);
}
- virtual ~ModuleSQLLog()
- {
- }
-
virtual Version GetVersion()
{
return Version(1,1,0,1,VF_VENDOR,API_VERSION);