From 6a9fbfda45b80ab953e15cb7e5f883b7f6f970af Mon Sep 17 00:00:00 2001 From: om Date: Fri, 11 Aug 2006 09:06:03 +0000 Subject: [PATCH] New API update git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4871 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_sqllog.cpp | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp index 4220724a6..4779e3cb2 100644 --- a/src/modules/extra/m_sqllog.cpp +++ b/src/modules/extra/m_sqllog.cpp @@ -14,20 +14,6 @@ * --------------------------------------------------- */ -using namespace std; - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "users.h" #include "channels.h" #include "modules.h" @@ -41,8 +27,6 @@ static Module* MyMod; static std::string dbid; extern time_t TIME; -extern InspIRCd* ServerInstance; - enum LogTypes { LT_OPER = 1, LT_KILL, LT_SERVLINK, LT_XLINE, LT_CONNECT, LT_DISCONNECT, LT_FLOOD, LT_LOADMODULE }; enum QueryState { FIND_SOURCE, INSERT_SOURCE, FIND_NICK, INSERT_NICK, FIND_HOST, INSERT_HOST, INSERT_LOGENTRY, DONE }; @@ -270,24 +254,25 @@ class QueryInfo class ModuleSQLLog : public Module { - Server* Srv; + InspIRCd* Srv; ConfigReader* Conf; public: bool ReadConfig() { - Conf = new ConfigReader(); - dbid = Conf->ReadValue("sqllog","dbid",0); // database id of a database configured in sql module - DELETE(Conf); - SQLModule = ServerInstance->FindFeature("SQL"); + ConfigReader Conf(Srv); + + dbid = Conf.ReadValue("sqllog","dbid",0); // database id of a database configured in sql module + + SQLModule = Srv->FindFeature("SQL"); if (!SQLModule) 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) + ModuleSQLLog(InspIRCd* Me) + : Module::Module(Me), Srv(Me) { - ReadConfig(); MyMod = this; active_queries.clear(); @@ -397,7 +382,7 @@ class ModuleSQLLog : public Module virtual void OnLoadModule(Module* mod, const std::string &name) { - AddLogEntry(LT_LOADMODULE,name,ServerInstance->Config->ServerName,ServerInstance->Config->ServerName); + AddLogEntry(LT_LOADMODULE,name,Srv->Config->ServerName, Srv->Config->ServerName); } virtual ~ModuleSQLLog() -- 2.39.5