- return 0;
-}
-
-ConnMap::iterator GetCharId(char id)
-{
- char i = 1;
- for (ConnMap::iterator iter = Connections.begin(); iter != Connections.end(); ++iter, ++i)
- {
- if (i == id)
- return iter;
- }
- return Connections.end();
-}
-
-class ModuleSQL;
-
-class DispatcherThread : public SocketThread
-{
- private:
- ModuleSQL* const Parent;
- public:
- DispatcherThread(ModuleSQL* CreatorModule) : Parent(CreatorModule) { }
- ~DispatcherThread() { }
- virtual void Run();
- virtual void OnNotify();
-};
-
-ModuleSQL::ModuleSQL() : rehashing(false)
-{
- 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);