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

Fixing left behind streamer IDs when they're late to ID themselves.#432

Merged
mcottontensor merged 10 commits intoEpicGames:masterfrom
mcottontensor:fix_late_streamer_id
Nov 23, 2023
Merged

Fixing left behind streamer IDs when they're late to ID themselves.#432
mcottontensor merged 10 commits intoEpicGames:masterfrom
mcottontensor:fix_late_streamer_id

Conversation

@mcottontensor
Copy link
Contributor

@mcottontensor mcottontensor commented Nov 20, 2023

Relevant components:

  • Signalling server
  • Frontend library
  • Frontend UI library
  • Matchmaker
  • Platform scripts
  • SFU

Problem statement:

If a streamer was slow to start up, it can be late to ID itself and the signalling server will assign it a legacy id. When the streamer finally replies it will get assigned a new ID but the old ID will be left behind leading to bad streamer lists with non existent streamer IDs.

Solution

When a streamer gets assigned an ID the server will check that any old ID is removed from the streamer list.

Documentation

Test Plan and Compatibility

// remove any existing streamer id
if (!!streamer.id) {
streamers.delete(streamer.id);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

CC @Belchy06 any problems you forsee by doing this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Might just need to check if the reconnect flow still works.

I'd think that if a user connected when the streamer was assigned the legacy ID, it wouldn't be able to reconnect once the new streamer had ID'd itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the behaviour by handling any previously subscribed players and sending them an event. The frontend now also will respond to the id change event by updating its subscribed streamer name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Changes look good.

One last thing, though. With the streamer id changed event, do you know if the dropdown in the settings panel updates as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, looks like we'll need to add:

this.config.setOptionSettingValue(
    OptionParameters.StreamerId,
    newID
);

to handleStreamerIDChangedMessage or bind to the new StreamerIDChangedMessageEvent where we set the option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this functionality. It wasn't that simple for various reasons but it now appears to update the settings dropdown properly.


### streamerIDChanged<a name="signalling-streameridchanged"></a>

> Message is used to communicate to [Player](#term-player)s that the [Streamer](#term-streamer) it is currently subscribed to is changing it's ID. This allows Players to keep track of it's currently subscribed Streamer and allow auto reconnects to the correct Streamer. This happens if a Streamer sends an [endpointID](#streamer-endpointid) message after it already has an ID assigned. (Can happen if it is late to respond to the [identify](#signalling-identify) message and is auto assigned a legacy ID.)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just fixing a few it's => its

Message is used to communicate to Players that the Streamer it is currently subscribed to is changing its ID. This allows Players to keep track of its currently subscribed Streamer and allow auto reconnects to the correct Streamer. This happens if a Streamer sends an endpointID message after it already has an ID assigned. (Can happen if it is late to respond to the identify message and is auto assigned a legacy ID.)

@mcottontensor mcottontensor merged commit 28e7c0c into EpicGames:master Nov 23, 2023
@mcottontensor mcottontensor deleted the fix_late_streamer_id branch November 23, 2023 00:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants