mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 14:52:46 +02:00
migrate EntityServer and OctreeServer to tbb concurrent map
This commit is contained in:
parent
1a953b5906
commit
881d03b11d
2 changed files with 7 additions and 11 deletions
|
@ -124,11 +124,7 @@ void EntityServer::pruneDeletedEntities() {
|
||||||
|
|
||||||
quint64 earliestLastDeletedEntitiesSent = usecTimestampNow() + 1; // in the future
|
quint64 earliestLastDeletedEntitiesSent = usecTimestampNow() + 1; // in the future
|
||||||
|
|
||||||
NodeHashSnapshot snapshotHash = NodeList::getInstance()->getNodeHash().snapshot_table();
|
NodeList::getInstance()->eachNode([&earliestLastDeletedEntitiesSent](const SharedNodePointer& node) {
|
||||||
|
|
||||||
for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) {
|
|
||||||
SharedNodePointer node = it->second;
|
|
||||||
|
|
||||||
if (node->getLinkedData()) {
|
if (node->getLinkedData()) {
|
||||||
EntityNodeData* nodeData = static_cast<EntityNodeData*>(node->getLinkedData());
|
EntityNodeData* nodeData = static_cast<EntityNodeData*>(node->getLinkedData());
|
||||||
quint64 nodeLastDeletedEntitiesSentAt = nodeData->getLastDeletedEntitiesSentAt();
|
quint64 nodeLastDeletedEntitiesSentAt = nodeData->getLastDeletedEntitiesSentAt();
|
||||||
|
@ -136,7 +132,8 @@ void EntityServer::pruneDeletedEntities() {
|
||||||
earliestLastDeletedEntitiesSent = nodeLastDeletedEntitiesSentAt;
|
earliestLastDeletedEntitiesSent = nodeLastDeletedEntitiesSentAt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
tree->forgetEntitiesDeletedBefore(earliestLastDeletedEntitiesSent);
|
tree->forgetEntitiesDeletedBefore(earliestLastDeletedEntitiesSent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1138,12 +1138,11 @@ void OctreeServer::aboutToFinish() {
|
||||||
qDebug() << qPrintable(_safeServerName) << "inform Octree Inbound Packet Processor that we are shutting down...";
|
qDebug() << qPrintable(_safeServerName) << "inform Octree Inbound Packet Processor that we are shutting down...";
|
||||||
_octreeInboundPacketProcessor->shuttingDown();
|
_octreeInboundPacketProcessor->shuttingDown();
|
||||||
|
|
||||||
NodeHashSnapshot snapshotHash = NodeList::getInstance()->getNodeHash().snapshot_table();
|
NodeList::getInstance()->eachNode([this](const SharedNodePointer& node) {
|
||||||
|
qDebug() << qPrintable(_safeServerName) << "server about to finish while node still connected node:" << *node;
|
||||||
|
forceNodeShutdown(node);
|
||||||
|
});
|
||||||
|
|
||||||
for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) {
|
|
||||||
qDebug() << qPrintable(_safeServerName) << "server about to finish while node still connected node:" << *it->second;
|
|
||||||
forceNodeShutdown(it->second);
|
|
||||||
}
|
|
||||||
qDebug() << qPrintable(_safeServerName) << "server ENDING about to finish...";
|
qDebug() << qPrintable(_safeServerName) << "server ENDING about to finish...";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue