History

leverage new libcuckoo hash outside LimitedNodeList

Stephen Birarda committed 12 years ago

Commit 8a72cdd1 parent a492abc16 files · +157 −64Browse files

Showing the changes to interface/src/Application.cpp (1 of 16 files). Show all

Unified · Split

interface/src/Application.cpp+14−6
@@ -2405,7 +2405,10 @@ int Application::sendNackPackets() { · 2404 unmodified lines
2405 char packet[MAX_PACKET_SIZE];2405 char packet[MAX_PACKET_SIZE];
2406 2406
2407 // iterates thru all nodes in NodeList2407 // 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 if (node->getActiveSocket() &&2413 if (node->getActiveSocket() &&
2411 ( node->getType() == NodeType::VoxelServer2414 ( node->getType() == NodeType::VoxelServer
@@ -2503,7 +2506,13 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 91 unmodified lines
2503 int inViewServers = 0;2506 int inViewServers = 0;
2504 int unknownJurisdictionServers = 0;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 // only send to the NodeTypes that are serverType2516 // only send to the NodeTypes that are serverType
2508 if (node->getActiveSocket() && node->getType() == serverType) {2517 if (node->getActiveSocket() && node->getType() == serverType) {
2509 totalServers++;2518 totalServers++;
@@ -2560,10 +2569,9 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node · 50 unmodified lines
2560 if (wantExtraDebugging) {2569 if (wantExtraDebugging) {
2561 qDebug("perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);2570 qDebug("perServerPPS: %d perUnknownServer: %d", perServerPPS, perUnknownServer);
2562 }2571 }
2563 2572
2564 NodeList* nodeList = NodeList::getInstance();2573 for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) {
2565 2574 SharedNodePointer node = it->second;
2566 foreach (const SharedNodePointer& node, nodeList->getNodeHash()) {
2567 // only send to the NodeTypes that are serverType2575 // only send to the NodeTypes that are serverType
2568 if (node->getActiveSocket() && node->getType() == serverType) {2576 if (node->getActiveSocket() && node->getType() == serverType) {
2569 2577

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t