From 2503dbad522b9dd74c8bcfcdd68e7ca9090d44ed 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 65897692..bccc26a1 100644 --- a/public/scripts/network.js +++ b/public/scripts/network.js @@ -1162,12 +1162,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; } @@ -1175,12 +1172,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; } @@ -1261,8 +1255,6 @@ class RTCPeer extends Peer { this._conn.close(); this._conn = null; } - this.localIceCandidatesSent = false; - this.remoteIceCandidatesReceived = false; } _sendMessage(message) {