diff --git a/core/smn_database.cpp b/core/smn_database.cpp index 3d5cf7a9..059e5b48 100644 --- a/core/smn_database.cpp +++ b/core/smn_database.cpp @@ -231,11 +231,12 @@ private: class TConnectOp : public IDBThreadOperation { public: - TConnectOp(IPluginFunction *func, IDBDriver *driver, const char *_dbname) + TConnectOp(IPluginFunction *func, IDBDriver *driver, const char *_dbname, cell_t data) { m_pFunction = func; m_pDriver = driver; m_pDatabase = NULL; + m_Data = data; error[0] = '\0'; strncopy(dbname, _dbname, sizeof(dbname)); me = g_PluginSys.GetPluginByCtx(m_pFunction->GetParentContext()->GetContext()); @@ -269,7 +270,7 @@ public: m_pFunction->PushCell(BAD_HANDLE); m_pFunction->PushCell(BAD_HANDLE); m_pFunction->PushString("Driver is unloading"); - m_pFunction->PushCell(0); + m_pFunction->PushCell(m_Data); m_pFunction->Execute(NULL); } void RunThinkPart() @@ -289,7 +290,7 @@ public: m_pFunction->PushCell(m_pDriver->GetHandle()); m_pFunction->PushCell(hndl); m_pFunction->PushString(hndl == BAD_HANDLE ? error : ""); - m_pFunction->PushCell(0); + m_pFunction->PushCell(m_Data); m_pFunction->Execute(NULL); } void Destroy() @@ -303,6 +304,7 @@ private: IDatabase *m_pDatabase; char dbname[64]; char error[255]; + cell_t m_Data; }; static cell_t SQL_Connect(IPluginContext *pContext, const cell_t *params) @@ -394,7 +396,7 @@ static cell_t SQL_TConnect(IPluginContext *pContext, const cell_t *params) } /* Finally, add to the thread if we can */ - TConnectOp *op = new TConnectOp(pf, driver, conf); + TConnectOp *op = new TConnectOp(pf, driver, conf, params[3]); CPlugin *pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext()); if (pPlugin->GetProperty("DisallowDBThreads", NULL) || !g_DBMan.AddToThreadQueue(op, PrioQueue_High)) diff --git a/plugins/admin-sql-prefetch.sp b/plugins/admin-sql-prefetch.sp index 179390d6..4a48e032 100644 --- a/plugins/admin-sql-prefetch.sp +++ b/plugins/admin-sql-prefetch.sp @@ -27,7 +27,7 @@ public Plugin:myinfo = { - name = "SQL Admin Prefetcher", + name = "SQL Admins (Prefetch)", author = "AlliedModders LLC", description = "Reads all admins from SQL", version = SOURCEMOD_VERSION, diff --git a/plugins/include/dbi.inc b/plugins/include/dbi.inc index 791b8c41..37a3d075 100644 --- a/plugins/include/dbi.inc +++ b/plugins/include/dbi.inc @@ -551,7 +551,7 @@ native bool:SQL_IsSameConnection(Handle:hndl1, Handle:hndl2); * @param name Database name. * @noreturn */ -native SQL_TConnect(SQLTCallback:callback, const String:name[]="default"); +native SQL_TConnect(SQLTCallback:callback, const String:name[]="default", any:data=0); /** * Executes a simple query via a thread. The query Handle is passed through