final changes to use new hash from LimitedNodeList

This commit is contained in:
Stephen Birarda 2014-11-05 15:12:42 -08:00
parent 8a72cdd59d
commit 63c5dacdd0
3 changed files with 14 additions and 6 deletions

View file

@ -53,8 +53,11 @@ void NodeBounds::draw() {
float selectedScale = 0; float selectedScale = 0;
NodeList* nodeList = NodeList::getInstance(); NodeList* nodeList = NodeList::getInstance();
NodeHashSnapshot snapshotHash = nodeList->getNodeHash().snapshot_table();
foreach (const SharedNodePointer& node, nodeList->getNodeHash()) {
for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) {
SharedNodePointer node = it->second;
NodeType_t nodeType = node->getType(); NodeType_t nodeType = node->getType();
if (nodeType == NodeType::VoxelServer && _showVoxelNodes) { if (nodeType == NodeType::VoxelServer && _showVoxelNodes) {

View file

@ -248,8 +248,10 @@ void OctreeStatsDialog::showOctreeServersOfType(int& serverCount, NodeType_t ser
QLocale locale(QLocale::English); QLocale locale(QLocale::English);
NodeList* nodeList = NodeList::getInstance(); NodeList* nodeList = NodeList::getInstance();
NodeHashSnapshot snapshotHash = nodeList->getNodeHash().snapshot_table();
foreach (const SharedNodePointer& node, nodeList->getNodeHash()) {
for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) {
SharedNodePointer node = it->second;
// only send to the NodeTypes that are NodeType_t_VOXEL_SERVER // only send to the NodeTypes that are NodeType_t_VOXEL_SERVER
if (node->getType() == serverType) { if (node->getType() == serverType) {
serverCount++; serverCount++;

View file

@ -328,8 +328,11 @@ void Stats::display(
// Now handle voxel servers, since there could be more than one, we average their ping times // Now handle voxel servers, since there could be more than one, we average their ping times
unsigned long totalPingVoxel = 0; unsigned long totalPingVoxel = 0;
int voxelServerCount = 0; int voxelServerCount = 0;
foreach (const SharedNodePointer& node, nodeList->getNodeHash()) { NodeHashSnapshot snapshotHash = nodeList->getNodeHash().snapshot_table();
for (auto it = snapshotHash.begin(); it != snapshotHash.end(); it++) {
SharedNodePointer node = it->second;
// TODO: this should also support entities // TODO: this should also support entities
if (node->getType() == NodeType::VoxelServer) { if (node->getType() == NodeType::VoxelServer) {
totalPingVoxel += node->getPingMs(); totalPingVoxel += node->getPingMs();