本文整理汇总了C++中Player::AddItemToWishList方法的典型用法代码示例。如果您正苦于以下问题:C++ Player::AddItemToWishList方法的具体用法?C++ Player::AddItemToWishList怎么用?C++ Player::AddItemToWishList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player::AddItemToWishList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle
//.........这里部分代码省略.........
}
}
else
{
if(!pPlayer->AddSocialItem(randomSku, 1, 0,0))
{
SendRet2User(pUser,RseUpdateSocialItemRet_AddSocialItemFailed,rse);
return;
}
}
pDBSI->set_counter(nextCounter);
if(!pPlayer->CostSocialItem(req->sku(), 1))
{
SendRet2User(pUser,RseUpdateSocialItemRet_AddSocialItemFailed,rse);
return;
}
SendRet2User(pUser,RseUpdateSocialItemRet_Success,rse);
}
eh_->getDataHandler()->markUserDirty(pUser);
}
else if(strAction == "buyItem")
{
SendRet2User(pUser,RseUpdateSocialItemRet_Success,rse);
}
else if(strAction == "removeItem")
{
if(!pPlayer->CostSocialItem(req->sku(), 1))
{
SendRet2User(pUser,RseUpdateSocialItemRet_AddSocialItemFailed,rse);
return;
}
eh_->getDataHandler()->markUserDirty(pUser);
SendRet2User(pUser,RseUpdateSocialItemRet_Success,rse);
}
else if(strAction == "applyCrafting")// 制作炸弹和落石
{
string sku = "";
if(req->sku() == "1")//洲际导弹
sku = "7000";
else
sku = "7001";
if(!pPlayer->AddSocialItem(sku, 1))
{
SendRet2User(pUser,RseUpdateSocialItemRet_ApplyCraftingFailed,rse);
return;
}
eh_->getDataHandler()->markUserDirty(pUser);
SendRet2User(pUser,RseUpdateSocialItemRet_Success,rse);
}
else if(strAction == "applyCollectable")// 收藏里兑换物品
{
CFG_Collectables* Tbl = CollectablesTblInst::instance().GetItem(req->sku());
string itemSkuList = Tbl->itemSkuList;
itemSkuList.erase(0, 1);
itemSkuList.erase(itemSkuList.size() - 1, 1);
vector<string> SkuList = split(itemSkuList,",");
for(int i = 0;i<SkuList.size();i++)
{
string Sku = SkuList[i];
if(!pPlayer->CostSocialItem(Sku, 1))
{
SendRet2User(pUser,RseUpdateSocialItemRet_SocialItemNotEnough,rse);
return;
}
}
if(!pPlayer->AddSocialItem(Tbl->reward, 1))
{
SendRet2User(pUser,RseUpdateSocialItemRet_AddSocialItemFailed,rse);
return;
}
eh_->getDataHandler()->markUserDirty(pUser);
SendRet2User(pUser,RseUpdateSocialItemRet_Success,rse);
}
else if(strAction == "addItemToWishList")
{
if(!pPlayer->AddItemToWishList(req->sku()))
{
SendRet2User(pUser,RseUpdateSocialItemRet_AddToWishListFailed,rse);
return;
}
eh_->getDataHandler()->markUserDirty(pUser);
SendRet2User(pUser,RseUpdateSocialItemRet_Success,rse);
}
else if(strAction == "removeItemFromWishList")
{
if(!pPlayer->RemoveItemFromWishList(req->sku()))
{
SendRet2User(pUser,RseUpdateSocialItemRet_RemoveItemFromWishListFailed,rse);
return;
}
eh_->getDataHandler()->markUserDirty(pUser);
SendRet2User(pUser,RseUpdateSocialItemRet_Success,rse);
}
else if(strAction == "sendItemToNeighborWishList")
{
}
}