From 6f14eb22066897dc8c7ff73fcb691d5dc6f4a737 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 25 Aug 2015 12:35:34 -0700 Subject: [PATCH] fix for 0 entity avg ping --- interface/src/ui/Stats.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index 74e3a8f44f..048f0d0ef9 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -129,8 +129,8 @@ void Stats::updateStats() { STAT_UPDATE(audioPing, audioMixerNode ? audioMixerNode->getPingMs() : -1); STAT_UPDATE(avatarPing, avatarMixerNode ? avatarMixerNode->getPingMs() : -1); - //// Now handle voxel servers, since there could be more than one, we average their ping times - unsigned long totalPingOctree = 0; + //// Now handle entity servers, since there could be more than one, we average their ping times + int totalPingOctree = 0; int octreeServerCount = 0; int pingOctreeMax = 0; nodeList->eachNode([&](const SharedNodePointer& node) { @@ -143,6 +143,9 @@ void Stats::updateStats() { } } }); + + // update the entities ping with the average for all connected entity servers + STAT_UPDATE(entitiesPing, octreeServerCount ? totalPingOctree / octreeServerCount : -1); } else { // -2 causes the QML to hide the ping column STAT_UPDATE(audioPing, -2);