mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 13:24:02 +02:00
wait for node active socket before constructing packets
This commit is contained in:
parent
05a38a78c5
commit
557ee458ec
1 changed files with 6 additions and 3 deletions
|
@ -82,9 +82,12 @@ bool OctreeSendThread::process() {
|
||||||
if (auto node = _node.lock()) {
|
if (auto node = _node.lock()) {
|
||||||
OctreeQueryNode* nodeData = static_cast<OctreeQueryNode*>(node->getLinkedData());
|
OctreeQueryNode* nodeData = static_cast<OctreeQueryNode*>(node->getLinkedData());
|
||||||
|
|
||||||
// If we don't have the OctreeQueryNode or it's uninitialized because we haven't received
|
// If we don't have the OctreeQueryNode at all
|
||||||
// a query yet from the client then we can't send an entity data packet
|
// or it's uninitialized because we haven't received a query yet from the client
|
||||||
if (nodeData && nodeData->hasReceivedFirstQuery() && !nodeData->isShuttingDown()) {
|
// or we don't know where we should send packets for this node
|
||||||
|
// or we're shutting down
|
||||||
|
// then we can't send an entity data packet
|
||||||
|
if (nodeData && nodeData->hasReceivedFirstQuery() && node->getActiveSocket() && !nodeData->isShuttingDown()) {
|
||||||
bool viewFrustumChanged = nodeData->updateCurrentViewFrustum();
|
bool viewFrustumChanged = nodeData->updateCurrentViewFrustum();
|
||||||
packetDistributor(node, nodeData, viewFrustumChanged);
|
packetDistributor(node, nodeData, viewFrustumChanged);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue