本文整理汇总了C++中PlayerObject::resetUICallbacks方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerObject::resetUICallbacks方法的具体用法?C++ PlayerObject::resetUICallbacks怎么用?C++ PlayerObject::resetUICallbacks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerObject
的用法示例。
在下文中一共展示了PlayerObject::resetUICallbacks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: destroyObject
void ObjectController::destroyObject(uint64 objectId)
{
CreatureObject* creature = dynamic_cast<CreatureObject*>(mObject); PlayerObject* playerObject = creature->GetGhost();
Datapad* datapad = playerObject->getDataPad();
Object* object = gWorldManager->getObjectById(objectId);
auto equip_service = gWorldManager->getKernel()->GetServiceManager()->GetService<swganh::equipment::EquipmentService>("EquipmentService");
auto inventory = dynamic_cast<Inventory*>(equip_service->GetEquippedObject(playerObject->GetCreature(), "inventory"));
//could be a schematic!
ManufacturingSchematic* schem = datapad->getManufacturingSchematicById(objectId);
if(schem != NULL)
{
//delete schematic
datapad->removeManufacturingSchematic(objectId);
//delete schematic object
gObjectFactory->deleteObjectFromDB(schem);
gMessageLib->sendDestroyObject(objectId,playerObject);
return;
}
// or something else
if(object == NULL)
{
DLOG(info) << "ObjController::destroyObject: could not find object " << objectId;
return;
}
// waypoint
if(object->getType() == ObjType_Waypoint)
{
// delete from db
gObjectFactory->deleteObjectFromDB(object);
if(!datapad) {
LOG(error) << "ObjectController::destroyObject cant get datapad to destroy waypoint : " << object->getId();
return;
}
datapad->RemoveWaypoint(object->getId());
//remove from grid and/or container
gWorldManager->destroyObject(object);
}
//Inangible Objects
if(object->getType() == ObjType_Intangible)
{
gObjectFactory->deleteObjectFromDB(object);
//remove from grid and/or container
gWorldManager->destroyObject(object);
}
// tangible
else if(object->getType() == ObjType_Tangible)
{
TangibleObject* tangibleObject = dynamic_cast<TangibleObject*>(object);
auto equip_service = gWorldManager->getKernel()->GetServiceManager()->GetService<swganh::equipment::EquipmentService>("EquipmentService");
auto inventory = dynamic_cast<Inventory*>(equip_service->GetEquippedObject(playerObject->GetCreature(), "inventory"));
// items
if(Item* item = dynamic_cast<Item*>(tangibleObject))
{
// handle any family specifics
switch(item->getItemFamily())
{
case ItemFamily_CraftingTools: _handleDestroyCraftingTool(dynamic_cast<CraftingTool*>(item)); break;
case ItemFamily_Instrument: _handleDestroyInstrument(item); break;
default:break;
}
}
// reset pending ui callbacks
playerObject->resetUICallbacks(object);
// delete from db CAVE :: mark if its an Object saved in the db!!!!
// temporary placed instruments are not saved in the db
gObjectFactory->deleteObjectFromDB(object);
//remove from grid and/or container and/or World
gWorldManager->destroyObject(object);
}
//.........这里部分代码省略.........
示例2: destroyObject
//.........这里部分代码省略.........
{
TangibleObject* tangibleObject = dynamic_cast<TangibleObject*>(object);
// items
if(Item* item = dynamic_cast<Item*>(tangibleObject))
{
// Does the item have a owner?
/*
if (item->getOwner() != 0)
{
gLogger->logMsgF("ObjController::handleDestroyObject: OwnerId = %"PRIu64", playerId = %"PRIu64"", MSG_NORMAL, item->getOwner(), playerObject->getId());
// Yes, is it my item?
if (item->getOwner() != playerObject->getId())
{
// Not allowed to delete this item.
gMessageLib->sendSystemMessage(playerObject,L"","error_message","insufficient_permissions");
return;
}
}
*/
// handle any family specifics
switch(item->getItemFamily())
{
case ItemFamily_CraftingTools:
_handleDestroyCraftingTool(dynamic_cast<CraftingTool*>(item));
break;
case ItemFamily_Instrument:
_handleDestroyInstrument(item);
break;
default:
break;
}
// destroy it for the player
gMessageLib->sendDestroyObject(objectId,playerObject);
// Also update the world...if the object is not private.
if ((item->getParentId() != playerObject->getId()) && (item->getParentId() != dynamic_cast<Inventory*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory))->getId()))
{
PlayerObjectSet* inRangePlayers = playerObject->getKnownPlayers();
PlayerObjectSet::iterator it = inRangePlayers->begin();
while(it != inRangePlayers->end())
{
PlayerObject* targetObject = (*it);
gMessageLib->sendDestroyObject(tangibleObject->getId(),targetObject);
targetObject->removeKnownObject(tangibleObject);
++it;
}
tangibleObject->destroyKnownObjects();
}
// update the equiplist, if its an equipable item
CreatureObject* creature = dynamic_cast<CreatureObject*>(gWorldManager->getObjectById(item->getParentId()));
if(creature)
{
// remove from creatures slotmap
playerObject->getEquipManager()->removeEquippedObject(object);
// send out the new equiplist
gMessageLib->sendEquippedListUpdate_InRange(playerObject);
// destroy it for players in range
PlayerObjectSet* objList = playerObject->getKnownPlayers();
PlayerObjectSet::iterator it = objList->begin();
while(it != objList->end())
{
gMessageLib->sendDestroyObject(objectId,(*it));
++it;
}
}
}
else if(ResourceContainer* container = dynamic_cast<ResourceContainer*>(object))
{
//gLogger->logMsg("destroy ressourcecontainer");
gMessageLib->sendDestroyObject(container->getId(),playerObject);
}
// reset pending ui callbacks
playerObject->resetUICallbacks(object);
// delete from db CAVE :: mark if its an Object saved in the db!!!!
// temporary placed instruments are not saved in the db
gObjectFactory->deleteObjectFromDB(object);
// remove from inventory
if(object->getParentId() == dynamic_cast<Inventory*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory))->getId())
{
dynamic_cast<Inventory*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory))->deleteObject(object);
}
// remove from world
else
{
gWorldManager->destroyObject(object);
}
}
}