Fixed requiring dependencies at the wrong time.
3 * =============================================================================
4 * SourceMod Client Preferences Extension
5 * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
35 void TQueryOp::RunThinkPart()
37 //handler for threaded sql queries
43 case Query_InsertCookie:
44 g_CookieManager.InsertCookieCallback(pCookie, m_insertId);
46 case Query_SelectData:
47 g_CookieManager.ClientConnectCallback(m_client, m_pQuery);
49 case Query_InsertData:
50 //No specific handling
53 g_CookieManager.SelectIdCallback(pCookie, m_pQuery);
63 g_pSM->LogError(myself,"Failed SQL Query, Error: \"%s\" (Query id %i - client %i)", error, m_type, m_client);
67 void TQueryOp::RunThreadPart()
69 m_pDatabase->LockForFullAtomicOperation();
70 m_pQuery = m_pDatabase->DoQuery(m_Query.c_str());
74 g_pSM->LogError(myself, "Failed SQL Query, Error: \"%s\" (Query id %i - client %i)", m_pDatabase->GetError(), m_type, m_client);
77 m_insertId = g_ClientPrefs.Database->GetInsertID();
79 m_pDatabase->UnlockFromFullAtomicOperation();
82 IDBDriver *TQueryOp::GetDriver()
84 return m_pDatabase->GetDriver();
86 IdentityToken_t *TQueryOp::GetOwner()
88 return myself->GetIdentity();
90 void TQueryOp::Destroy()
95 TQueryOp::TQueryOp(IDatabase *db, const char *query, enum querytype type, int client)
103 m_pDatabase->IncReferenceCount();
106 TQueryOp::TQueryOp(IDatabase *db, const char *query, enum querytype type, Cookie *cookie)
114 m_pDatabase->IncReferenceCount();