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

📄 auction.cpp

📁 国内著名网络游戏dragon的服务端完整源码 内附完整数据库结构
💻 CPP
📖 第 1 页 / 共 4 页
字号:
		}
		else
		{
COMMENT		MyLog(0,"Update Failed");
			goto __FAIL;
		}
	}

	goto __FAIL;

__FAIL:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);
		return;
	}
__SUCCESS:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);		
		p.h.header.type = CMD_MERCHANT_ITEM_BUY_COMFORM_RESULT;//鸥涝阑 背眉 茄促
		(*pMIB) = QueryResult;//焊尘 菩哦俊 搬苞拱阑 角绢 焊辰促////备概吝 惑怕肺 父甸绢 脸阑 巴捞促 酒聪扼搁 甘辑滚俊辑 备涝 阂啊瓷捞扼绊 贸府 窍扼
		::QueuePacket(connections,iCn,&p,1);	
		return;
	}
}

void CAuction::RecvCMD_MERCHANT_ITEM_BUY_COMFORM_RESULT(const int iCn,t_packet &p)
{	//isend 甫 芭贰 辆丰肺 秦霖促 涝陛 肯丰促
	const int iKey = p.u.MerchantItemBuy.iKey;
	if(	IS_END_WAIT_TAKE	!= iKey//捣 化疽栏搁 
	&&	IS_END_ALL_RIGHT	!= iKey)//捣 绝栏搁
	{//捞芭 滴俺啊 酒聪促
		MyLog(0,"Auction Critical Error!! Type => CMD_MERCHANT_ITEM_BUY_COMFORM_RESULT");
		return;
	}
	//isend 甫 芭贰场栏肺 秦霖促
	//备概 啊瓷 茄啊? //牢郸胶,颇绰仇,酒捞袍,isEnd == 0(备概啊瓷) 栏肺 八祸茄促
	//墨款飘甫 罐酒辑 八荤 窍磊 0 捞搁 救魄促绊 1 捞搁 魄促 摆瘤.
	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
	::SQLAllocStmt(hDBC, &hStmt);
	char szQuery[255] ={0,};
	MERCHANT_ITEM_BUY *pMIB = &p.u.MerchantItemBuy;
	MERCHANT_ITEM_BUY QueryResult = *pMIB;//罐篮吧肺 檬扁拳甫 矫挪促
	sprintf(szQuery,"EXEC MerchantItemBuyComform %d, '%s' , '%s', "//牢郸胶,捞抚,官曹蔼,捞傈蔼
		" %d, %d, "
		"%d, %d, %d, %d, %d, %d, %d",
	pMIB->iIndex,
	pMIB->szSellerName,
	pMIB->szBuyerName,
	iKey,//甘辑滚啊 悸泼茄 蔼栏肺 秦霖促
	IS_END_BUYING,//备概吝 惑怕咯具 窍绊
	pMIB->SellItem.item_no,
	pMIB->SellItem.attr[0],
	pMIB->SellItem.attr[1],
	pMIB->SellItem.attr[2],
	pMIB->SellItem.attr[3],
	pMIB->SellItem.attr[4],
	pMIB->SellItem.attr[5] );

	//IS_END_ALL_RIGHT 惑怕俊辑父 瘤匡 荐 乐促 咯矾锅 瘤快绰扒 阂啊瓷 窍促
	retCode = SQLExecDirect(hStmt, (UCHAR *)szQuery, SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{
		retCode = SQLFetch(hStmt);
		if( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{
			int column = 0;
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.iIndex,			0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_CHAR,	QueryResult.szSellerName,		20, &cbValue);
			::EatRearWhiteChar(QueryResult.szSellerName);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.iKey,				0, &cbValue);//IsEnd蔼捞 甸绢柯促
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.dwSellValue,		0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.item_no,	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[0],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[1],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[2],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[3],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[4],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[5],	0, &cbValue);
			if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
			{	//咯扁 吭澜篮 单捞鸥啊 钢履窍促绰 刘芭.(诀单捞飘俊 己傍 沁促.
				if(QueryResult.dwSellValue != pMIB->dwSellValue)
				{
					MyLog(0,"Auction Critical Warning!! Type => CMD_MERCHANT_ITEM_BUY_COMFORM_RESULT SellValue NotMatch = DB %d, Client %d",QueryResult.dwSellValue, pMIB->dwSellValue);
					pMIB->dwSellValue = QueryResult.dwSellValue;
					MyLog(0,"Auction Critical Warning!! Type => CMD_MERCHANT_ITEM_BUY_COMFORM_RESULT Force Change Value = %d ",QueryResult.dwSellValue);
				}
				goto __SUCCESS;
			}
			else //葛电 抗寇 惑炔篮 绝促.
			{	//捞繁 富档 救登绰 惑炔
				goto __FAIL;
			}
		}
		else
		{
COMMENT		MyLog(0,"Non Select Result");
			goto __FAIL;
		}
	}

	goto __FAIL;
	
__FAIL:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);
		return;
	}
__SUCCESS:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);
		p.h.header.type = CMD_MERCHANT_ITEM_BUY_RESULT;//鸥涝阑 背眉 茄促
		(*pMIB) = QueryResult;//焊尘 菩哦俊 搬苞拱阑 角绢 焊辰促
		::QueuePacket(connections,iCn,&p,1);
		return;
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 备概 窍扁 场(备概磊)
////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 府胶飘 八祸 窍扁 矫累(魄概磊
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::RecvCMD_MERCHANT_SELL_LIST_REQUEST(const int iCn,t_packet &p)//府胶飘 夸没(魄概磊啊 焊绰巴
{
	const char* szName = p.u.SellerItemRequest.szName;
	
	SEARCHRESULTLIST FindResult;
	memset(&FindResult ,0, sizeof(SEARCHRESULTLIST));
	FindResult.iCn = p.u.SellerItemRequest.iCn;
	FindResult.iKey = p.u.SellerItemRequest.iKey;//021113 lsw
	memcpy(FindResult.szName,p.u.SellerItemRequest.szName,20);
	char szQuery[1000] ={0,};
	if(p.u.SellerItemRequest.iKey)
	{
	sprintf(szQuery,"EXEC MerchantItemSearchSellerSide %d, '%s',%d",
		p.u.SellerItemRequest.iIndex, szName,IS_END_ALL_RIGHT);//牢郸胶 焊促 农绊 捞抚苞 IsEnd 绰 0 牢巴阑 啊廉可聪促.
	}
	else
	{
	sprintf(szQuery,"EXEC MerchantItemSearchSellerSideInverse %d, '%s',%d",
		p.u.SellerItemRequest.iIndex, szName,IS_END_ALL_RIGHT);//牢郸胶 焊促 农绊 捞抚苞 IsEnd 绰 0 牢巴阑 啊廉可聪促.
	}

	if(SearchAuctionItem(&FindResult,szQuery))
	{
		t_packet rp;
		rp.h.header.type = CMD_MERCHANT_SELL_LIST_REQUEST_RESULT;
		rp.h.header.size = sizeof(SEARCHRESULTLIST);
		rp.u.SearchResultList= FindResult;
		::QueuePacket(connections,iCn,&rp,1);
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 府胶飘 八祸 窍扁 场 (魄概磊
////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 昏力 窍扁 矫累(魄概 秒家)
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::RecvCMD_MERCHANT_SELL_ITEM_DELETE_COMFORM(const int cn,t_packet &p)//魄概 酒捞袍阑 昏力
{	//捞抚棺 牢郸胶客 弊俊蝶弗 酒捞袍阑 罐酒坷档废 茄促.
	//酒捞袍捞 乐阑 版快 弊 沥焊甫 厚背 秦毫具 茄促
/*	
CREATE PROC MerchantItemCancelComform
(
@No	int,
@SellerName char(20),
@SetIsEnd int,
@BeforeIsEnd int
)
as

UPDATE MerchantSeller SET [IsEnd] = @SetIsEnd WHERE   ([SellerName] =@SellerName) AND ([No] = @No)AND ([IsEnd] = @BeforeIsEnd)
SELECT   [No], [SellerName], [IsEnd],[SellItemNo],[SellItemAttr1],[SellItemAttr2],[SellItemAttr3],[SellItemAttr4],[SellItemAttr5],[SellItemAttr6] FROM      MerchantSeller WHERE  ([SellerName] =@SellerName) AND ([No] = @No)
MerchantItemCancelComform 1,'拳尔惑快', 1,1 //磊悼栏肺 蔼 眉农秦辑 搬苞 罐酒坷绰巴捞寸.. ^^ IsEnd啊 馆靛矫 府畔等促.
*/// 茄锅 悸泼 登搁 滴锅掳 窍歹扼档 悸泼捞 阂啊瓷 窍促
	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
	::SQLAllocStmt(hDBC, &hStmt);
	char szQuery[255] ={0,};
	SELLERITEMDELETE *pSID = &p.u.SellerItemDelete;
	SELLERITEMDELETE QueryResult = *pSID;//罐篮吧肺 檬扁拳甫 矫挪促
	sprintf(szQuery,"EXEC MerchantItemCancelComform %d, '%s' , %d , %d ",//牢郸胶,捞抚,官曹蔼,捞傈蔼
	pSID->iIndex ,pSID->szName ,IS_END_DELETING,IS_END_ALL_RIGHT );//捞抚栏肺 墨款飘甫 罐绰促
	//IS_END_ALL_RIGHT 惑怕俊辑父 瘤匡 荐 乐促 咯矾锅 瘤快绰扒 阂啊瓷 窍促
	int iSellerCount = 0;
	retCode = SQLExecDirect(hStmt, (UCHAR *)szQuery, SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{
		retCode = SQLFetch(hStmt);
		if( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{
			int column = 0;
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.iIndex,			0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_CHAR,	QueryResult.szName,				20, &cbValue);
			::EatRearWhiteChar(QueryResult.szName);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.iKey,				0, &cbValue);//IsEnd蔼捞 甸绢柯促
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.item_no,	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[0],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[1],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[2],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[3],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[4],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[5],	0, &cbValue);
			if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
			{	//咯扁 吭澜篮 单捞鸥啊 钢履窍促绰 刘芭.(诀单捞飘俊 己傍 沁促.
				goto __SUCCESS;
			}
			else //葛电 抗寇 惑炔篮 绝促.
			{	//捞繁 富档 救登绰 惑炔
				goto __FAIL;
			}
		}
		else
		{
			QueryResult.iKey = -1;
			goto __FAIL;
		}
	}
	else 
	{
		QueryResult.iKey = -1;
		goto __FAIL;
	}

__FAIL:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);
		return;
	}
__SUCCESS:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);
		p.h.header.type = CMD_MERCHANT_SELL_ITEM_DELETE_COMFORM_RESULT;//鸥涝阑 背眉 茄促
		*pSID = QueryResult;//焊尘 菩哦俊 搬苞拱阑 角绢 焊辰促
		::QueuePacket(connections,cn,&p,1);	
		return;
	}	
}

void CAuction::RecvCMD_MERCHANT_SELL_ITEM_DELETE_COMFORM_RESULT(const int cn,t_packet &p)//魄概 酒捞袍阑 昏力
{	//甘辑滚啊 瘤鞭 沁栏搁 IS_END_DELETE_COMPLETE 啊 眉农 登绢 乐阑 巴捞绊 
	//酒聪搁 IS_END_ALL_RIGHT啊 眉农 登绢 乐阑 巴捞促
	const int iKey = p.u.SellerItemDelete.iKey;
	if(	IS_END_DELETE_COMPLETE  != iKey
	&&	IS_END_ALL_RIGHT		!= iKey)
	{//捞芭 滴俺啊 酒聪促
		MyLog(0,"Auction Critical Error!! Type => CMD_MERCHANT_SELL_ITEM_DELETE_COMFORM_RESULT");
		return;
	}

	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
	::SQLAllocStmt(hDBC, &hStmt);
	char szQuery[255] ={0,};
	SELLERITEMDELETE *pSID = &p.u.SellerItemDelete;
	SELLERITEMDELETE QueryResult = *pSID;//罐篮吧肺 檬扁拳甫 矫挪促
	sprintf(szQuery,"EXEC MerchantItemCancelComform %d, '%s' , %d , %d ",//牢郸胶,捞抚,官曹蔼,捞傈蔼
	pSID->iIndex,pSID->szName ,p.u.SellerItemDelete.iKey, IS_END_DELETING );//捞抚栏肺 墨款飘甫 罐绰促
	int iSellerCount = 0;
	retCode = SQLExecDirect(hStmt, (UCHAR *)szQuery, SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{
		retCode = SQLFetch(hStmt);
		if( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{
			int column = 0;
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.iIndex,			0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_CHAR,	QueryResult.szName,				20, &cbValue);
			::EatRearWhiteChar(QueryResult.szName);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.iKey,				0, &cbValue);//IsEnd蔼捞 甸绢柯促
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.item_no,	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[0],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[1],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[2],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[3],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[4],	0, &cbValue);
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&QueryResult.SellItem.attr[5],	0, &cbValue);
			
			if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
			{	//咯扁 吭澜篮 单捞鸥啊 钢履窍促绰 刘芭.(诀单捞飘俊 己傍 沁促.
				goto __SUCCESS;
			}
			else //葛电 抗寇 惑炔篮 绝促.
			{	//捞繁 富档 救登绰 惑炔
				goto __FAIL;
			}
		}
			goto __FAIL;
	}		

	goto __FAIL;

__FAIL:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);
		return;
	}
__SUCCESS:
	{
		::SQLFreeStmt(hStmt, SQL_DROP);
		p.h.header.type = CMD_MERCHANT_SELL_ITEM_DELETE_RESULT;//鸥涝阑 背眉 茄促
		*pSID = QueryResult;//焊尘 菩哦俊 搬苞拱阑 角绢 焊辰促
		::QueuePacket(connections,cn,&p,1);	
		return;
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 昏力 窍扁 场(魄概 秒家)
////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 殿废 窍扁
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::RecvCMD_MERCHANT_SELL_ITEM_REGISTER_COMFORM(const int iCn,t_packet &p)//魄概 酒捞袍阑 殿废
{	//肮荐甫 眉农窍绊 //搬苞蔼阑 甘栏肺 焊辰促
	//殿废 且 荐 乐绰瘤 磊脚捞 殿废茄 肮荐 眉农
/*
CREATE PROC MerchantItemRegistCountComform
(
@SellerName char(20)
)
as

select count(*) FROM      MerchantSeller where SellerName = @SellerName

MerchantItemRegistCountComform '捞抚'
*/
	HSTMT		hStmt = NULL;
	RETCODE		retCode;
	SDWORD		cbValue;
	::SQLAllocStmt(hDBC, &hStmt);
	char szQuery[255] ={0,};
	sprintf(szQuery,"EXEC MerchantItemRegistCountComform '%s'",p.u.SellerItemRegister.szName);//捞抚栏肺 墨款飘甫 罐绰促
	int iSellerCount = 0;
	retCode = SQLExecDirect(hStmt, (UCHAR *)szQuery, SQL_NTS);
	if(retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
	{
		retCode = SQLFetch(hStmt);
		if( retCode == SQL_SUCCESS || retCode == SQL_SUCCESS_WITH_INFO)
		{
			int column = 0;
			retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG,	&iSellerCount	,	0, &cbValue);
			goto __SUCCESS;
		}
		else
		{
			goto __FAIL;

⌨️ 快捷键说明

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