diff options
| author | 2009-11-16 17:59:06 +0000 | |
|---|---|---|
| committer | 2009-11-16 17:59:06 +0000 | |
| commit | 54fb0cd5aa7d090d5c3da5ab54988c86ba8a2e8e (patch) | |
| tree | bc20ce6dca41b2d16349ae4c8212861c10e3685e /src/modules/extra/m_mysql.cpp | |
| parent | Fix failed oper snomask being sent to local oper sno on remote servers (diff) | |
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
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
| -rw-r--r-- | src/modules/extra/m_mysql.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 358f5e992..c294befdc 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -93,6 +93,7 @@ class ModuleSQL : public Module Mutex ResultsMutex; Mutex LoggingMutex; Mutex ConnMutex; + ServiceProvider sqlserv; ModuleSQL(); ~ModuleSQL(); @@ -666,8 +667,6 @@ ConnMap::iterator GetCharId(char id) return Connections.end(); } -class ModuleSQL; - class DispatcherThread : public SocketThread { private: @@ -679,24 +678,13 @@ class DispatcherThread : public SocketThread virtual void OnNotify(); }; -ModuleSQL::ModuleSQL() : rehashing(false) +ModuleSQL::ModuleSQL() : rehashing(false), sqlserv(this, "SQL/mysql", SERVICE_DATA) { - ServerInstance->Modules->UseInterface("SQLutils"); - currid = 0; Dispatcher = new DispatcherThread(this); ServerInstance->Threads->Start(Dispatcher); - if (!ServerInstance->Modules->PublishFeature("SQL", this)) - { - Dispatcher->join(); - delete Dispatcher; - ServerInstance->Modules->DoneWithInterface("SQLutils"); - throw ModuleException("m_mysql: Unable to publish feature 'SQL'"); - } - - ServerInstance->Modules->PublishInterface("SQL", this); Implementation eventlist[] = { I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, 1); } @@ -705,9 +693,6 @@ ModuleSQL::~ModuleSQL() { delete Dispatcher; ClearAllConnections(); - ServerInstance->Modules->UnpublishInterface("SQL", this); - ServerInstance->Modules->UnpublishFeature("SQL"); - ServerInstance->Modules->DoneWithInterface("SQLutils"); } unsigned long ModuleSQL::NewID() |
