Commit 7d8aae9c authored by lazorfuzz's avatar lazorfuzz
Browse files

Fix existing room check

parent e4494a6d
......@@ -97,13 +97,14 @@ export default (server, config) => {
name = uuid();
}
// check if exists
const room = io.nsps['/'].adapter.rooms[name];
if (room && room.length) {
safeCb(cb)('taken');
} else {
join(name);
safeCb(cb)(null, name);
}
io.in(name).clients((err, clients) => {
if (clients && clients.length) {
safeCb(cb)('taken');
} else {
join(name);
safeCb(cb)(null, name);
}
});
});
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment