本文整理汇总了C++中ZoneServer::createClientObject方法的典型用法代码示例。如果您正苦于以下问题:C++ ZoneServer::createClientObject方法的具体用法?C++ ZoneServer::createClientObject怎么用?C++ ZoneServer::createClientObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZoneServer
的用法示例。
在下文中一共展示了ZoneServer::createClientObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Reference<SceneObject*> PlanetManagerImplementation::loadSnapshotObject(WorldSnapshotNode* node, WorldSnapshotIff* wsiff, int& totalObjects) {
uint64 objectID = node->getObjectID();
String templateName = wsiff->getObjectTemplateName(node->getNameID());
ZoneServer* zoneServer = server->getZoneServer();
Reference<SceneObject*> object = zoneServer->getObject(objectID);
++totalObjects;
if (ConfigManager::instance()->isProgressMonitorActivated())
printf("\r\tLoading snapshot objects: [%d] / [?]\t", totalObjects);
//Object already exists, exit.
if (object != NULL)
return NULL;
Reference<SceneObject*> parentObject = zoneServer->getObject(node->getParentID());
String serverTemplate = templateName.replaceFirst("shared_", "");
Vector3 position = node->getPosition();
object = zoneServer->createClientObject(serverTemplate.hashCode(), objectID);
object->initializePosition(position.getX(), position.getZ(), position.getY());
object->setDirection(node->getDirection());
if (parentObject != NULL && parentObject->isBuildingObject() && object->isCellObject()) {
CellObject* cell = cast<CellObject*>(object.get());
BuildingObject* building = cast<BuildingObject*>(parentObject.get());
building->addCell(cell, node->getCellID());
}
if (parentObject != NULL)
parentObject->transferObject(object, -1);
else if (node->getParentID() != 0)
error("parent id " + String::valueOf(node->getParentID()));
if (parentObject == NULL) {
//object->insertToZone(zone);
Locker clocker(object);
zone->transferObject(object, -1, true);
}
//Load child nodes
for (int i = 0; i < node->getNodeCount(); ++i) {
WorldSnapshotNode* childNode = node->getNode(i);
if (childNode == NULL)
continue;
loadSnapshotObject(childNode, wsiff, totalObjects);
}
//object->createChildObjects();
return object;
}