user onlineUsers instead of calculating from rooms

This commit is contained in:
barisusakli
2014-10-17 18:40:20 -04:00
parent 7bf655541c
commit c5e1f8e0aa

View File

@@ -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 () {