From 4d4f78d5c1a7f68e58c32fa0f4524d5737691569 Mon Sep 17 00:00:00 2001 From: TheDreWen Date: Wed, 27 May 2026 11:22:44 +0200 Subject: [PATCH] Add debug logging for WebSocket messages and simplify connection close messages in LagoonAddons --- scripts/main.js | 5 +++-- src/main.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/main.js b/scripts/main.js index bd501d1..217003b 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -11,6 +11,7 @@ class LagoonAddons { async connect() { this.ws = await websocket.connect('wss://lagoon.under-scape.com/ws/rooms/' + roomCode + '/plugins/proximity'); this.ws.afterEvents.message.subscribe((event) => { + console.log(`Lagoon Debug Message : ${event}`); try { const payload = JSON.parse(event.message); const type = payload.type; @@ -26,8 +27,8 @@ class LagoonAddons { } }); this.ws.afterEvents.close.subscribe((event) => { - utils.logStaff(`§cConnection to Lagoon closed. (${event})`); - console.log(`Connection to Lagoon closed. (${event})`); + utils.logStaff(`§cConnection to Lagoon closed.`); + console.log(`Connection to Lagoon closed.`); utils.logStaff(`§eReconnecting in 5 seconds.`); console.log(`Reconnecting in 5 seconds.`); system.runTimeout(() => { diff --git a/src/main.ts b/src/main.ts index 8d44933..841214f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,6 +17,7 @@ class LagoonAddons { this.ws = await websocket.connect('wss://lagoon.under-scape.com/ws/rooms/' + roomCode + '/plugins/proximity'); this.ws.afterEvents.message.subscribe((event) => { + console.log(`Lagoon Debug Message : ${event}`) try { const payload = JSON.parse(event.message); @@ -32,8 +33,8 @@ class LagoonAddons { } }); this.ws.afterEvents.close.subscribe((event) => { - utils.logStaff(`§cConnection to Lagoon closed. (${event})`); - console.log(`Connection to Lagoon closed. (${event})`); + utils.logStaff(`§cConnection to Lagoon closed.`); + console.log(`Connection to Lagoon closed.`); utils.logStaff(`§eReconnecting in 5 seconds.`); console.log(`Reconnecting in 5 seconds.`);