⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tsodbc.h

📁 Soul的源代码,类似于劲舞团之类的游戏
💻 H
字号:
// TsODBC.h

#ifndef __TSODBC_H_
#define __TSODBC_H_
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <tchar.h>
#include "CharacterData.h"
#include <atlcomtime.h>

typedef struct
{
	char	Password[16];
	int		iAccountID;
	BYTE	iAdminLevel;
//	DATE	BlockDate;
	TIMESTAMP_STRUCT	BlockDate;
	int		iState;
} ACCOUNT_INFO;

#define _ACCOUNT_ID_SIZE_DB			16
#define _ACCOUNT_PASSWORD_SIZE_DB	16
#define DUMMYQUERY_TICK_TERM		10000//40000	

//------------------------------------------------------------------------------
class TsODBC
{
private :
	SQLHENV		m_hEnv;
	SQLHDBC		m_hDBC;
	HWND		m_hTextHwnd;

	// Game Server 包访
	SQLHSTMT	m_hStmtCharInfoUp;
	SQLHSTMT	m_hStmtDetailInfoUp;
	SQLHSTMT	m_hStmtEquipUp;		// 厘馒 (11 何困)
	SQLHSTMT	m_hStmtInvenUp;		// 牢亥配府(80俺狼 ps)
	SQLHSTMT	m_hStmtStoreUp;		// 芒绊1
	SQLHSTMT	m_hStmtStore2Up;	// 芒绊2
	SQLHSTMT	m_hStmtDelChar;		// char Delete
	SQLHSTMT	m_hStmtInsert;		// char Insert

	// Char Server 包访
	SQLHSTMT	m_hStmtCharInfoSt;		// CharInfo select
	SQLHSTMT	m_hStmtDetailInfoSt;	// DetailInfo select
	SQLHSTMT	m_hStmtEquipSt;			// EquipInfo select
	SQLHSTMT	m_hStmtInvenSt;			// Inven select
	SQLHSTMT	m_hStmtStoreSt;			// Store select
	SQLHSTMT	m_hStmtStore2St;		// Store2 select

	// Account Server 包访
	SQLHSTMT	m_hStmtAccountSt;		// 肺弊牢沥焊 select
	SQLHSTMT	m_hStmtLogInUp;			// 肺弊牢 矫埃 update
	SQLHSTMT	m_hStmtLogOutUp;		// 肺弊酒眶 矫埃 update

	
	// Bind Parameter 包访
	CHARACTER_INFO	m_info;
	ACCOUNT_INFO	m_AccInfo;
	char			m_cID[16];
	char			m_cIP[16];
	TIMESTAMP_STRUCT m_stDate;

	SQLINTEGER	m_siExec;
	SQLINTEGER	m_siNTS;
	SQLINTEGER	m_siZero;
	SQLINTEGER	m_siIntLen;
	SQLINTEGER	m_siColLen;
	SQLPOINTER	m_pToken;
	int			*m_iToken;

	// query 包访
	char	m_cInfo[32];
	char	m_cDetail[128];
	char	m_cEquip[1024];
	char	m_cInven[1024];
	char	m_cStore[1024];
	char	m_cTmp[256];
	int		m_iCallType;
	int		m_iOutPutValue;

public :
	TsODBC();
	~TsODBC();

	BOOL	InitializeConn(HWND handle,int callType);
	BOOL	Connection(void);
	BOOL	ReconnectODBC(void);
	void	CleanupConn(void);

	// Account 沥焊 八祸/荐沥
	int		OpenAccountData(char *cName, ACCOUNT_INFO *pData);
	int		UpdateAccountLogInData(char *cID, char *cIp);
	int		UpdateAccountLogoutData(char *cID);
	
	// Char 沥焊 八祸/眠啊/昏力
	BOOL	DeleteCharInfo( char *charName, int iCharIndex, int iAccountID );
	BOOL	AddNewCharInfo( CHARINFO *pData );
	BOOL	OpenCharInfo( int iAccountID, CHAR_EQUIP_INFO *pCharDetail_Info );
	BOOL	OpenCharDetailInfoAllItem( int iAccountID, int iCharIndex, CCharacterData* x );
	BOOL	OpenCharDetailInfo( int iAccountID, int iCharIndex, CCharacterData* x );
	BOOL	GetItemInfo( SQLHSTMT hStmt, void *pData, void *pSource, int isize );

	// Char 沥焊甫 葛滴 历厘.
	int		UpdateAllCharInfo( CHARACTER_INFO *pData );
	int		UpdateItemInfo( SQLHSTMT hStmt );
	
	// Exception display
	void	PrintError(SQLHSTMT hstmt, SQLHDBC hDBC);

	// Connecting pool包访
	DWORD		m_dwLastTick;	// 付瘤阜 荤侩矫埃 Tick
	int			m_iDummy;
	SQLHSTMT	m_hStmtcnntpl;
	CRITICAL_SECTION	m_cs;	// m_iUseFlag甫 焊龋窍扁 困茄 悼扁拳 按眉
	int	DummyQuery(DWORD dwTick);
};

//------------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -