diff options
Diffstat (limited to 'src/modules/extra/m_mysql.cpp')
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index befe11df1..731753d9b 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -87,20 +87,21 @@ static unsigned long count(const char * const str, char a) class ModuleSQL : public Module { public: - int currid; - bool rehashing; - DispatcherThread* Dispatcher; - Mutex ResultsMutex; - Mutex LoggingMutex; - Mutex ConnMutex; - ServiceProvider sqlserv; - - ModuleSQL(); - ~ModuleSQL(); - unsigned long NewID(); - void OnRequest(Request& request); - void OnRehash(User* user); - Version GetVersion(); + int currid; + bool rehashing; + DispatcherThread* Dispatcher; + Mutex ResultsMutex; + Mutex LoggingMutex; + Mutex ConnMutex; + ServiceProvider sqlserv; + + ModuleSQL(); + void init(); + ~ModuleSQL(); + unsigned long NewID(); + void OnRequest(Request& request); + void OnRehash(User* user); + Version GetVersion(); }; @@ -681,6 +682,12 @@ class DispatcherThread : public SocketThread ModuleSQL::ModuleSQL() : rehashing(false), sqlserv(this, "SQL/mysql", SERVICE_DATA) { currid = 0; + Dispatcher = NULL; +} + +void ModuleSQL::init() +{ + ServerInstance->Modules->AddService(sqlserv); Dispatcher = new DispatcherThread(this); ServerInstance->Threads->Start(Dispatcher); |