Show overall stats just for fun.

This commit is contained in:
Cryptkeeper 2015-11-30 14:00:47 -06:00
parent 0640d6ed8f
commit dd8f5ec10d
2 changed files with 17 additions and 0 deletions

View File

@ -22,6 +22,10 @@
<p class="slogan text-uppercase">All your favorite Minecraft servers, right now.</p>
<p class="info text-uppercase">Made with <span style="color: #e74c3c;">&#9829;</span> by <a href="http://cryptkpr.me">Cryptkeeper</a> &middot; Open source'd on <a href="https://github.com/Cryptkeeper/Minetrack">Github</a></p>
<br />
<p class="info text-uppercase">Watching <span id="stat_totalPlayers">0</span> players on <span id="stat_networks">0</span> networks.</p>
</div>
<div id="tagline" class="status-connecting">

View File

@ -134,8 +134,21 @@ function updateServerStatus(lastEntry) {
newStatus += 'Failed to ping!';
}
lastPlayerEntries[info.name] = 0;
lastLatencyEntries[info.name] = 0;
div.html(newStatus + '</span>');
}
var keys = Object.keys(lastPlayerEntries);
var totalPlayers = 0;
for (var i = 0; i < keys.length; i++) {
totalPlayers += lastPlayerEntries[keys[i]];
}
$("#stat_totalPlayers").text(formatNumber(totalPlayers));
$("#stat_networks").text(formatNumber(keys.length));
}
function sortServers() {