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

Common library and Signalling Tester #473

Merged
merged 69 commits into from
Jan 28, 2024
Merged

Common library and Signalling Tester #473

merged 69 commits into from
Jan 28, 2024

Conversation

mcottontensor
Copy link
Contributor

@mcottontensor mcottontensor commented Jan 23, 2024

Relevant components:

  • Common library [NEW]
  • Signalling server
  • Frontend library
  • Frontend UI library
  • Matchmaker
  • Platform scripts
  • SFU

Problem statement:

There are a bunch of code in the front end library that can be useful for other users. Without a common library the other components need to copy/paste or implement their own etc.

Solution

A few common implementations are extracted into a standalone Common library. This allows implementers to link with this library and write their own frontend application.
Additionally a protobuf description for signalling messages has been added. This isn't being used by any of the existing functionality yet, but should be possible to bring this in in the future.
A new tool has also been added under SS_Test. This is the signalling protocol tester. This is a small test application which can test the validity of the signalling protocol between signalling server and streamers and peers.
This tool comes with a github action that will run on changes to several components and fail if anything in the protocol changes to break existing behaviour.

Documentation

The following classes and types and now in Pixel Streaming common...

  • Logger
  • WebSocketTransport (Previously WebSocketController)
  • MessageReceive
  • MessageSend
  • SignallingProtocol

This change means that imports will have to change. For example, importing Logger would change from:
import { Logger } from '../Logger/Logger';
to
import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.4';

WebSocketController has now mostly moved into SignallingProtocol. Most of the functionality has been moved into this new class but it is not a 1 to 1 change so some changes might be required when upgrading.

Binding to the protocol message events in now done through the messageHandlers event emitter and its addListener method. Here is an example where we add a handler for when we receive the config message over the protocol:

messageHandlers.addListener(MessageReceive.MessageRecvTypes.CONFIG, (msg: MessageReceive.MessageRecv) => {
 // do something with config message
});

Test Plan and Compatibility

mcottontensor and others added 30 commits November 29, 2023 11:16
Changed up how we handle expects and messages. Messages are now buffered
until we call processMessages. This allows us better control over the
timing of messages.
Signed-off-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com>
@lukehb lukehb self-requested a review January 24, 2024 03:51
Copy link
Contributor

@lukehb lukehb left a comment

Choose a reason for hiding this comment

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

Left some comments to address before landing, hmu for any as needed. Good work on this PR!

.github/workflows/run-library-unit-tests.yml Outdated Show resolved Hide resolved
.github/workflows/run-signalling-tests.yml Show resolved Hide resolved
Common/.gitignore Outdated Show resolved Hide resolved
Common/README.md Outdated Show resolved Hide resolved
Common/package.json Outdated Show resolved Hide resolved
Common/src/WebSockets/SignallingProtocol.ts Outdated Show resolved Hide resolved
Frontend/library/package.json Outdated Show resolved Hide resolved
SS_Test/src/index.ts Show resolved Hide resolved
@lukehb
Copy link
Contributor

lukehb commented Jan 24, 2024

I guess our main readme.md should also include an explanation for what is common and SS_Tester

Copy link
Contributor

@lukehb lukehb left a comment

Choose a reason for hiding this comment

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

Minor comments mostly about common's package.json

Common/package.json Outdated Show resolved Hide resolved
Common/src/WebSockets/SignallingProtocol.ts Show resolved Hide resolved
@mcottontensor mcottontensor changed the base branch from master to UE5.5 January 28, 2024 23:26
@mcottontensor mcottontensor merged commit 6d87536 into EpicGames:UE5.5 Jan 28, 2024
1 check failed
@mcottontensor mcottontensor deleted the signalling_tester branch January 28, 2024 23:29
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.

2 participants