* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
public:
ModuleSQLLog()
- {
- ServerInstance->Modules->UseInterface("SQLutils");
- ServerInstance->Modules->UseInterface("SQL");
-
+ {
Module* SQLutils = ServerInstance->Modules->Find("m_sqlutils.so");
if (!SQLutils)
throw ModuleException("Can't find m_sqlutils.so. Please load m_sqlutils.so before m_sqlauth.so.");
- SQLModule = ServerInstance->Modules->FindFeature("SQL");
+ ServiceProvider* prov = ServerInstance->Modules->FindService(SERVICE_DATA, "SQL");
+ if (!prov)
+ throw ModuleException("Can't find an SQL provider module. Please load one before attempting to load m_sqlauth.");
+ SQLModule = prov->creator;
OnRehash(NULL);
MyMod = this;
active_queries.clear();
Implementation eventlist[] = { I_OnRehash, I_OnOper, I_OnGlobalOper, I_OnKill,
- I_OnPreCommand, I_OnUserConnect, I_OnUserQuit, I_OnLoadModule };
+ I_OnPreCommand, I_OnUserRegister, I_OnUserQuit, I_OnLoadModule };
ServerInstance->Modules->Attach(eventlist, this, 8);
}
- virtual ~ModuleSQLLog()
- {
- ServerInstance->Modules->DoneWithInterface("SQL");
- ServerInstance->Modules->DoneWithInterface("SQLutils");
- }
-
-
void ReadConfig()
{
ConfigReader Conf;
return MOD_RES_PASSTHRU;
}
- virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
+ virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, LocalUser *user, bool validated, const std::string &original_line)
{
if ((command == "GLINE" || command == "KLINE" || command == "ELINE" || command == "ZLINE") && validated)
{
return MOD_RES_PASSTHRU;
}
- virtual void OnUserConnect(User* user)
+ virtual ModResult OnUserRegister(LocalUser* user)
{
AddLogEntry(LT_CONNECT,user->nick,user->host,user->server);
+ return MOD_RES_PASSTHRU;
}
virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message)
virtual Version GetVersion()
{
- return Version("Logs network-wide data to an SQL database", VF_VENDOR, API_VERSION);
+ return Version("Logs network-wide data to an SQL database", VF_VENDOR);
}
};