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

@ -113,7 +113,8 @@ class channel{
this.socket.on("error", utils.ux.displayResponseError);
this.socket.on("queue", (data) => {
this.queueBroadcastSocket.on("queue", (data) => {
console.log(data);
this.queue = new Map(data.queue);
});
@ -138,9 +139,6 @@ class channel{
//should it have its own event listener instead? Guess it's a stylistic choice :P
this.chatBox.handleClientInfo(data);
//Store queue for use by the queue panel
this.queue = new Map(data.queue);
//Store queue lock status
this.queueLock = data.queueLock;
}

View file

@ -137,8 +137,7 @@ class queuePanel extends panelObj{
defineListeners(){
//Render queue when we receive a new copy of the queue data from the server
//Render queue should be called within an arrow function so that it's called with default parameters, and not handed an event as a date
this.client.socket.on("clientMetadata", () => {this.renderQueue();});
this.client.socket.on("queue", () => {this.renderQueue();});
this.client.queueBroadcastSocket.on("queue", () => {this.renderQueue();});
this.client.socket.on("start", this.handleStart.bind(this));
this.client.socket.on("end", this.handleEnd.bind(this));
this.client.socket.on("lock", this.handleScheduleLock.bind(this));