From aacf24c31f31af97374ee6eca54ba59a3310b6e5 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Wed, 14 Feb 2024 17:40:54 +0100 Subject: [PATCH] Fix reconnecting by always accepting new ice candidates --- public/scripts/network.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/public/scripts/network.js b/public/scripts/network.js index 9de6502..6798a00 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -1173,12 +1173,9 @@ class RTCPeer extends Peer { } _handleLocalCandidate(candidate) { - if (this.localIceCandidatesSent) return; - Logger.debug("RTC: Local candidate created", candidate); if (candidate === null) { - this.localIceCandidatesSent = true; return; } @@ -1186,12 +1183,9 @@ class RTCPeer extends Peer { } async _handleRemoteCandidate(candidate) { - if (this.remoteIceCandidatesReceived) return; - Logger.debug("RTC: Received remote candidate", candidate); if (candidate === null) { - this.remoteIceCandidatesReceived = true; return; } @@ -1272,8 +1266,6 @@ class RTCPeer extends Peer { this._conn.close(); this._conn = null; } - this.localIceCandidatesSent = false; - this.remoteIceCandidatesReceived = false; } _sendMessage(message) {