summary refs log tree commit diff
path: root/src/webrtc/opcodes/Identify.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-08-15 17:09:40 +0200
committerRory& <root@rory.gay>2026-08-15 17:15:40 +0200
commit9f5f2a2c3b71550f21f75500534bf1332b94f771 (patch)
tree4572ef19b7e25fee06da36a62105b197cb45fade /src/webrtc/opcodes/Identify.ts
parentAllow avatar_description field in profile update (diff)
downloadserver-ts-dev/gwsep.tar.xz
Decouple gateway connection state from inner ws object github/dev/gwsep dev/gwsep
Diffstat (limited to 'src/webrtc/opcodes/Identify.ts')
-rw-r--r--src/webrtc/opcodes/Identify.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/webrtc/opcodes/Identify.ts b/src/webrtc/opcodes/Identify.ts

index 7d776d9c..fdf5f449 100644 --- a/src/webrtc/opcodes/Identify.ts +++ b/src/webrtc/opcodes/Identify.ts
@@ -64,14 +64,14 @@ export async function onIdentify(this: WebRtcWebSocket, data: VoicePayload) { streamSession.used = true; await streamSession.save(); - this.once("close", async () => { + this.rawSocket.once("close", async () => { await streamSession.remove(); }); } } // if it doesnt match any then not valid token - if (!authenticated) return this.close(CLOSECODES.Authentication_failed); + if (!authenticated) return this.rawSocket.close(CLOSECODES.Authentication_failed); this.user_id = user_id; this.session_id = session_id; @@ -82,10 +82,10 @@ export async function onIdentify(this: WebRtcWebSocket, data: VoicePayload) { try { this.webRtcClient = await mediaServer.join(voiceRoomId, this.user_id, this, type!); } catch (e) { - return this.close(4013); + return this.rawSocket.close(4013); } - this.on("close", () => { + this.rawSocket.on("close", () => { // ice-lite media server relies on this to know when the peer went away mediaServer.onClientClose(this.webRtcClient!); });