From a78e188788b17c60369251d788f9ac443e73e928 Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Tue, 9 Jul 2024 12:41:32 -0400 Subject: [PATCH] Weird socket channel joining bug --- src/ws/Socket.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ws/Socket.ts b/src/ws/Socket.ts index cfcee03..496eac7 100644 --- a/src/ws/Socket.ts +++ b/src/ws/Socket.ts @@ -125,24 +125,24 @@ export class Socket extends EventEmitter { public setChannel(_id: string, set?: Partial) { if (this.isDestroyed()) return; - - const ch = this.getCurrentChannel(); - if (ch && ch.getID() == _id) return; + if (this.currentChannelID === _id) { + logger.debug("Guy in channel was already in"); + return; + } this.desiredChannel._id = _id; this.desiredChannel.set = set; let channel; - for (const ch of ChannelList.getPublicList()) { + for (const ch of ChannelList.getList()) { if (ch.getID() == _id) { channel = ch; } } - // logger.debug("Found channel:", channel); - // Does channel exist? if (channel) { + logger.debug("Found channel:", channel.getID()); // Exists, join normally (async () => { await this.loadUser();