|
|
@ -1,5 +1,6 @@
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
const os = require('os');
|
|
|
|
const os = require('os');
|
|
|
|
const nconf = require('nconf');
|
|
|
|
const nconf = require('nconf');
|
|
|
|
const winston = require('winston');
|
|
|
|
const winston = require('winston');
|
|
|
@ -301,18 +302,16 @@ Sockets.getUidsInRoom = async function (room) {
|
|
|
|
return [];
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const ioRoom = Sockets.server.in(room);
|
|
|
|
const ioRoom = Sockets.server.in(room);
|
|
|
|
const uids = {};
|
|
|
|
const uids = [];
|
|
|
|
if (ioRoom) {
|
|
|
|
if (ioRoom) {
|
|
|
|
const sockets = await ioRoom.fetchSockets();
|
|
|
|
const sockets = await ioRoom.fetchSockets();
|
|
|
|
for (const s of sockets) {
|
|
|
|
for (const s of sockets) {
|
|
|
|
for (const r of s.rooms) {
|
|
|
|
if (s && s.data && s.data.uid > 0) {
|
|
|
|
if (r.startsWith('uid_')) {
|
|
|
|
uids.push(s.data.uid);
|
|
|
|
uids[r.split('_').pop()] = 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return Object.keys(uids);
|
|
|
|
return _.uniq(uids);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Sockets.warnDeprecated = (socket, replacement) => {
|
|
|
|
Sockets.warnDeprecated = (socket, replacement) => {
|
|
|
|