From 54fb0cd5aa7d090d5c3da5ab54988c86ba8a2e8e Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 16 Nov 2009 17:59:06 +0000 Subject: Use ServiceProvider for inter-module dependencies This will stop dependency chains from preventing module reloads when it is not actually needed; however, it removes some failsafes that will need to be reimplemented in order to avoid unmapped vtables. This deprecates Request as an inter-module signaling mechanism, although SQL still uses it. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12140 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_mssql.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/modules/extra/m_mssql.cpp') diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 455a4fa47..13f25d4fc 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -636,29 +636,23 @@ class ModuleMsSQL : public Module private: unsigned long currid; QueryThread* queryDispatcher; + ServiceProvider sqlserv; public: ModuleMsSQL() - : currid(0) + : currid(0), sqlserv(this, "SQL/mssql", SERVICE_DATA) { LoggingMutex = new Mutex(); ResultsMutex = new Mutex(); - ServerInstance->Modules->UseInterface("SQLutils"); - - if (!ServerInstance->Modules->PublishFeature("SQL", this)) - { - throw ModuleException("m_mssql: Unable to publish feature 'SQL'"); - } - ReadConf(); queryDispatcher = new QueryThread(this); ServerInstance->Threads->Start(queryDispatcher); - ServerInstance->Modules->PublishInterface("SQL", this); Implementation eventlist[] = { I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, 1); + ServerInstance->Modules->AddService(sqlserv); } virtual ~ModuleMsSQL() @@ -668,10 +662,6 @@ class ModuleMsSQL : public Module ClearQueue(); ClearAllConnections(); - ServerInstance->Modules->UnpublishInterface("SQL", this); - ServerInstance->Modules->UnpublishFeature("SQL"); - ServerInstance->Modules->DoneWithInterface("SQLutils"); - delete LoggingMutex; delete ResultsMutex; } -- cgit v1.3.1-10-gc9f91