📄 auction.cpp
字号:
// Auction.cpp: implementation of the CAuction class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Auction.h"
#include "Menu.h"
#include "dragon.h"
#include "gameproc.h"
#include "MenuSet.h"
#include "Chat.h"
#include "Skill.h"
#include "CurrentMsgMgr.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CAuction Auction;
const SUPERMONEY SM1(BOND_MONEY_1000 ,1000000000);
const SUPERMONEY SM2(BOND_MONEY_500 ,500000000);
const SUPERMONEY SM3(BOND_MONEY_100 ,100000000);
const SUPERMONEY SM4(BOND_MONEY_50 ,50000000);
const SUPERMONEY SM5(BOND_MONEY_10 ,10000000);
const SUPERMONEY SM6(BOND_MONEY_5 ,5000000);
const SUPERMONEY aBondMoney[BOND_MONEY_MAX] = {SM1,SM2,SM3,SM4,SM5,SM6};
CAuction::CAuction()
{
Clear();
}
CAuction::~CAuction()
{
Clear();
}
void CAuction::Clear()
{
ClearFK();
::memset(&m_SearchList,0,sizeof(SEARCHRESULTLIST));
m_iWaitPageRefresh = 0;
m_iBuyerViewPage = 0;
m_iSellerViewPage = 0;
m_iResultViewPage = 0;
m_iDeleteItemIndex= 0;
m_iBuyItemIndex = 0;
m_iTakeItemIndex= 0;
this->m_nPeriod = 0;
strcpy(m_szKeyWord,"");
strcpy(m_szMerchantName,"");
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//备概磊啊 酒捞袍 八祸 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::SendCMD_MERCHANT_BUY_LIST_REQUEST(const int iIndex, const int iNeedIndexOver)//府胶飘 夸没(备概磊啊 焊绰巴//八祸扁啊 龋免
{
//soto-030611 变鞭荐沥.
// ::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,82));
// return;
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,500));
//菩哦 焊郴扁
t_packet p;
p.h.header.type = CMD_MERCHANT_BUY_ITEM_SEARCH;
p.h.header.size = sizeof(SEARCHPACKETCLIENT);
if(m_bChkKeyWord)
{
strcpy(p.u.SearchPacketClient.szKeyWord,m_szKeyWord);
}
else
{
strcpy(p.u.SearchPacketClient.szKeyWord,"");
}
if(m_bChkMerchantName)
{
strcpy(p.u.SearchPacketClient.szMerchant,m_szMerchantName);
}
else
{
strcpy(p.u.SearchPacketClient.szMerchant,"");
}
p.u.SearchPacketClient.nPeriod = m_nPeriod;
p.u.SearchPacketClient.iIndex = iIndex;
p.u.SearchPacketClient.iKey = iNeedIndexOver;
m_iWaitPageRefresh = 1;
::QueuePacket(&p,1);
::CloseAllMenu();
//>soto-030511 荐沥 秦具窃.
}
void CAuction::RecvCMD_MERCHANT_BUY_LIST_REQUEST_RESULT(t_packet &p)//府胶飘 搬苞(备概磊啊 焊绰巴
{
Clear();
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,502));
m_SearchList = p.u.SearchResultList;
m_iBuyerViewPage = (p.u.SearchResultList.iKey)?AUCTION_PAGE_MIN:AUCTION_PAGE_MAX;
m_iWaitPageRefresh = 0;
::CallSmallMenu(MN_MERCHANT_BUY);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//备概磊啊 酒捞袍 八祸 窍扁
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//备涝窍扁 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::SendCMD_MERCHANT_ITEM_BUY(SEARCHRESULT &SR)//备概窍扁(备概磊啊 急琶
{
if(!strcmp( SR.szSellerName,Hero->name))
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,503));
return;
}
int iChatTarget = CHAT_TARGET_NORMAL;
if(!SR.iSellValue)
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,504));
iChatTarget = ::InsertWisperList(SR.szSellerName);
}
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,505));
t_packet p;
p.h.header.type = CMD_MERCHANT_ITEM_BUY;
p.h.header.size = sizeof(MERCHANT_ITEM_BUY);
p.u.MerchantItemBuy.iIndex = SR.iIndex;//备涝且 酒捞袍狼 牢郸胶 蔼
p.u.MerchantItemBuy.iCn = Hero->id;//目池记 蔼
strcpy(p.u.MerchantItemBuy.szSellerName,SR.szSellerName);
strcpy(p.u.MerchantItemBuy.szBuyerName,Hero->name);//备概磊 捞抚
p.u.MerchantItemBuy.dwSellValue = SR.iSellValue;//魄概陛咀篮 20撅阑 逞扁瘤 臼嚼聪促.
p.u.MerchantItemBuy.SellItem = SR.m_ResultItem;
p.u.MerchantItemBuy.iKey = 0;
::QueuePacket(&p,1);
CloseAllMenu();
if(!SR.iSellValue)
{
::SetChatMode(CM_MESSAGE);
::SetChatTarget(iChatTarget);
}
}
void CAuction::RecvCMD_MERCHANT_ITEM_BUY_RESULT(t_packet &p)//备概窍扁(备概磊啊 急琶
{//备概搬苞啊 柯促
//舅酒辑 贸府 ぱぱ;.//iKey 蔼栏肺 魄喊 钦聪促.//啊廉啊扁甫 官扼绰 惑怕 //构电 且 荐 乐绰 惑怕
Clear();
const int iResult = p.u.MerchantItemBuy.iKey;
switch(iResult)
{
case IS_END_WAIT_TAKE://备概 肯丰 惑怕
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,506));
}break;
case IS_END_ALL_RIGHT://备概傈 惑怕匙.. 备涝 阂啊瓷 沁唱焊促
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,507));
}break;
default://
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,508),iResult);
}break;
/*
case IS_END_DELETE_COMPLETE:
case IS_END_DELETING:
{
COMMENT ::AddCurrentStatusMessage(FONT_COLOR_WHITE,"备涝俊 角菩 沁嚼聪促. 魄概磊啊 瘤快绊 乐嚼聪促.");
}break;
case IS_END_BUYING:
{
COMMENT ::AddCurrentStatusMessage(FONT_COLOR_WHITE,"穿焙啊啊 备概吝涝聪促.");
}break;
*/
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//备涝窍扁 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//郴啊 魄概窍绰 府胶飘 夸没 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::SendCMD_MERCHANT_SELL_LIST_REQUEST(const int iIndex, const int iNeedIndexOver)//府胶飘 夸没(魄概磊啊 焊绰巴
{
if(!::IsMerchant())
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,509));
return;
}
if(iIndex && !iNeedIndexOver)
{
if(AUCTION_PAGE_MIN == GetSellerViewPage())
{
for(int xx = 0; MAX_VIEW_ABLE_PER_PAGE > xx; xx++)
{
if(!m_SearchList.ResultList[xx].m_ResultItem.item_no)
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,510));
return;
}
}
}
}
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,511));
t_packet p;
p.h.header.type = CMD_MERCHANT_SELL_ITEM_INFO_REQUEST;
p.h.header.size = sizeof(SELLERITEMREQUEST);
p.u.SellerItemRequest.iCn = Hero->id;
strcpy(p.u.SellerItemRequest.szName,Hero->name);
p.u.SellerItemRequest.iIndex = iIndex;
p.u.SellerItemRequest.iKey = iNeedIndexOver;
m_iWaitPageRefresh = 1;
::QueuePacket(&p,1);
}
void CAuction::RecvCMD_MERCHANT_SELL_LIST_REQUEST_RESULT(t_packet &p)//府胶飘 搬苞(魄概磊啊 焊绰巴
{
Clear();
if(!::IsMerchant())
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,509));
return;
}
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,512));
m_SearchList = p.u.SearchResultList;
if(p.u.SearchResultList.iKey)
{
m_iSellerViewPage = AUCTION_PAGE_MIN;
}
else
{
if(m_SearchList.ResultList[0].m_ResultItem.item_no)
{
m_iSellerViewPage = AUCTION_PAGE_MIN;
}
if(m_SearchList.ResultList[6].m_ResultItem.item_no)
{
m_iSellerViewPage = AUCTION_PAGE_MIN+1;
}
if(m_SearchList.ResultList[12].m_ResultItem.item_no)
{
m_iSellerViewPage = AUCTION_PAGE_MIN+2;
}
if(m_SearchList.ResultList[18].m_ResultItem.item_no)
{
m_iSellerViewPage = AUCTION_PAGE_MAX;
}
}
m_iWaitPageRefresh = 0;
::CallSmallMenu(MN_MERCHANT_SELL_INFO);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//郴啊 魄概窍绰 府胶飘 夸没 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//芭贰拱 魄概秒家 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::SendCMD_MERCHANT_SELL_ITEM_DELETE()//魄概 酒捞袍阑 昏力
{
t_packet p;
p.h.header.type = CMD_MERCHANT_SELL_ITEM_DELETE;
p.h.header.size = sizeof(SELLERITEMDELETE);
SEARCHRESULT *SR = NULL;
for(int i = 0; 24 > i; i++)
{
if(m_iDeleteItemIndex == m_SearchList.ResultList[i].iIndex )
{
SR = &m_SearchList.ResultList[i];
break;
}
}
if( !m_iDeleteItemIndex || 24 == i )
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,513));
return;
}
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,514));
p.u.SellerItemDelete.iIndex = SR->iIndex;//魄概拱前狼 牢郸胶
p.u.SellerItemDelete.iCn = Hero->id;
strcpy(p.u.SellerItemDelete.szName,SR->szSellerName);
p.u.SellerItemDelete.dwSellValue = SR->iSellValue;
p.u.SellerItemDelete.SellItem = SR->m_ResultItem;
p.u.SellerItemDelete.iKey = 0;
::QueuePacket(&p,1);
}
void CAuction::RecvCMD_MERCHANT_SELL_ITEM_DELETE_RESULT(t_packet &p)//魄概 酒捞袍阑 昏力
{
Clear();
if(IS_END_DELETE_COMPLETE == p.u.SellerItemDelete.iKey)
{//己傍利栏肺 瘤鞭 罐疽嚼聪促.
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,515));
}
else
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,516));
}
SendCMD_MERCHANT_SELL_LIST_REQUEST();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//芭贰拱 魄概秒家 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//芭贰拱 殿废窍扁 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::SendCMD_MERCHANT_SELL_ITEM_REGISTER()//魄概 酒捞袍阑 殿废
{//魄概酒捞袍阑 殿废 钦聪促.
t_packet p;
p.h.header.type = CMD_MERCHANT_SELL_ITEM_REGISTER;
p.h.header.size = sizeof(SELLERITEMREGISTER);
p.u.SellerItemRegister.iCn = Hero->id;
strcpy(p.u.SellerItemRegister.szName,Hero->name);
p.u.SellerItemRegister.pos = m_SellItemPos;//pos 蔼
p.u.SellerItemRegister.SellItem = m_SellItemAttr;//酒捞袍 角力蔼
p.u.SellerItemRegister.dwSellValue = m_iSellValue;
// if(!m_iSellValue)
// {
// COMMENT ::AddCurrentStatusMessage(FONT_COLOR_WHITE,"流立芭贰肺 殿废 登菌嚼聪促.");
// COMMENT ::AddCurrentStatusMessage(FONT_COLOR_WHITE,"酒流篮 瘤盔窍瘤 臼绰 扁瓷涝聪促.");
// return;
// }
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,517));
//菩哦 蔼 汲沥秦辑 焊尘巴
::QueuePacket(&p,1);
}
void CAuction::RecvCMD_MERCHANT_SELL_ITEM_REGISTER_RESULT(t_packet &p)//魄概 酒捞袍阑 殿废
{
Clear();
//郴 府胶飘甫 促矫 夸没 窍绰巴阑 持嚼聪促.
if(1==p.u.SellerItemRegister.iKey)
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,518));
}
else
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,519));
}
SendCMD_MERCHANT_SELL_LIST_REQUEST();//促矫 唱狼 魄概 格废 府胶飘甫 夸没钦聪促.
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//芭贰拱 殿废窍扁 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//芭贰 搬苞拱 府胶飘 罐酒坷扁 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::SendCMD_MERCHANT_RESULT_LIST_REQUEST(const int iIndex, const int iNeedIndexOver)
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,520));
t_packet p;
p.h.header.type = CMD_MERCHANT_RESULT_LIST_REQUEST;
p.h.header.size = sizeof(SELLERITEMREQUEST);
p.u.SellerItemRequest.iCn = Hero->id;
strcpy(p.u.SellerItemRequest.szName,Hero->name);
p.u.SellerItemRequest.iIndex = iIndex;
p.u.SellerItemRequest.iKey = iNeedIndexOver;
m_iWaitPageRefresh = 1;
::QueuePacket(&p,1);
}
void CAuction::RecvCMD_MERCHANT_RESULT_LIST_REQUEST_RESULT(t_packet &p)
{
Clear();
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,521));
m_SearchList = p.u.SearchResultList;
m_iResultViewPage = (p.u.SearchResultList.iKey)?AUCTION_PAGE_MIN:AUCTION_PAGE_MAX;
m_iWaitPageRefresh = 0;
::CallSmallMenu(MN_MERCHANT_RESULT_TAKE);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//芭贰 搬苞拱 府胶飘 罐酒坷扁 场
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//芭贰 搬苞拱 茫扁 矫累
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CAuction::SendCMD_MERCHANT_RESULT_TAKE(SEARCHRESULT &SR)
{
t_packet p;
p.h.header.type = CMD_MERCHANT_RESULT_TAKE;
p.h.header.size = sizeof(MERCHANTRESULTTAKE);
if(!SR.iIndex)
{
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,524));
return;
}
::AddCurrentStatusMessage(FONT_COLOR_WHITE,lan->OutputMessage(4,523));
p.u.MerchantResultTake.iIndex = SR.iIndex;
p.u.MerchantResultTake.iCn = Hero->id;
strcpy(p.u.MerchantResultTake.szMyName,Hero->name);
strcpy(p.u.MerchantResultTake.SellerName,SR.szSellerName);
strcpy(p.u.MerchantResultTake.BuyerName,SR.szBuyerName);
p.u.MerchantResultTake.dwSellValue = SR.iSellValue;
p.u.MerchantResultTake.SellItem = SR.m_ResultItem;
p.u.MerchantResultTake.iSellerTake = 0;
p.u.MerchantResultTake.iBuyerTake = 0;
p.u.MerchantResultTake.iKey = 0;
//牢郸胶 锅龋何磐秦辑 磊丰 悸泼
::QueuePacket(&p,1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -