Show overall stats just for fun.
This commit is contained in:
parent
0640d6ed8f
commit
dd8f5ec10d
@ -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;">♥</span> by <a href="http://cryptkpr.me">Cryptkeeper</a> · 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">
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user