Moved server-side queue transmission to it's own protected namespace.

This commit is contained in:
rainbow napkin 2025-10-22 05:00:59 -04:00
parent 5eb307bb9e
commit 6d16ac2353
5 changed files with 28 additions and 11 deletions

View file

@ -55,6 +55,15 @@ class queueBroadcastManager extends auxServer{
//Set socket channel value
socket.chan = socketUtils.getChannelName(socket);
//Pull active channel
const activeChannel = this.chanServer.activeChannels.get(socket.chan);
//If there isn't an active channel
if(activeChannel == null){
//Drop the connection
return;
}
//Pull channel DB
const chanDB = (await channelModel.findOne({name: socket.chan}));
@ -69,6 +78,9 @@ class queueBroadcastManager extends auxServer{
//Throw the user into the channels room within the queue-broadcast instance
socket.join(socket.chan);
//Send the queue down to our newly connected user
activeChannel.queue.emitQueue(chanDB, socket);
//Define listeners
this.defineListeners(socket);
}