本文整理汇总了C++中Obj_Human::EquipRemould方法的典型用法代码示例。如果您正苦于以下问题:C++ Obj_Human::EquipRemould方法的具体用法?C++ Obj_Human::EquipRemould怎么用?C++ Obj_Human::EquipRemould使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_Human
的用法示例。
在下文中一共展示了Obj_Human::EquipRemould方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
uint CGEquipRemouldHandler::Execute(CGEquipRemould* pPacket,Player* pPlayer)
{
__ENTER_FUNCTION
GamePlayer* pGamePlayer = (GamePlayer*)pPlayer;
Assert( pGamePlayer );
Obj_Human* pHuman = pGamePlayer->GetHuman();
Assert( pHuman );
Scene* pScene = pHuman->getScene();
if( pScene==NULL )
{
Assert(FALSE);
return PACKET_EXE_ERROR;
}
//检查线程执行资源是否正确
Assert( MyGetCurrentThreadID()==pScene->m_ThreadID );
//交易状态不可操作
if(pHuman->m_ExchangBox.m_Status > 0)
{//丢弃
g_pLog->FastSaveLog( LOG_FILE_1, "ERROR: ObjID=%d, ExchangBox::m_Status>0" ,pHuman->GetID()) ;
return PACKET_EXE_CONTINUE ;
}
//摆摊状态不可操作
if(pHuman->m_StallBox.GetStallStatus() == ServerStallBox::STALL_OPEN)
{//丢弃
g_pLog->FastSaveLog( LOG_FILE_1, "ERROR: ObjID=%d, ServerStallBox::STALL_OPEN" ,pHuman->GetID()) ;
return PACKET_EXE_CONTINUE ;
}
Item* pEquipItem = NULL;
UINT EquipPoint = INVALID_ITEM_POS;
UINT BagIndex = INVALID_ITEM_POS;
EQUIPREMOULD_RESULT nResult = EQUIPREMOULD_FAIL;
GCEquipRemouldResult Msg;
switch(pPacket->GetEquipPosType())
{
case ENUM_EQUIP_POINT:
{
EquipPoint = pPacket->GetPos();
if(EquipPoint>HEQUIP_ADORN2)
{
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipRemouldHandler: EquipPoint error, EquipPoint=%d", EquipPoint) ;
return PACKET_EXE_ERROR;
}
ItemContainer* pEquipContainer = pHuman->GetEquipContain();
if(NULL==pEquipContainer)
{
AssertEx(FALSE,"[CGEquipRemouldHandler]: NULL EquipContainer pointer found!");
}
pEquipItem = pEquipContainer->GetItem((UINT)EquipPoint);
Assert(pEquipItem);
if(pEquipItem->IsEmpty())
{
nResult = EQUIPREMOULD_EQUIP_FAIL;
Msg.SetResult(nResult);
pGamePlayer->SendPacket( &Msg ) ;
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipRemouldHandler pEquipItem is Null at EquipPoint= %d", EquipPoint) ;
return PACKET_EXE_CONTINUE;
}
Assert (pEquipItem->GetItemClass() == ICLASS_EQUIP);
if(!(pPacket->getItemID() == pEquipItem->GetGUID()))
{
nResult = EQUIPREMOULD_EQUIP_FAIL;
Msg.SetResult(nResult);
pGamePlayer->SendPacket( &Msg ) ;
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipRemouldHandler GUID is different ") ;
return PACKET_EXE_CONTINUE;
}
}
break;
case ENUM_BAG:
{
BagIndex = pPacket->GetPos();
ItemContainer* pItemContainer = HumanItemLogic::GetBagContainer(pHuman,BagIndex);
if( pItemContainer == NULL )
{
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipRemouldHandler: BagIndex error, BagIndex=%d", BagIndex) ;
return PACKET_EXE_ERROR;
}
if (!pItemContainer->IsCanUse())
{
nResult = EQUIPREMOULD_BAG_INVALID;
Msg.SetResult(nResult);
pGamePlayer->SendPacket( &Msg ) ;
g_pLog->FastSaveLog( LOG_FILE_1, "CGEquipRemouldHandler: ItemContainer is invalid, ContainerType=%d, BagIndex=%d",
pItemContainer->GetContainerType(), BagIndex) ;
return PACKET_EXE_ERROR;
}
pEquipItem = pItemContainer->GetItem(pItemContainer->BagIndex2ConIndex(BagIndex));
if(pEquipItem->IsEmpty())
{
//.........这里部分代码省略.........