From f6e6f9466153666bd224b885aeb55761858726d2 Mon Sep 17 00:00:00 2001 From: Danny Piper Date: Sun, 5 May 2024 21:35:30 +0100 Subject: [PATCH] chore(refactor): added logging --- game-source-redux/src/lib/websockets.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game-source-redux/src/lib/websockets.ts b/game-source-redux/src/lib/websockets.ts index 728a61d..6884294 100644 --- a/game-source-redux/src/lib/websockets.ts +++ b/game-source-redux/src/lib/websockets.ts @@ -35,12 +35,12 @@ export default class KubeWebSocket { this.ws.onmessage = this.onMessage.bind(this); this.ws.onclose = this.onClose.bind(this); this.ws.onerror = this.onError.bind(this); - this.ws.onopen = this.onopen.bind(this) + this.ws.onopen = this.onOpen.bind(this); } private onMessage(event: MessageEvent) { - console.log(event.data); const data: string = event.data; + console.log(`Received: ${data}`); const eventData: PlayerInfo = JSON.parse(data) as PlayerInfo; const action = eventData.action; @@ -70,7 +70,7 @@ export default class KubeWebSocket { this.ws.send(data); } - private onopen() { + private onOpen() { const data: PlayerInfo = { initialised: false, player: {