|
pred@2009
|
1 |
/** |
|
pred@2009
|
2 |
* vim: set ts=4 : |
|
pred@2009
|
3 |
* ============================================================================= |
|
pred@2009
|
4 |
* SourceMod Client Preferences Extension |
|
pred@2009
|
5 |
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. |
|
pred@2009
|
6 |
* ============================================================================= |
|
pred@2009
|
7 |
* |
|
pred@2009
|
8 |
* This program is free software; you can redistribute it and/or modify it under |
|
pred@2009
|
9 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
pred@2009
|
10 |
* Free Software Foundation. |
|
pred@2009
|
11 |
* |
|
pred@2009
|
12 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
pred@2009
|
13 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
pred@2009
|
14 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
pred@2009
|
15 |
* details. |
|
pred@2009
|
16 |
* |
|
pred@2009
|
17 |
* You should have received a copy of the GNU General Public License along with |
|
pred@2009
|
18 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
pred@2009
|
19 |
* |
|
pred@2009
|
20 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
pred@2009
|
21 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
pred@2009
|
22 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
pred@2009
|
23 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
pred@2009
|
24 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
pred@2009
|
25 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
pred@2009
|
26 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
pred@2009
|
27 |
* or <http://www.sourcemod.net/license.php>. |
|
pred@2009
|
28 |
* |
|
pred@2009
|
29 |
* Version: $Id$ |
|
pred@2009
|
30 |
*/ |
|
pred@2009
|
31 |
|
|
pred@2009
|
32 |
#ifndef _INCLUDE_SOURCEMOD_CLIENTPREFS_QUERY_H_ |
|
pred@2009
|
33 |
#define _INCLUDE_SOURCEMOD_CLIENTPREFS_QUERY_H_ |
|
pred@2009
|
34 |
|
|
pred@2009
|
35 |
#include "extension.h" |
|
pred@2009
|
36 |
#include "cookie.h" |
|
pred@2009
|
37 |
#include "sh_string.h" |
|
pred@2009
|
38 |
|
|
pred@2009
|
39 |
enum querytype |
|
pred@2009
|
40 |
{ |
|
pred@2009
|
41 |
Query_InsertCookie = 0, |
|
pred@2009
|
42 |
Query_SelectData, |
|
pred@2009
|
43 |
Query_InsertData, |
|
pred@2048
|
44 |
Query_SelectId, |
|
pred@2087
|
45 |
Query_CreateTable, |
|
pred@2009
|
46 |
}; |
|
pred@2009
|
47 |
|
|
pred@2009
|
48 |
class TQueryOp : public IDBThreadOperation |
|
pred@2009
|
49 |
{ |
|
pred@2009
|
50 |
public: |
|
pred@2048
|
51 |
TQueryOp(IDatabase *db, const char *query, enum querytype type, int client); |
|
pred@2048
|
52 |
TQueryOp(IDatabase *db, const char *query, enum querytype type, Cookie *cookie); |
|
pred@2009
|
53 |
~TQueryOp() {} |
|
pred@2009
|
54 |
|
|
pred@2009
|
55 |
IDBDriver *GetDriver(); |
|
pred@2009
|
56 |
IdentityToken_t *GetOwner(); |
|
pred@2009
|
57 |
|
|
pred@2009
|
58 |
void Destroy(); |
|
pred@2009
|
59 |
|
|
pred@2009
|
60 |
void RunThreadPart(); |
|
pred@2009
|
61 |
/* Thread has been cancelled due to driver unloading. Nothing else to do? */ |
|
pred@2009
|
62 |
void CancelThinkPart() |
|
pred@2009
|
63 |
{ |
|
pred@2009
|
64 |
} |
|
pred@2009
|
65 |
void RunThinkPart(); |
|
pred@2009
|
66 |
|
|
pred@2009
|
67 |
private: |
|
pred@2009
|
68 |
IDatabase *m_pDatabase; |
|
pred@2048
|
69 |
IQuery *m_pQuery; |
|
pred@2048
|
70 |
SourceHook::String m_Query; |
|
pred@2009
|
71 |
char error[255]; |
|
pred@2009
|
72 |
enum querytype m_type; |
|
pred@2009
|
73 |
int m_client; |
|
pred@2009
|
74 |
int m_insertId; |
|
pred@2009
|
75 |
Cookie *pCookie; |
|
pred@2009
|
76 |
}; |
|
pred@2009
|
77 |
|
|
pred@2009
|
78 |
|
|
pred@2009
|
79 |
#endif // _INCLUDE_SOURCEMOD_CLIENTPREFS_QUERY_H_ |