本文整理汇总了C++中ManagedReference::broadcastDestroyPrivate方法的典型用法代码示例。如果您正苦于以下问题:C++ ManagedReference::broadcastDestroyPrivate方法的具体用法?C++ ManagedReference::broadcastDestroyPrivate怎么用?C++ ManagedReference::broadcastDestroyPrivate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ManagedReference
的用法示例。
在下文中一共展示了ManagedReference::broadcastDestroyPrivate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: broadcastDestroyPrivate
void SceneObjectImplementation::broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject) {
ZoneServer* zoneServer = getZoneServer();
if (zoneServer != NULL && zoneServer->isServerLoading())
return;
if (parent.get() != NULL) {
ManagedReference<SceneObject*> grandParent = getRootParent().get();
if (grandParent != NULL) {
grandParent->broadcastDestroyPrivate(object, selfObject);
return;
} else {
return;
}
}
if (zone == NULL)
return;
SortedVector<ManagedReference<QuadTreeEntry*> > closeSceneObjects;
int maxInRangeObjectCount = 0;
if (closeobjects == NULL) {
info("Null closeobjects vector in SceneObjectImplementation::broadcastDestroyPrivate", true);
zone->getInRangeObjects(getPositionX(), getPositionY(), 256, &closeSceneObjects, true);
maxInRangeObjectCount = closeSceneObjects.size();
} else {
CloseObjectsVector* vec = (CloseObjectsVector*) closeobjects;
closeSceneObjects.removeAll(vec->size(), 10);
vec->safeCopyTo(closeSceneObjects);
maxInRangeObjectCount = closeSceneObjects.size();
}
for (int i = 0; i < maxInRangeObjectCount; ++i) {
SceneObject* scno = static_cast<SceneObject*>(closeSceneObjects.get(i).get());
ManagedReference<ZoneClientSession*> client = scno->getClient();
if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
object->sendDestroyTo(scno);
}
}
}
示例2: broadcastDestroyPrivate
void SceneObjectImplementation::broadcastDestroyPrivate(SceneObject* object, SceneObject* selfObject) {
ZoneServer* zoneServer = getZoneServer();
if (zoneServer != NULL && zoneServer->isServerLoading())
return;
if (parent.get() != NULL) {
ManagedReference<SceneObject*> grandParent = cast<SceneObject*>(getRootParent().get().get());
if (grandParent != NULL) {
grandParent->broadcastDestroyPrivate(object, selfObject);
return;
} else {
return;
}
}
if (zone == NULL)
return;
//Locker zoneLocker(zone);
// bool readlock = !zone->isLockedByCurrentThread();
SortedVector<ManagedReference<QuadTreeEntry*> > closeSceneObjects;
int maxInRangeObjectCount = 0;
// zone->rlock(readlock);
try {
if (closeobjects == NULL) {
info("Null closeobjects vector in SceneObjectImplementation::broadcastDestroyPrivate", true);
zone->getInRangeObjects(getPositionX(), getPositionY(), 256, &closeSceneObjects, true);
maxInRangeObjectCount = closeSceneObjects.size();
} else {
CloseObjectsVector* vec = (CloseObjectsVector*) closeobjects;
closeSceneObjects.removeAll(vec->size(), 10);
// closeSceneObjects.addAll(*closeobjects);
vec->safeCopyTo(closeSceneObjects);
maxInRangeObjectCount = closeSceneObjects.size();//closeobjects->size();
}
} catch (...) {
//zone->runlock(readlock);
throw;
}
// zone->runlock(readlock);
for (int i = 0; i < maxInRangeObjectCount; ++i) {
SceneObject* scno = cast<SceneObject*>(closeSceneObjects.get(i).get());
if (selfObject == scno)
continue;
ManagedReference<ZoneClientSession*> client = scno->getClient();
if (scno->isVehicleObject() || client != NULL || scno->isMount()) {
object->sendDestroyTo(scno);
}
}
}