Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
118
Server/Billing/Db/myOLEDB.h
Normal file
118
Server/Billing/Db/myOLEDB.h
Normal file
@@ -0,0 +1,118 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// OleDB
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _OleDB
|
||||
#define _OleDB
|
||||
|
||||
#include <oledb.h>
|
||||
#include <oledberr.h>
|
||||
|
||||
//#define _CHECK_OLEDB_PERFORMANCE // DB <20><><EFBFBD><EFBFBD><EFBFBD>ս<EFBFBD> üũ
|
||||
#ifdef _CHECK_OLEDB_PERFORMANCE
|
||||
#define DB_PERFORMANCE_CHECK(x) x
|
||||
#else
|
||||
#define DB_PERFORMANCE_CHECK(x) (void*)0;
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class OleDB
|
||||
{
|
||||
public:
|
||||
const static unsigned long MaxRowNum = 2000; // <20>ִ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
||||
const static unsigned long MaxErrorLen = 512; // <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
const static unsigned long MaxQueryTextLen = 5000; // <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
protected:
|
||||
|
||||
typedef struct _COL_INFO
|
||||
{
|
||||
const static unsigned short MaxColNameLen = 100; // <20>ִ<EFBFBD> <20>÷<EFBFBD> <20≯<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
char ColName[MaxColNameLen]; // <20>÷<EFBFBD> <20≯<EFBFBD>
|
||||
unsigned long ColSize; // <20>÷<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}COL_INFO, *LPCOL_INFO;
|
||||
|
||||
typedef struct _RESULT_COLS
|
||||
{
|
||||
unsigned long ColNum;
|
||||
DBCOLUMNINFO* lpDBColumnInfo;
|
||||
WCHAR* lpStringsBuffer;
|
||||
}RESULT_COLS, *LPRESULT_COLS;
|
||||
|
||||
WCHAR m_QueryText[MaxQueryTextLen]; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ڿ<EFBFBD>
|
||||
COL_INFO m_ColInfo;
|
||||
|
||||
public:
|
||||
enum ConnType { ConnType_ODBC = 0, ConnType_MSSQL = 1, ConnType_ORACLE };
|
||||
|
||||
enum Rowset { Rowset_Get = 0, Rowset_Update = 1 }; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ο<EFBFBD><CEBF><EFBFBD>
|
||||
|
||||
typedef struct _PARAM_INFO
|
||||
{
|
||||
const static unsigned short MaxColNum = 20; // <20>ִ<EFBFBD> <20>÷<EFBFBD> <20≯<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
unsigned long ColNum; // <20>÷<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
unsigned long ColSize[MaxColNum]; // <20>÷<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
unsigned short ColType[MaxColNum];
|
||||
}PARAM_INFO, *LPPARAM_INFO;
|
||||
|
||||
typedef struct _SET_BINARY
|
||||
{
|
||||
unsigned long Size;
|
||||
}SET_BINARY, *LPSET_BINARY;
|
||||
|
||||
public:
|
||||
|
||||
IDBInitialize* m_pIDBInit;
|
||||
IDBCreateSession* m_pIDBCreateSession;
|
||||
IDBCreateCommand* m_pIDBCreateCommand;
|
||||
IRowset* m_pIRowset;
|
||||
IRowsetChange* m_pIRowsetChange;
|
||||
|
||||
char m_ErrorString[MaxErrorLen];
|
||||
|
||||
public:
|
||||
|
||||
OleDB(void);
|
||||
virtual ~OleDB(void);
|
||||
|
||||
char* GetErrorString(void) { return m_ErrorString; }
|
||||
|
||||
bool ConnectDataSourcePrompt(HWND hWnd_In);
|
||||
bool ConnectSQLServer(LPCTSTR ServerName_In, LPCTSTR DataBaseName_In, LPCTSTR UserID_In, LPCTSTR UserPass_In, ConnType ConnType_In);
|
||||
bool DisconnectDataSource(void);
|
||||
|
||||
bool ExcuteQuery(LPCTSTR Query_In, Rowset Rowset_In = Rowset_Get);
|
||||
bool ExcuteQueryWithParams(LPCTSTR Query_In, char *Data_In, PARAM_INFO& ColInfo_In, Rowset Rowset_In);
|
||||
|
||||
bool ExcuteQueryGetData(LPCTSTR Query_In, void *Buffer_Out);
|
||||
|
||||
bool GetData(void *Buffer_Out);
|
||||
bool GetData(void **Buffer_Out, int RowSize_In, int Row_In, int *pGetRow_Out);
|
||||
|
||||
bool SetBinaryData(int ColNum_In, LPSET_BINARY lpSetBinary);
|
||||
|
||||
COL_INFO& GetColInfo(void) { return m_ColInfo; }
|
||||
|
||||
private:
|
||||
|
||||
bool HandleError(int ErrorLine_In, HRESULT hResult_In, char *Buffer_In);
|
||||
|
||||
bool CreateSession(void);
|
||||
bool DBCreateCommand(void);
|
||||
|
||||
bool AllocResultCols(IUnknown* lpIUnknown_In, RESULT_COLS &Rsult_Cols);
|
||||
bool ReleaseResultCols(IUnknown* lpIUnknown_In, RESULT_COLS &Rsult_Cols);
|
||||
|
||||
bool SetConnectionProperties(LPCTSTR ServerName_In, LPCTSTR DataBaseName_In, LPCTSTR UserID_In, LPCTSTR UserPass_In);
|
||||
DBBINDING* AllocBindGetData(int ColsNum_In, DBCOLUMNINFO* pDBColumnInfo_In);
|
||||
DBBINDING* AllocBindParamInputData(PARAM_INFO &ColInfo_In);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user