core/smn_database.cpp
changeset 1317 a2a64027311e
parent 1294 63af7da6c82c
child 1324 9d1983bf06c7
     1.1 --- a/core/smn_database.cpp	Mon Aug 13 01:46:58 2007 +0000
     1.2 +++ b/core/smn_database.cpp	Mon Aug 13 16:49:53 2007 +0000
     1.3 @@ -231,11 +231,12 @@
     1.4  class TConnectOp : public IDBThreadOperation
     1.5  {
     1.6  public:
     1.7 -	TConnectOp(IPluginFunction *func, IDBDriver *driver, const char *_dbname)
     1.8 +	TConnectOp(IPluginFunction *func, IDBDriver *driver, const char *_dbname, cell_t data)
     1.9  	{
    1.10  		m_pFunction = func;
    1.11  		m_pDriver = driver;
    1.12  		m_pDatabase = NULL;
    1.13 +		m_Data = data;
    1.14  		error[0] = '\0';
    1.15  		strncopy(dbname, _dbname, sizeof(dbname));
    1.16  		me = g_PluginSys.GetPluginByCtx(m_pFunction->GetParentContext()->GetContext());
    1.17 @@ -269,7 +270,7 @@
    1.18  		m_pFunction->PushCell(BAD_HANDLE);
    1.19  		m_pFunction->PushCell(BAD_HANDLE);
    1.20  		m_pFunction->PushString("Driver is unloading");
    1.21 -		m_pFunction->PushCell(0);
    1.22 +		m_pFunction->PushCell(m_Data);
    1.23  		m_pFunction->Execute(NULL);
    1.24  	}
    1.25  	void RunThinkPart()
    1.26 @@ -289,7 +290,7 @@
    1.27  		m_pFunction->PushCell(m_pDriver->GetHandle());
    1.28  		m_pFunction->PushCell(hndl);
    1.29  		m_pFunction->PushString(hndl == BAD_HANDLE ? error : "");
    1.30 -		m_pFunction->PushCell(0);
    1.31 +		m_pFunction->PushCell(m_Data);
    1.32  		m_pFunction->Execute(NULL);
    1.33  	}
    1.34  	void Destroy()
    1.35 @@ -303,6 +304,7 @@
    1.36  	IDatabase *m_pDatabase;
    1.37  	char dbname[64];
    1.38  	char error[255];
    1.39 +	cell_t m_Data;
    1.40  };
    1.41  
    1.42  static cell_t SQL_Connect(IPluginContext *pContext, const cell_t *params)
    1.43 @@ -394,7 +396,7 @@
    1.44  	}
    1.45  
    1.46  	/* Finally, add to the thread if we can */
    1.47 -	TConnectOp *op = new TConnectOp(pf, driver, conf);
    1.48 +	TConnectOp *op = new TConnectOp(pf, driver, conf, params[3]);
    1.49  	CPlugin *pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());
    1.50  	if (pPlugin->GetProperty("DisallowDBThreads", NULL)
    1.51  		|| !g_DBMan.AddToThreadQueue(op, PrioQueue_High))