Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Fix datachannels when using an SFU #137

Merged
merged 2 commits into from
Mar 2, 2023
Merged

Fix datachannels when using an SFU #137

merged 2 commits into from
Mar 2, 2023

Conversation

mcottontensor
Copy link
Contributor

This fixes the issue where only the last joined peer could interact with the given streamer so now all peers should be able to interact by default.
The problem was that the new signalling server was making some assumptions about messages being sent from players and would unconditionally add the playerId field to the message with the sending player. Unfortunately the streamerDataChannels message used that field to specify the id of the player we were creating the data channel for. Without this fix, the data channel would always get the player id of the SFU and not the requesting player.

…messages. This is kind of a nasty exception for when the SFU sends it's data channel negotiations.
@@ -307,7 +307,9 @@ class Player {
return;
}

message.playerId = this.id;
if (!message.playerId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behaviour is quite nuanced, I feel a comment is necessary here saying something about player id might be already set in some cases (such as sfu datachannels) so we don't want to blanket overwrite it

@lukehb lukehb merged commit 125e22e into EpicGames:master Mar 2, 2023
@mcottontensor mcottontensor deleted the sfu_datachannels branch March 20, 2023 01:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants