From 82adda09deac6a691186e86e4b3fa8747d134734 Mon Sep 17 00:00:00 2001 From: Igor Zinken Date: Mon, 20 May 2024 10:55:14 +0200 Subject: [PATCH] Fix typo in listener cleanup --- src/main/room/netplay/NetClient.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/room/netplay/NetClient.js b/src/main/room/netplay/NetClient.js index 84980d5..e6e0ba0 100644 --- a/src/main/room/netplay/NetClient.js +++ b/src/main/room/netplay/NetClient.js @@ -43,11 +43,11 @@ jt.NetClient = function(room) { wsOnly = false; if (ws) { - ws.onpen = ws.onclose = ws.onmessage = undefined; + ws.onopen = ws.onclose = ws.onmessage = undefined; ws.close(); ws = undefined; } - if (dataChannel) dataChannel.onpen = dataChannel.onclose = dataChannel.onmessage = undefined; + if (dataChannel) dataChannel.onopen = dataChannel.onclose = dataChannel.onmessage = undefined; if (rtcConnection) rtcConnection.onicecandidate = rtcConnection.ondatachannel = undefined; dataChannelActive = false; @@ -177,7 +177,7 @@ jt.NetClient = function(room) { function stopRTC() { if (dataChannel) { - dataChannel.onpen = dataChannel.onclose = dataChannel.onmessage = undefined; + dataChannel.onopen = dataChannel.onclose = dataChannel.onmessage = undefined; dataChannel.close(); dataChannel = undefined; } @@ -291,4 +291,4 @@ jt.NetClient.sendKeepAlive = function() { .finally(function() { if (Javatari.SERVER_KEEPALIVE > 0) setTimeout(jt.NetClient.sendKeepAlive, Javatari.SERVER_KEEPALIVE); }); -}; \ No newline at end of file +};