chat debug

This commit is contained in:
satori 2021-12-14 08:42:41 +08:00
parent 4c87d7e55b
commit 3cdd790fe7

View File

@ -39,7 +39,7 @@ export default class {
if (!channel.size) this.channels.set(fm, channel) if (!channel.size) this.channels.set(fm, channel)
channel.forEach((value, userid) => { channel.forEach((value, userid) => {
console.log(userid, value) console.log(userid, value)
let user = this.users.get(userid) let user = this.users.get(userid) || new Map()
if (!user.size) return console.log("订阅频道的用户不在线, 应移除此订阅"); if (!user.size) return console.log("订阅频道的用户不在线, 应移除此订阅");
user.forEach((value, ws) => { user.forEach((value, ws) => {
ws.send(msg) ws.send(msg)