Improve performance of mass connects by broadcasting usercount
This commit is contained in:
parent
98d3090c7d
commit
76ef8d6906
|
@ -554,9 +554,13 @@ Channel.prototype.sendUserlist = function (toUsers) {
|
||||||
|
|
||||||
Channel.prototype.sendUsercount = function (users) {
|
Channel.prototype.sendUsercount = function (users) {
|
||||||
var self = this;
|
var self = this;
|
||||||
users.forEach(function (u) {
|
if (users === self.users) {
|
||||||
u.socket.emit("usercount", self.users.length);
|
self.broadcastAll("usercount", self.users.length);
|
||||||
});
|
} else {
|
||||||
|
users.forEach(function (u) {
|
||||||
|
u.socket.emit("usercount", self.users.length);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Channel.prototype.sendUserJoin = function (users, user) {
|
Channel.prototype.sendUserJoin = function (users, user) {
|
||||||
|
|
Loading…
Reference in a new issue