本文整理汇总了C++中Datapad::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ Datapad::getId方法的具体用法?C++ Datapad::getId怎么用?C++ Datapad::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Datapad
的用法示例。
在下文中一共展示了Datapad::getId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: missionAbort
/*
* Player aborted the mission
*/
void MissionManager::missionAbort(PlayerObject* player, uint64 mission_id)
{
gLogger->logMsg("ABORT MISSION");
Datapad* datapad = dynamic_cast<Datapad*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad));
MissionObject* mission = datapad->getMissionById(mission_id);
if(mission)
{
datapad->removeMission(mission);
gMessageLib->sendSystemMessage(player,L"","mission/mission_generic","incomplete");
gMessageLib->sendSetWaypointActiveStatus(mission->getWaypoint(),false,player);
gMessageLib->sendMissionAbort(mission,player);
gMessageLib->sendContainmentMessage(mission->getId(), datapad->getId(), 4, player);
gMessageLib->sendDestroyObject(mission_id,player);
delete mission;
}
else
{
gLogger->logMsg("ERROR: Attempt to abort an invalid mission, with id %.8X, from the datapad.", static_cast<int>(mission_id));
}
return;
}
示例2: handleObjectReady
void VehicleControllerFactory::handleObjectReady(Object* object,DispatchClient* client)
{
if(VehicleController* vehicle = dynamic_cast<VehicleController*>(object))
{
PlayerObject* player = gWorldManager->getPlayerByAccId(client->getAccountId());
if(player)
{
vehicle->set_owner(player);
Datapad* datapad = player->getDataPad();
if(datapad)
{
datapad->addData(vehicle);
gWorldManager->addObject(vehicle,true);
//spawn it in the player's datapad
gMessageLib->sendCreateInTangible(vehicle, datapad->getId(), player);
//now spawn it in the world
vehicle->Call();
}
}
}
}
示例3: missionRequest
/*
* Player Accepted Mission
*/
void MissionManager::missionRequest(PlayerObject* player, uint64 mission_id)
{
Datapad* datapad = dynamic_cast<Datapad*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_Datapad));
//Move the mission from the player's mission bag to his datapad.
MissionBag* mission_bag = dynamic_cast<MissionBag*>(player->getEquipManager()->getEquippedObject(CreatureEquipSlot_MissionBag));
MissionObject* mission = mission_bag->getMissionById(mission_id);
if(mission == NULL)
{
gLogger->logMsgF("ERROR: Failed to retrieve mission with id %"PRIu64". Unable to accept mission!", MSG_HIGH, mission_id);
return;
}
//automatically checks the datapads capacity
if(!datapad->addMission(mission))
{
gMessageLib->sendSystemMessage(player,L"","mission/mission_generic","too_many_missions");
return;
}
mission_bag->removeMission(mission);
gMessageLib->sendContainmentMessage(mission->getId(), datapad->getId(), 0xffffffff, player);
//Replace it with a new mission.
mission_bag->spawnNAdd();
//Send MissionGenericResponse to tell the client its been accepted
gMessageLib->sendMissionGenericResponse(mission,player);
//Update the name and mission waypoint
MissionObject* updater = new MissionObject();
updater->clear();
updater->setId(mission->getId());
updater->setNameFile(mission->getTitleFile().getRawData());
updater->setName(mission->getTitle().getRawData());
if(mission->getMissionType() != survey)
{
updater->getWaypoint()->setId(mission->getId()+1);
if(mission->getMissionType() == deliver || mission->getMissionType() == crafting)
{
updater->getWaypoint()->setCoords(mission->getStart().Coordinates);
updater->getWaypoint()->setPlanetCRC(mission->getStart().PlanetCRC);
}
else
{
updater->getWaypoint()->setCoords(mission->getDestination().Coordinates);
updater->getWaypoint()->setPlanetCRC(mission->getDestination().PlanetCRC);
}
char name[150];
sprintf(name, "@%s:%s",mission->getTitleFile().getRawData(),mission->getTitle().getRawData());
updater->getWaypoint()->setName(name);
updater->getWaypoint()->setActive(true);
}
else
{
gMessageLib->sendSystemMessage(player,L"","mission/mission_generic","survey_start");
}
//Accept the mission let the player know
gMessageLib->sendPlayMusicMessage(WMSound_Mission_Accepted,player); //3887, 'sound/music_mission_accepted.snd'
gMessageLib->sendMISO_Delta(updater,player);
mission->sendAttributes(mission->getOwner());
delete updater;
if(mission->getMissionType() == recon) mission->setTaskId(gWorldManager->addMissionToProcess(mission));
//check if we need to inform our group
if((mission->getMissionType() == destroy)&&(player->getGroupId() != 0))
{
// we are in a group and just accepted a destroy mission
// check the missions and update the nearest waypoint
GroupObject* group = gGroupManager->getGroupObject(player->getGroupId());
gGroupManager->sendGroupMissionUpdate(group);
}
return;
}
示例4: handleDatabaseJobComplete
void DatapadFactory::handleDatabaseJobComplete(void* ref,DatabaseResult* result)
{
QueryContainerBase* asyncContainer = reinterpret_cast<QueryContainerBase*>(ref);
switch(asyncContainer->mQueryType)
{
case DPFQuery_MainDatapadData:
{
//get the count of all Waypoints and Schematics
Datapad* datapad = _createDatapad(result);
QueryContainerBase* asContainer = new(mQueryContainerPool.ordered_malloc()) QueryContainerBase(asyncContainer->mOfCallback,DPFQuery_ObjectCount,asyncContainer->mClient);
asContainer->mObject = datapad;
mDatabase->executeSqlAsync(this,asContainer,"SELECT %s.sf_getDatapadObjectCount(%" PRIu64 ")",mDatabase->galaxy(),datapad->getId());
}
break;
case DPFQuery_ObjectCount:
{
Datapad* datapad = dynamic_cast<Datapad*>(asyncContainer->mObject);
uint32 objectCount;
DataBinding* binding = mDatabase->createDataBinding(1);
binding->addField(DFT_uint32,0,4);
result->getNextRow(binding,&objectCount);
datapad->setObjectLoadCounter(objectCount);
if(objectCount != 0)
{
uint64 dtpId = datapad->getId();
datapad->setLoadState(LoadState_Loading);
// query contents
QueryContainerBase* asContainer = new(mQueryContainerPool.ordered_malloc()) QueryContainerBase(asyncContainer->mOfCallback,DPFQuery_Objects,asyncContainer->mClient);
asContainer->mObject = datapad;
mDatabase->executeSqlAsync(this,asContainer,
"(SELECT \'waypoints\',waypoints.waypoint_id FROM %s.waypoints WHERE owner_id = %" PRIu64 ")"
" UNION (SELECT \'manschematics\',items.id FROM %s.items WHERE (parent_id=%" PRIu64 "))"
" UNION (SELECT \'vehicles\',vehicles.id FROM %s.vehicles WHERE (parent=%" PRIu64 "))",
mDatabase->galaxy(),dtpId-3,
mDatabase->galaxy(),dtpId,
mDatabase->galaxy(),dtpId);
}
else
{
datapad->setLoadState(LoadState_Loaded);
asyncContainer->mOfCallback->handleObjectReady(datapad,asyncContainer->mClient);
}
mDatabase->destroyDataBinding(binding);
}
break;
case DPFQuery_ItemId:
{
uint64 id;
DataBinding* binding = mDatabase->createDataBinding(1);
binding->addField(DFT_uint64,0,8);
result->getNextRow(binding,&id);
gTangibleFactory->requestObject(this,id,TanGroup_Item,0,asyncContainer->mClient);
mDatabase->destroyDataBinding(binding);
}
break;
case DPFQuery_MSParent:
{
uint64 id;
DataBinding* binding = mDatabase->createDataBinding(1);
binding->addField(DFT_uint64,0,8);
result->getNextRow(binding,&id);
PlayerObject* player = dynamic_cast<PlayerObject*>(gWorldManager->getObjectById(id-3));
if(!player)
{
//factoryPanic!!!!!!!!
LOG(warning) << "Failed getting player to create MS";
return;
}
Datapad* datapad = player->getDataPad();
if(!datapad)
{
//factoryPanic!!!!!!!!
LOG(error) << "Failed getting datapad to create MS";
return;
}
mObjectLoadMap.insert(std::make_pair(datapad->getId(),new(mILCPool.ordered_malloc()) InLoadingContainer(datapad,datapad,NULL,1)));
gTangibleFactory->requestObject(this,asyncContainer->mId,TanGroup_Item,0,NULL);
//.........这里部分代码省略.........
示例5: sendCreatePlayer
//======================================================================================================================
//
// create player
//
bool MessageLib::sendCreatePlayer(PlayerObject* playerObject,PlayerObject* targetObject)
{
if(!_checkPlayer(targetObject))
return(false);
sendCreateObjectByCRC(playerObject,targetObject,false);
if(targetObject == playerObject)
{
sendBaselinesCREO_1(playerObject);
sendBaselinesCREO_4(playerObject);
}
sendBaselinesCREO_3(playerObject,targetObject);
sendBaselinesCREO_6(playerObject,targetObject);
sendCreateObjectByCRC(playerObject,targetObject,true);
sendContainmentMessage(playerObject->getPlayerObjId(),playerObject->getId(),4,targetObject);
sendBaselinesPLAY_3(playerObject,targetObject);
sendBaselinesPLAY_6(playerObject,targetObject);
if(targetObject == playerObject)
{
sendBaselinesPLAY_8(playerObject,targetObject);
sendBaselinesPLAY_9(playerObject,targetObject);
}
//close the yalp
sendEndBaselines(playerObject->getPlayerObjId(),targetObject);
sendPostureMessage(playerObject,targetObject);
if(playerObject->getParentId())
{
sendContainmentMessage(playerObject->getId(),playerObject->getParentId(),4,targetObject);
}
if(targetObject == playerObject)
{
// tangible objects
if(TangibleObject* hair = dynamic_cast<TangibleObject*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Hair)))
{
//only create the hair as the helmet will be created at a different time
if(hair->getTangibleType() == TanType_Hair)
{
sendCreateTangible(hair,targetObject);
}
}
// create inventory and contents
if(dynamic_cast<TangibleObject*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory)))
{
sendInventory(playerObject);
}
// mission bag
if(TangibleObject* missionBag = dynamic_cast<TangibleObject*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Mission)))
{
gMessageLib->sendCreateTangible(missionBag,playerObject);
//Now iterate through the missions and create them clientside
MissionBag* mbag = dynamic_cast<MissionBag*> (missionBag);
MissionList::iterator it = mbag->getMissions()->begin();
while(it != mbag->getMissions()->end())
{
MissionObject* mission = dynamic_cast<MissionObject*>(*it);
sendCreateObjectByCRC(mission, targetObject, false);
sendContainmentMessage(mission->getId(), mbag->getId(), 4, targetObject);
sendBaselinesMISO_3(mission, targetObject);
sendBaselinesMISO_6(mission, targetObject);
sendBaselinesMISO_8(mission, targetObject);
sendBaselinesMISO_9(mission, targetObject);
sendEndBaselines(mission->getId(), targetObject);
++it;
}
}
// datapad
Datapad* datapad = playerObject->getDataPad();
if(datapad)
{
//would be nice to use the tangibles objectcontainer for the datapad
//need to get missionobjects intangibles, Man Schematics, waypoints and stuff in though, so better do it manually
gMessageLib->sendCreateTangible(datapad,playerObject);
//now iterate through the schematics and create them clientside
Datapad* dpad = dynamic_cast<Datapad*> (datapad);
ManufacturingSchematicList* manufacturingSchematics = dpad->getManufacturingSchematics();
ManufacturingSchematicList::iterator it = manufacturingSchematics->begin();
while(it != manufacturingSchematics->end())
{
gMessageLib->sendCreateManufacturingSchematic((dynamic_cast<ManufacturingSchematic*>(*it)),playerObject ,false);
//.........这里部分代码省略.........