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

Commit

Permalink
Merge pull request #128 from EpicGames/UE5.2
Browse files Browse the repository at this point in the history
Bring UE5.2 to master
  • Loading branch information
lukehb committed Feb 25, 2023
2 parents c3f0b83 + 7bed284 commit 801c573
Show file tree
Hide file tree
Showing 23 changed files with 55 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
name: Build and push the Signalling Server container image for Unreal Engine based on our development branch
uses: docker/build-push-action@v3
with:
context: ./SignallingWebServer
context: .
tags: 'ghcr.io/epicgames/pixel-streaming-signalling-server:5.2'
push: true
file: SignallingWebServer/Dockerfile
2 changes: 1 addition & 1 deletion Frontend/library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epicgames-ps/lib-pixelstreamingfrontend-ue5.2",
"version": "0.1.1",
"version": "0.1.3",
"description": "Frontend library for Pixel Streaming",
"main": "dist/lib-pixelstreamingfrontend.js",
"module": "dist/lib-pixelstreamingfrontend.esm.js",
Expand Down
9 changes: 9 additions & 0 deletions Frontend/library/src/PixelStreaming/PixelStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,15 @@ export class PixelStreaming {
this.webXrController.xrClicked();
}

/**
* Pass in a function to generate a signalling server URL.
* This function is useful if you need to programmatically construct your signalling server URL.
* @param signallingUrlBuilderFunc A function that generates a signalling server url.
*/
public setSignallingUrlBuilder(signallingUrlBuilderFunc: ()=>string) {
this._webRtcController.signallingUrlBuilder = signallingUrlBuilderFunc;
}

/**
* Public getter for the websocket controller. Access to this property allows you to send
* custom websocket messages.
Expand Down
49 changes: 34 additions & 15 deletions Frontend/library/src/WebRtcPlayer/WebRtcPlayerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export class WebRtcPlayerController {
preferredCodec: string;
peerConfig: RTCConfiguration;
videoAvgQp: number;
signallingUrlBuilder: () => string;

// if you override the disconnection message by calling the interface method setDisconnectMessageOverride
// it will use this property to store the override message string
Expand Down Expand Up @@ -249,6 +250,24 @@ export class WebRtcPlayerController {
);

this.setVideoEncoderAvgQP(-1);

this.signallingUrlBuilder = () => {
let signallingServerUrl = this.config.getTextSettingValue(
TextParameters.SignallingServerUrl
);

// If we are connecting to the SFU add a special url parameter to the url
if (this.config.isFlagEnabled(Flags.BrowserSendOffer)) {
signallingServerUrl += '?' + Flags.BrowserSendOffer + '=true';
}

// This code is no longer needed, but is a good example for how subsequent config flags can be appended
// if (this.config.isFlagEnabled(Flags.BrowserSendOffer)) {
// signallingServerUrl += (signallingServerUrl.includes('?') ? '&' : '?') + Flags.BrowserSendOffer + '=true';
// }

return signallingServerUrl;
}
}

/**
Expand Down Expand Up @@ -1073,29 +1092,29 @@ export class WebRtcPlayerController {
this.resizePlayerStyle();
}

buildSignallingServerUrl() {
let signallingServerUrl = this.config.getTextSettingValue(
TextParameters.SignallingServerUrl
);
// buildSignallingServerUrl() {
// let signallingServerUrl = this.config.getTextSettingValue(
// TextParameters.SignallingServerUrl
// );

// If we are connecting to the SFU add a special url parameter to the url
if (this.config.isFlagEnabled(Flags.BrowserSendOffer)) {
signallingServerUrl += '?' + Flags.BrowserSendOffer + '=true';
}
// // If we are connecting to the SFU add a special url parameter to the url
// if (this.config.isFlagEnabled(Flags.BrowserSendOffer)) {
// signallingServerUrl += '?' + Flags.BrowserSendOffer + '=true';
// }

// This code is no longer needed, but is a good example for how subsequent config flags can be appended
// if (this.config.isFlagEnabled(Flags.BrowserSendOffer)) {
// signallingServerUrl += (signallingServerUrl.includes('?') ? '&' : '?') + Flags.BrowserSendOffer + '=true';
// }
// // This code is no longer needed, but is a good example for how subsequent config flags can be appended
// // if (this.config.isFlagEnabled(Flags.BrowserSendOffer)) {
// // signallingServerUrl += (signallingServerUrl.includes('?') ? '&' : '?') + Flags.BrowserSendOffer + '=true';
// // }

return signallingServerUrl;
}
// return signallingServerUrl;
// }

/**
* Connect to the Signaling server
*/
connectToSignallingServer() {
const signallingUrl = this.buildSignallingServerUrl();
const signallingUrl = this.signallingUrlBuilder();
this.webSocketController.connect(signallingUrl);
}

Expand Down
2 changes: 1 addition & 1 deletion Frontend/ui-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.2",
"version": "0.0.3",
"version": "0.0.4",
"description": "Reference frontend UI library for Pixel Streaming - gives the stock look and feel.",
"main": "dist/lib-pixelstreamingfrontend-ui.js",
"module": "dist/lib-pixelstreamingfrontend-ui.esm.js",
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.2
0.2.3
13 changes: 6 additions & 7 deletions SignallingWebServer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Use the current Long Term Support (LTS) version of Node.js
FROM node:lts

# Copy the signalling server source code from the build context
COPY . /opt/SignallingWebServer
COPY . /opt/Frontend
# Copy the signalling server and frontend source code from the build context
COPY /SignallingWebServer /SignallingWebServer
COPY /Frontend /Frontend

# Install the dependencies for the signalling server
WORKDIR /opt/SignallingWebServer
RUN ./platform_scripts/bash/setup.sh --build
# Install the dependencies for the signalling server and build the frontend
RUN SignallingWebServer/platform_scripts/bash/setup.sh --build

# Expose TCP ports 80 and 443 for player WebSocket connections and web server HTTP(S) access
EXPOSE 80
Expand All @@ -23,4 +22,4 @@ EXPOSE 8889
EXPOSE 9999

# Set the signalling server as the container's entrypoint
ENTRYPOINT ["/usr/local/bin/node", "/opt/SignallingWebServer/cirrus.js"]
ENTRYPOINT ["/usr/local/bin/node", "/SignallingWebServer/cirrus.js"]
2 changes: 1 addition & 1 deletion SignallingWebServer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cirrus-webserver",
"version": "0.0.1",
"description": "cirrus web server",
"description": "The reference signalling and web server for Pixel Streaming: Cirrus",
"scripts": {
"store_password": "run-script-os",
"store_password:default": "./platform_scripts/bash/node/bin/node ./modules/authentication/db/store_password.js --usersFile=./modules/authentication/db/users.json",
Expand Down
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/Start_TURNServer.sh
100644 → 100755
Empty file.
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/common_utils.sh
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/docker-start-turn.sh
100644 → 100755
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/docker-stop-all.sh
100644 → 100755
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/docker-stop-cirrus.sh
100644 → 100755
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/docker-stop-turn.sh
100644 → 100755
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/run_local.sh
100644 → 100755
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/setup.sh
100644 → 100755
Empty file.
Empty file modified SignallingWebServer/platform_scripts/bash/turn_user_pwd.sh
100644 → 100755
Empty file.

0 comments on commit 801c573

Please sign in to comment.