user onlineUsers instead of calculating from rooms

v1.18.x
barisusakli 10 years ago
parent 7bf655541c
commit c5e1f8e0aa

@ -287,14 +287,7 @@ Sockets.getUserSocketCount = function(uid) {
};
Sockets.getOnlineUserCount = function () {
var roomNames = Object.keys(io.sockets.manager.rooms);
if (!Array.isArray(roomNames)) {
return 0;
}
roomNames = roomNames.filter(function(name) {
return name.indexOf('/uid_') === 0;
});
return roomNames.length;
return onlineUsers.length;
};
Sockets.getOnlineAnonCount = function () {

Loading…
Cancel
Save