This commit is contained in:
Andron666
2023-02-27 20:27:35 +05:00
committed by Dron
parent 6ca13d3591
commit 8418c87110
86 changed files with 235 additions and 10962 deletions
@@ -0,0 +1,110 @@
@Rem Copyright Epic Games, Inc. All Rights Reserved.
@echo off
@Rem Set script location as working directory for commands.
pushd "%~dp0"
:arg_loop_start
SET ARG=%1
if DEFINED ARG (
if "%ARG%"=="/h" (
goto print_help
)
if "%ARG%"=="/v" (
SET UEVersion=%2
SHIFT
)
if "%ARG%"=="/b" (
SET PSInfraTagOrBranch=%2
SET IsTag=0
SHIFT
)
if "%ARG%"=="/t" (
SET PSInfraTagOrBranch=%2
SET IsTag=1
SHIFT
)
SHIFT
goto arg_loop_start
)
@Rem Name and version of ps-infra that we are downloading
SET PSInfraOrg=EpicGames
SET PSInfraRepo=PixelStreamingInfrastructure
@Rem If a UE version is supplied set the right branch or tag to fetch for that version of UE
if DEFINED UEVersion (
if "%UEVersion%"=="4.26" (
SET PSInfraTagOrBranch=UE4.26
SET IsTag=0
)
if "%UEVersion%"=="4.27" (
SET PSInfraTagOrBranch=UE4.27
SET IsTag=0
)
if "%UEVersion%"=="5.0" (
SET PSInfraTagOrBranch=UE5.0
SET IsTag=0
)
)
@Rem If no arguments select a specific version, fetch the appropriate default
if NOT DEFINED PSInfraTagOrBranch (
SET PSInfraTagOrBranch=master
SET IsTag=0
)
@Rem Whether the named reference is a tag or a branch affects the URL we fetch it on
if %IsTag%==1 (
SET RefType=tags
) else (
SET RefType=heads
)
@Rem Look for a SignallingWebServer directory next to this script
if exist SignallingWebServer\ (
echo SignallingWebServer directory found...skipping install.
) else (
echo SignallingWebServer directory not found...beginning ps-infra download.
@Rem Download ps-infra and follow redirects.
curl -L https://github.com/%PSInfraOrg%/%PSInfraRepo%/archive/refs/%RefType%/%PSInfraTagOrBranch%.zip > ps-infra.zip
@Rem Unarchive the .zip
tar -xmf ps-infra.zip || echo bad archive, contents: && type ps-infra.zip && exit 0
@Rem Rename the extracted, versioned, directory
for /d %%i in ("PixelStreamingInfrastructure-*") do (
for /d %%j in ("%%i/*") do (
echo "%%i\%%j"
move "%%i\%%j" .
)
for %%j in ("%%i/*") do (
echo "%%i\%%j"
move "%%i\%%j" .
)
echo "%%i"
rmdir /s /q "%%i"
)
@Rem Delete the downloaded zip
del ps-infra.zip
)
exit 0
:print_help
echo.
echo Tool for fetching PixelStreaming Infrastructure. If no flags are set specifying a version to fetch,
echo the recommended version will be chosen as a default.
echo.
echo Usage:
echo %~n0%~x0 [^/h] [^/v ^<UE version^>] [^/b ^<branch^>] [^/t ^<tag^>]
echo Where:
echo /v Specify a version of Unreal Engine to download the recommended release for
echo /b Specify a specific branch for the tool to download from repo
echo /t Specify a specific tag for the tool to download from repo
echo /h Display this help message
exit 1
@@ -0,0 +1,93 @@
#!/bin/bash
# Copyright Epic Games, Inc. All Rights Reserved.
BASH_LOCATION=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
pushd "${BASH_LOCATION}" > /dev/null
print_help() {
echo "
Tool for fetching PixelStreaming Infrastructure. If no flags are set specifying a version to fetch,
the recommended version will be chosen as a default.
Usage:
${0} [-h] [-v <UE version>] [-b <branch>] [-t <tag>]
Where:
-v Specify a version of Unreal Engine to download the recommended
release for
-b Specify a specific branch for the tool to download from repo
-t Specify a specific tag for the tool to download from repo
-h Display this help message
"
exit 1
}
while(($#)) ; do
case "$1" in
-h ) print_help;;
-v ) UEVersion="$2"; shift 2;;
-b ) PSInfraTagOrBranch="$2"; IsTag=0; shift 2;;
-t ) PSInfraTagOrBranch="$2"; IsTag=1; shift 2;;
* ) echo "Unknown command: $1"; shift;;
esac
done
# Name and version of ps-infra that we are downloading
PSInfraOrg=EpicGames
PSInfraRepo=PixelStreamingInfrastructure
# If a UE version is supplied set the right branch or tag to fetch for that version of UE
if [ ! -z "$UEVersion" ]
then
if [ "$UEVersion" = "4.26" ]
then
PSInfraTagOrBranch=UE4.26
IsTag=0
fi
if [ "$UEVersion" = "4.27" ]
then
PSInfraTagOrBranch=UE4.27
IsTag=0
fi
if [ "$UEVersion" = "5.0" ]
then
PSInfraTagOrBranch=UE5.0
IsTag=0
fi
fi
# If no arguments select a specific version, fetch the appropriate default
if [ -z "$PSInfraTagOrBranch" ]
then
PSInfraTagOrBranch=master
IsTag=0
fi
# Whether the named reference is a tag or a branch affects the URL we fetch it on
if [ "$IsTag" -eq 1 ]
then
RefType=tags
else
RefType=heads
fi
# Look for a SignallingWebServer directory next to this script
if [ -d SignallingWebServer ]
then
echo "SignallingWebServer directory found...skipping install."
else
echo "SignallingWebServer directory not found...beginning ps-infra download."
# Download ps-infra and follow redirects.
curl -L https://github.com/$PSInfraOrg/$PSInfraRepo/archive/refs/$RefType/$PSInfraTagOrBranch.tar.gz > ps-infra.tar.gz
# Unarchive the .tar
tar -xmf ps-infra.tar.gz || $(echo "bad archive, contents:" && head --lines=20 ps-infra.tar.gz && exit 0)
# Move the server folders into the current directory (WebServers) and delete the original directory
mv PixelStreamingInfrastructure-*/* .
rm -rf PixelStreamingInfrastructure-*
# Delete the downloaded tar
rm ps-infra.tar.gz
fi