📄 auction.cpp
字号:
}
}
goto __FAIL;
__FAIL:
{
::SQLFreeStmt(hStmt, SQL_DROP);
return;
}
__SUCCESS:
{
::SQLFreeStmt(hStmt, SQL_DROP);
p.h.header.type = CMD_MERCHANT_SELL_ITEM_REGISTER_COMFORM_RESULT;//哪汽 搬苞促
p.u.SellerItemRegister.iKey = (iSellerCount <MAX_SEARCH_RESULT_LIST)?1:0;//迫 荐 乐栏搁 1 酒聪搁 0//MAX_SEARCH_RESULT_LIST 官操瘤 富绊 蔼阑 促弗芭 持绢扼
::QueuePacket(connections,iCn,&p,1);//罐篮 甘辑滚肺 促矫 傈价
return;//颇绰 肮荐 巩力
}
}
void CAuction::RecvCMD_MERCHANT_SELL_ITEM_REGISTER_COMFORM_RESULT(const int iCn,t_packet &p)//魄概 酒捞袍阑 殿废
{
//殿废阑 窍绊 IsEnd甫 芭贰辆丰肺 父电促. 捞芭 内爹档 持阑 巴
// p.u.SellerItemRegister. //Key甫 炼例 钦矫促
//魄概拱前 殿废
/*
CREATE PROC MerchantItemRegist
(
@SellerName char(20),
@ExchangeMoney numeric,
@RareType int,
@ItemLevel int,
@TacticType int,
@WearKind int,
@ItemNo int,
@ItemAttr1 numeric,
@ItemAttr2 numeric,
@ItemAttr3 numeric,
@ItemAttr4 numeric,
@ItemAttr5 numeric,
@ItemAttr6 numeric
)
as
INSERT into MerchantSeller(
SellerName,
ExchangeMoney,
RareType ,
ItemLevel ,
TacticType ,
WearKind ,
SellItemNo ,
SellItemAttr1 ,
SellItemAttr2 ,
SellItemAttr3 ,
SellItemAttr4 ,
SellItemAttr5 ,
SellItemAttr6
) VALUES ( @SellerName, @ExchangeMoney, @RareType, @ItemLevel, @TacticType, @WearKind,
@ItemNo, @ItemAttr1,@ItemAttr2,@ItemAttr3,@ItemAttr4,@ItemAttr5,@ItemAttr6 )
角青规过.
exec MerchantItemRegist '荤恩捞抚',捣,努贰胶,饭绢,酒捞袍饭骇,琶平,涝绰厘家,酒捞袍 ,attr1~6
*/
lpSELLERITEMREGISTER lpSIR = &p.u.SellerItemRegister;
char szQuery[500] = {0,};
sprintf(szQuery,"EXEC MerchantItemRegist '%s', "
"%d, "
"%d,%d,%d,%d,"
"%d, %d,%d,%d,%d,%d,%d",
lpSIR->szName,
(int)lpSIR->dwSellValue,
lpSIR->iFKRareType,
lpSIR->iFKLevel,
lpSIR->iFKTacticType,
lpSIR->iFKWearType,
lpSIR->SellItem.item_no,
(int)lpSIR->SellItem.attr[0],
(int)lpSIR->SellItem.attr[1],
(int)lpSIR->SellItem.attr[2],
(int)lpSIR->SellItem.attr[3],
(int)lpSIR->SellItem.attr[4],
(int)lpSIR->SellItem.attr[5]
);
if( 1 == ::Querry_SQL(szQuery,hDBC))//靛贰帮 叼厚肺 朝覆
{//己傍//殿废 肯丰
p.u.SellerItemRegister.iKey = 1;
}
else
{//角菩
p.u.SellerItemRegister.iKey = 0;
}
p.h.header.type = CMD_MERCHANT_SELL_ITEM_REGISTER_RESULT;//搬苞甫 朝赴促
::QueuePacket(connections,iCn,&p,1);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 殿废 窍扁 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 芭贰 搬苞 府胶飘 罐扁 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::RecvCMD_MERCHANT_RESULT_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[255] ={0,};
if(p.u.SellerItemRequest.iKey)
{
sprintf(szQuery,"EXEC MerchantResultItemSearch %d,'%s',%d",
p.u.SellerItemRequest.iIndex, szName,IS_END_WAIT_TAKE);//捞抚苞 IsEnd 绰 0 牢巴阑 啊廉可聪促.
}
else
{
sprintf(szQuery,"EXEC MerchantResultItemSearchInverse %d,'%s',%d",
p.u.SellerItemRequest.iIndex, szName,IS_END_WAIT_TAKE);//捞抚苞 IsEnd 绰 0 牢巴阑 啊廉可聪促.
}
if(SearchAuctionItem(&FindResult,szQuery))
{
t_packet rp;
rp.h.header.type = CMD_MERCHANT_RESULT_LIST_REQUEST_RESULT;
rp.h.header.size = sizeof(SEARCHRESULTLIST);
rp.u.SearchResultList= FindResult;
::QueuePacket(connections,iCn,&rp,1);
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 芭贰 搬苞 府胶飘 罐扁 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 芭贰 搬苞拱 啊廉啊扁 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::RecvCMD_MERCHANT_RESULT_TAKE_COMFORM(const int iCn,t_packet &p)
{ //捞抚棺 牢郸胶客 弊俊蝶弗 酒捞袍阑 罐酒坷档废 茄促.
//酒捞袍捞 乐阑 版快 弊 沥焊甫 厚背 秦毫具 茄促
//SellerTake BuyerTake 眉农甫 茄促
HSTMT hStmt = NULL;
RETCODE retCode;
SDWORD cbValue;
char szQuery[255] ={0,};
MERCHANTRESULTTAKE *pMRT = &p.u.MerchantResultTake;
MERCHANTRESULTTAKE QueryResult = *pMRT;//罐篮吧肺 檬扁拳甫 矫挪促
COMMENT ::MyLog(0,"O Index %d ItemNo %d",pMRT->iIndex , pMRT->SellItem);
COMMENT ::MyLog(0,"N Index %d ItemNo %d",QueryResult.iIndex , QueryResult.SellItem);
if(pMRT->iKey)//魄概磊 捞搁
{
sprintf(szQuery,"EXEC MerchantResultItemTakeSellerSideComform %d, '%s' , %d , %d, %d ",//牢郸胶,捞抚,官曹蔼,捞傈蔼
pMRT->iIndex, pMRT->szMyName, IS_END_WAIT_TAKE,IS_END_DELETING, IS_END_ALL_RIGHT );//捞抚栏肺 墨款飘甫 罐绰促
}
else
{
sprintf(szQuery,"EXEC MerchantResultItemTakeBuyerSideComform %d, '%s' , %d , %d , %d",//牢郸胶,捞抚,官曹蔼,捞傈蔼
pMRT->iIndex, pMRT->szMyName, IS_END_WAIT_TAKE,IS_END_DELETING, IS_END_ALL_RIGHT );//捞抚栏肺 墨款飘甫 罐绰促
}
COMMENT MyLog(0,"RecvCMD_MERCHANT_RESULT_TAKE_COMFORM %s",szQuery);
::SQLAllocStmt(hDBC, &hStmt);
//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.szSellerName, 20, &cbValue);
::EatRearWhiteChar(QueryResult.szSellerName);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_CHAR, QueryResult.szBuyerName, 20, &cbValue);
::EatRearWhiteChar(QueryResult.szBuyerName);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG, &QueryResult.iSellerTake, 0, &cbValue);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG, &QueryResult.iBuyerTake, 0, &cbValue);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG, &QueryResult.dwSellValue, 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)
{ //咯扁 吭澜篮 单捞鸥啊 钢履窍促绰 刘芭.(诀单捞飘俊 己傍 沁促.
COMMENT MyLog(0,"Update Complete");
goto __SUCCESS;
}
else //葛电 抗寇 惑炔篮 绝促.
{ //捞繁 富档 救登绰 惑炔
COMMENT MyLog(0,"Update Failed");
goto __FAIL;
}
}
else
{
COMMENT MyLog(0,"Non Select Result");
QueryResult.iKey = -1;//林搁 救等促!!
goto __SUCCESS;
}
}
else
{
COMMENT ::MyLog(0,"Query Failed");
goto __FAIL;
}
__FAIL:
{
::SQLFreeStmt(hStmt, SQL_DROP);
return;
}
__SUCCESS:
{
::SQLFreeStmt(hStmt, SQL_DROP);
p.h.header.type = CMD_MERCHANT_RESULT_TAKE_COMFORM_RESULT;//鸥涝阑 背眉 茄促
*pMRT = QueryResult;//焊尘 菩哦俊 搬苞拱阑 角绢 焊辰促
COMMENT ::MyLog(0,"O Index %d ItemNo %d",pMRT->iIndex , pMRT->SellItem);
COMMENT ::MyLog(0,"N Index %d ItemNo %d",QueryResult.iIndex , QueryResult.SellItem);
::QueuePacket(connections,iCn,&p,1);
return;
}
}
void CAuction::RecvCMD_MERCHANT_RESULT_TAKE_COMFORM_RESULT(const int iCn,t_packet &p)
{
HSTMT hStmt = NULL;
RETCODE retCode;
SDWORD cbValue;
char szQuery[255] ={0,};
MERCHANTRESULTTAKE *pMRT = &p.u.MerchantResultTake;
MERCHANTRESULTTAKE QueryResult = *pMRT;//罐篮吧肺 檬扁拳甫 矫挪促
COMMENT ::MyLog(0,"O Index %d ItemNo %d",pMRT->iIndex , pMRT->SellItem);
COMMENT ::MyLog(0,"N Index %d ItemNo %d",QueryResult.iIndex , QueryResult.SellItem);
switch(pMRT->iKey)
{
case 101://魄概磊 瘤鞭 己傍
{
sprintf(szQuery,"EXEC MerchantResultItemTakeSellerSideComform %d, '%s' , %d , %d , %d",//牢郸胶,捞抚,官曹蔼,捞傈蔼
pMRT->iIndex, pMRT->szMyName, IS_END_WAIT_TAKE,IS_END_DELETE_COMPLETE,IS_END_DELETING );//捞抚栏肺 墨款飘甫 罐绰促
}break;
case 100://备概磊 瘤鞭 己傍
{
sprintf(szQuery,"EXEC MerchantResultItemTakeBuyerSideComform %d, '%s' , %d , %d , %d ",//牢郸胶,捞抚,官曹蔼,捞傈蔼
pMRT->iIndex, pMRT->szMyName, IS_END_WAIT_TAKE,IS_END_DELETE_COMPLETE,IS_END_DELETING );//捞抚栏肺 墨款飘甫 罐绰促
}break;
case 11://魄概磊 瘤鞭 角菩
{
sprintf(szQuery,"EXEC MerchantResultItemTakeSellerSideComform %d, '%s' , %d , %d ",//牢郸胶,捞抚,官曹蔼,捞傈蔼
pMRT->iIndex, pMRT->szMyName, IS_END_WAIT_TAKE,IS_END_ALL_RIGHT ,IS_END_DELETING);//捞抚栏肺 墨款飘甫 罐绰促
::Querry_SQL(szQuery);
return;
}break;
case 10://备概磊 瘤鞭 角菩
{
sprintf(szQuery,"EXEC MerchantResultItemTakeBuyerSideComform %d, '%s' , %d , %d ",//牢郸胶,捞抚,官曹蔼,捞傈蔼
pMRT->iIndex, pMRT->szMyName, IS_END_WAIT_TAKE,IS_END_ALL_RIGHT,IS_END_DELETING );//捞抚栏肺 墨款飘甫 罐绰促
::Querry_SQL(szQuery);
return;
}break;
default:
{
MyLog(0,"Auction Critical Error!! Type => RecvCMD_MERCHANT_RESULT_TAKE_COMFORM_RESULT Query Make Fail %d",pMRT->iKey);
return;
}break;
}
::SQLAllocStmt(hDBC, &hStmt);
COMMENT ::MyLog(0,"RecvCMD_MERCHANT_RESULT_TAKE_COMFORM_RESULT %s",szQuery);
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.szSellerName, 20, &cbValue);
::EatRearWhiteChar(QueryResult.szSellerName);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_CHAR, QueryResult.szBuyerName, 20, &cbValue);
::EatRearWhiteChar(QueryResult.szBuyerName);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG, &QueryResult.iSellerTake, 0, &cbValue);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG, &QueryResult.iBuyerTake, 0, &cbValue);
retCode = ::SQLGetData(hStmt, ++column, SQL_C_LONG, &QueryResult.dwSellValue, 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)
{ //咯扁 吭澜篮 单捞鸥啊 钢履窍促绰 刘芭.(诀单捞飘俊 己傍 沁促.
COMMENT MyLog(0,"Update Complete");
goto __SUCCESS;
}
else //葛电 抗寇 惑炔篮 绝促.
{ //捞繁 富档 救登绰 惑炔
COMMENT MyLog(0,"Non Select Result");
goto __FAIL;
}
}
else
{
COMMENT MyLog(0,"Non Select Result");
goto __FAIL;
}
}
else
{
COMMENT MyLog(0,"Query Failed");
goto __FAIL;
}
__FAIL:
{
::SQLFreeStmt(hStmt, SQL_DROP);
return;
}
__SUCCESS:
{
::SQLFreeStmt(hStmt, SQL_DROP);
p.h.header.type = CMD_MERCHANT_RESULT_TAKE_RESULT;//鸥涝阑 背眉 茄促
*pMRT = QueryResult;//焊尘 菩哦俊 搬苞拱阑 角绢 焊辰促
COMMENT ::MyLog(0,"RO Index %d ItemNo %d",pMRT->iIndex , pMRT->SellItem);
COMMENT ::MyLog(0,"RN Index %d ItemNo %d",QueryResult.iIndex , QueryResult.SellItem);
::QueuePacket(connections,iCn,&p,1);
return;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 芭贰 搬苞拱 啊廉啊扁 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -