Showing the changes to interface/src/Application.cpp (1 of 16 files). Show all
Unified · Split
| @@ -2405,7 +2405,10 @@ int Application::sendNackPackets() { · 2404 unmodified lines | ||
| 2405 | 2405 | char packet[MAX_PACKET_SIZE]; |
| 2406 | 2406 | |
| 2407 | 2407 | // iterates thru all nodes in NodeList |
| 2408 | − foreach(const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) { | |
| 2408 | + NodeHashSnapshot snapshotHash = NodeList::getInstance()->getNodeHash().snapshot_table(); | |
| 2409 | + | |
| 2410 | + for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) { | |
| 2411 | + SharedNodePointer node = it->second; | |
| 2409 | 2412 | |
| 2410 | 2413 | if (node->getActiveSocket() && |
| 2411 | 2414 | ( node->getType() == NodeType::VoxelServer |
| @@ -2503,7 +2506,13 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 91 unmodified lines | ||
| 2503 | 2506 | int inViewServers = 0; |
| 2504 | 2507 | int unknownJurisdictionServers = 0; |
| 2505 | 2508 | |
| 2506 | − foreach (const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) { | |
| 2509 | + NodeList* nodeList = NodeList::getInstance(); | |
| 2510 | + NodeHashSnapshot snapshotHash = nodeList->getNodeHash().snapshot_table(); | |
| 2511 | + | |
| 2512 | + for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) { | |
| 2513 | + | |
| 2514 | + SharedNodePointer node = it->second; | |
| 2515 | + | |
| 2507 | 2516 | // only send to the NodeTypes that are serverType |
| 2508 | 2517 | if (node->getActiveSocket() && node->getType() == serverType) { |
| 2509 | 2518 | totalServers++; |
| @@ -2560,10 +2569,9 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 50 unmodified lines | ||
| 2560 | 2569 | if (wantExtraDebugging) { |
| 2561 | 2570 | qDebug("perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer); |
| 2562 | 2571 | } |
| 2563 | − | |
| 2564 | − NodeList* nodeList = NodeList::getInstance(); | |
| 2565 | − | |
| 2566 | − foreach (const SharedNodePointer& node, nodeList->getNodeHash()) { | |
| 2572 | + | |
| 2573 | + for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) { | |
| 2574 | + SharedNodePointer node = it->second; | |
| 2567 | 2575 | // only send to the NodeTypes that are serverType |
| 2568 | 2576 | if (node->getActiveSocket() && node->getType() == serverType) { |
| 2569 | 2577 | |