本文整理汇总了C++中ZoneServer::destroyObjectFromDatabase方法的典型用法代码示例。如果您正苦于以下问题:C++ ZoneServer::destroyObjectFromDatabase方法的具体用法?C++ ZoneServer::destroyObjectFromDatabase怎么用?C++ ZoneServer::destroyObjectFromDatabase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZoneServer
的用法示例。
在下文中一共展示了ZoneServer::destroyObjectFromDatabase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: destroyObjectFromDatabase
void SceneObjectImplementation::destroyObjectFromDatabase(bool destroyContainedObjects) {
//info("deleting from database", true);
if (isPlayerCreature()) {
assert(0 && "attempting to delete a player creature from database");
}
if(dataObjectComponent != NULL) {
dataObjectComponent->notifyObjectDestroyingFromDatabase();
}
ZoneServer* server = getZoneServer();
server->destroyObjectFromDatabase(getObjectID());
asSceneObject()->setPersistent(0);
if (!destroyContainedObjects)
return;
SortedVector<ManagedReference<SceneObject*> > destroyedObjects;
destroyedObjects.setNoDuplicateInsertPlan();
for (int i = 0; i < getSlottedObjectsSize(); ++i) {
ManagedReference<SceneObject*> object = getSlottedObject(i);
if (destroyedObjects.put(object) != -1) {
Locker locker(object);
object->destroyObjectFromDatabase(true);
}
}
for (int j = 0; j < getContainerObjectsSize(); ++j) {
ManagedReference<SceneObject*> object = getContainerObject(j);
if (destroyedObjects.put(object) != -1) {
Locker locker(object);
object->destroyObjectFromDatabase(true);
}
}
//Remove all child objects from database
for (int i = 0; i < childObjects.size(); ++i) {
ManagedReference<SceneObject*> child = childObjects.get(i);
if (child == NULL)
continue;
Locker locker(child);
child->destroyObjectFromDatabase(true);
}
}