- public:
-
- ConfigReader *Conf;
- InspIRCd* PublicServerInstance;
- int currid;
- bool rehashing;
- DispatcherThread* Dispatcher;
-
- ModuleSQL(InspIRCd* Me)
- : Module::Module(Me), rehashing(false)
- {
- ServerInstance->Modules->UseInterface("SQLutils");
-
- Conf = new ConfigReader(ServerInstance);
- PublicServerInstance = ServerInstance;
- currid = 0;
- SQLModule = this;
-
- MessagePipe = new Notifier(ServerInstance);
-
- Dispatcher = new DispatcherThread(ServerInstance, this);
- ServerInstance->Threads->Create(Dispatcher);
-
- if (!ServerInstance->Modules->PublishFeature("SQL", this))
- {
- /* Tell worker thread to exit NOW,
- * Automatically joins */
- delete Dispatcher;
-
- throw ModuleException("m_mysql: Unable to publish feature 'SQL'");
- }
-
- ServerInstance->Modules->PublishInterface("SQL", this);
- Implementation eventlist[] = { I_OnRehash, I_OnRequest };
- ServerInstance->Modules->Attach(eventlist, this, 2);
- }
-
- virtual ~ModuleSQL()
- {
- delete Dispatcher;
- ClearAllConnections();
- delete Conf;
- ServerInstance->Modules->UnpublishInterface("SQL", this);
- ServerInstance->Modules->UnpublishFeature("SQL");
- ServerInstance->Modules->DoneWithInterface("SQLutils");
- }
-
-
-
- unsigned long NewID()
- {
- if (currid+1 == 0)
- currid++;
- return ++currid;
- }