diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index de3d2b5e..19e15670 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -624,6 +624,7 @@ Callbacks = { /* REGION Chat */ usercount: function(count) { + CHANNEL.usercount = count; var text = count + " connected user"; if(count != 1) { text += "s"; diff --git a/www/assets/js/data.js b/www/assets/js/data.js index 81e82c22..b5bad0ff 100644 --- a/www/assets/js/data.js +++ b/www/assets/js/data.js @@ -31,7 +31,8 @@ var CHANNEL = { js: "", motd: "", motd_text: "", - name: false + name: false, + usercount: 0 }; var PLAYER = false; diff --git a/www/assets/js/util.js b/www/assets/js/util.js index 770364b9..f4ae6ab6 100644 --- a/www/assets/js/util.js +++ b/www/assets/js/util.js @@ -272,8 +272,10 @@ function calcUserBreakdown() { "Moderators": 0, "Regular Users": 0, "Guests": 0, + "Anonymous": 0, "AFK": 0 }; + var total = 0; $("#userlist .userlist_item").each(function (index, item) { var data = $(item).data("dropdown-info"); if(data.rank >= 255) @@ -287,10 +289,14 @@ function calcUserBreakdown() { else breakdown["Guests"]++; + total++; + if($(item).find(".icon-time").length > 0) breakdown["AFK"]++; }); + breakdown["Anonymous"] = CHANNEL.usercount - total; + return breakdown; }