From 60bdea0efb4bad97585670ad203fb2d50b670a0e Mon Sep 17 00:00:00 2001 From: Hacksawfred3232 Date: Sun, 11 May 2025 10:03:06 +0100 Subject: [PATCH 1/5] Added SRB2 --- srb2.kvp | 86 +++++++++++++++++++++++++++++++++++++++++++++ srb2_Dockerfile | 10 ++++++ srb2config.json | 1 + srb2dockerbuild.kvp | 86 +++++++++++++++++++++++++++++++++++++++++++++ srb2metaconfig.json | 1 + srb2ports.json | 9 +++++ srb2updates.json | 80 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 273 insertions(+) create mode 100644 srb2.kvp create mode 100644 srb2_Dockerfile create mode 100644 srb2config.json create mode 100644 srb2dockerbuild.kvp create mode 100644 srb2metaconfig.json create mode 100644 srb2ports.json create mode 100644 srb2updates.json diff --git a/srb2.kvp b/srb2.kvp new file mode 100644 index 000000000..c442855ed --- /dev/null +++ b/srb2.kvp @@ -0,0 +1,86 @@ +Meta.DisplayName=SRB2 +Meta.Description=SRB2 Dedicated Server (v2.2.15) +Meta.Arch=x86_64 +Meta.Author=Hacksawfred3232 +Meta.URL=https://www.srb2.org/ +Meta.MinAMPVersion=2.4.6.6 +Meta.SpecificDockerImage= +Meta.DockerRequired=False +Meta.ContainerPolicy=RequiredOnLinux +Meta.ContainerPolicyReason=Sonic Junior Team does not supply native Linux binaries. As such, the game needs to be compiled. +Meta.ExtraSetupStepsURI=https://github.com/Hacksawfred3232/CustAMPTemplates/issues/1 +Meta.Prerequsites=[] +Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.Ports.$SteamQueryPort} +Meta.ExtraContainerPackages=['build-essential','git','wget','unzip','nasm','gcc','libsdl2-mixer-dev','libpng-dev','libcurl4-openssl-dev','libgme-dev','libopenmpt-dev','libminiupnpc-dev'] +Meta.AppConfigId=4d6de494-d4d8-4c9b-ab36-9d255a42fa42 +App.AdminMethod=STDIO +App.HasReadableConsole=true +App.HasWritableConsole=true +App.DisplayName=SRB2 +App.CommandLineArgs={{$PlatformArgs}} {{$FormattedArgs}} -dedicated -nofork -serverport {{$MainGamePort}} +App.WindowsCommandLineArgs= +App.CommandLineParameterFormat=-{0} "{1}" +App.CommandLineParameterDelimiter= +App.RapidStartup=false +App.ApplicationReadyMode=RegexMatch +App.ExitMethod=OS_CLOSE +App.ExitString=stop +App.ExitTimeout=30 +App.ExitFile=app_exit.lck +App.SupportsLiveSettingsChanges=False +App.LiveSettingChangeCommandFormat=set {0} "{1}" +App.ApplicationIPBinding=0.0.0.0 +App.AdminPortRef=RemoteAdminPort +App.UniversalSleepApplicationUDPPortRef=GamePort1 +App.PrimaryApplicationPortRef=GamePort1 +App.UniversalSleepSteamQueryPortRef=SteamQueryPort +App.MaxUsers=8 +App.UseRandomAdminPassword=True +App.RemoteAdminPassword= +App.AdminLoginTransform=None +App.RCONConnectDelaySeconds=30 +App.RCONConnectRetrySeconds=15 +App.RCONHeartbeatCommand=ping +App.RCONHeartbeatMinutes=0 +App.TelnetLoginFormat={0} +App.SteamUpdateAnonymousLogin=True +App.SteamForceLoginPrompt=False +App.SupportsUniversalSleep=False +App.WakeupMode=Any +App.TemplateMatchRegex={{(\$?[\w]+)}} +App.MonitorChildProcess=False +App.MonitorChildProcessWaitMs=1000 +App.MonitorChildProcessName= +App.Compatibility=1 +App.SteamWorkshopDownloadLocation={{$FullBaseDir}}undefined +Console.FilterMatchRegex= +Console.FilterMatchReplacement= +Console.ThrowawayMessageRegex=(WARNING|ERROR): Shader.+ +Console.UpdateAvailableRegex=^\[\d\d:\d\d:\d\d\] \[INFO\] A new server update is available! v[\d\.]+.$ +Console.SuppressLogAtStart=False +Console.ActivateLogRegex= +Console.UserActions={} +Console.SleepMode=False +Console.SleepOnStart=False +Console.SleepDelayMinutes=5 +Console.DozeDelay=2 +Console.AutoRetryCount=5 +Console.SleepStartThresholdSeconds=25 +Console.AppReadyRegex=^Entering\smain\sgame\sloop\.\.\.$ +Console.UserJoinRegex=^\*(?.+)\shas\s(?:rejoined|joined)\sthe\sgame\s\(player\s(?.+)\)$ +Console.UserLeaveRegex=^\*(?.+)\sleft\sthe\sgame$ +Console.UserChatRegex=^(?:|\[PM\])\<(?.+)\>\s(?.+)$ +Meta.OS=Linux +Meta.ConfigManifest=srb2config.json +Meta.MetaConfigManifest=srb2metaconfig.json +Meta.ConfigRoot=srb2.kvp +App.RootDir=./srb2/ +Meta.DisplayImageSource=url:https://cdn2.steamgriddb.com/thumb/cae4a57bcd2fa803df2270f5d8bbbbae.png +App.BaseDirectory=./srb2/ +App.WorkingDir= +App.ExecutableWin= +App.ExecutableLinux=srb2linux.exe +App.LinuxCommandLineArgs= +App.Ports=@IncludeJson[srb2ports.json] +App.UpdateSources=@IncludeJson[srb2updates.json] +App.EnvironmentVariables={"LD_LIBRARY_PATH": "{{$FullBaseDir}}linux64:{{$FullRootDir}}linux64:%LD_LIBRARY_PATH%", "WINEPREFIX": "{{$FullRootDir}}.wine", "WINEARCH": "win64", "WINEDEBUG": "-all"} diff --git a/srb2_Dockerfile b/srb2_Dockerfile new file mode 100644 index 000000000..e53631b95 --- /dev/null +++ b/srb2_Dockerfile @@ -0,0 +1,10 @@ +FROM cubecoders/ampbase:deb12 +# Compile to cubecoders/ampbase:deb12-srb2 + +# Running upgrade command. +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade + +# Apt-get install all required dependencies to compile SRB2 +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git wget unzip nasm gcc libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev libminiupnpc-dev + +# And that's about it. KVP and updates.json will handle the rest. diff --git a/srb2config.json b/srb2config.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/srb2config.json @@ -0,0 +1 @@ +[] diff --git a/srb2dockerbuild.kvp b/srb2dockerbuild.kvp new file mode 100644 index 000000000..bf03f792f --- /dev/null +++ b/srb2dockerbuild.kvp @@ -0,0 +1,86 @@ +Meta.DisplayName=SRB2 (Dockerfile) +Meta.Description=SRB2 Dedicated Server (v2.2.15) (Custom Docker Image) +Meta.Arch=x86_64 +Meta.Author=Hacksawfred3232 +Meta.URL=https://www.srb2.org/ +Meta.MinAMPVersion=2.4.6.6 +Meta.SpecificDockerImage=cubecoders/ampbase:deb12-srb2 +Meta.DockerRequired=False +Meta.ContainerPolicy=RequiredOnLinux +Meta.ContainerPolicyReason=Sonic Junior Team does not supply native Linux binaries. As such, the game needs to be compiled. +Meta.ExtraSetupStepsURI=https://github.com/Hacksawfred3232/CustAMPTemplates/issues/1 +Meta.Prerequsites=[] +Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.Ports.$SteamQueryPort} +Meta.ExtraContainerPackages=[] +Meta.AppConfigId=2f92c0eb-ac61-4a06-b50a-29e73d123d12 +App.AdminMethod=STDIO +App.HasReadableConsole=true +App.HasWritableConsole=true +App.DisplayName=SRB2 +App.CommandLineArgs={{$PlatformArgs}} {{$FormattedArgs}} -dedicated -nofork -serverport {{$MainGamePort}} +App.WindowsCommandLineArgs= +App.CommandLineParameterFormat=-{0} "{1}" +App.CommandLineParameterDelimiter= +App.RapidStartup=false +App.ApplicationReadyMode=RegexMatch +App.ExitMethod=OS_CLOSE +App.ExitString=stop +App.ExitTimeout=30 +App.ExitFile=app_exit.lck +App.SupportsLiveSettingsChanges=False +App.LiveSettingChangeCommandFormat=set {0} "{1}" +App.ApplicationIPBinding=0.0.0.0 +App.AdminPortRef=RemoteAdminPort +App.UniversalSleepApplicationUDPPortRef=GamePort1 +App.PrimaryApplicationPortRef=GamePort1 +App.UniversalSleepSteamQueryPortRef=SteamQueryPort +App.MaxUsers=8 +App.UseRandomAdminPassword=True +App.RemoteAdminPassword= +App.AdminLoginTransform=None +App.RCONConnectDelaySeconds=30 +App.RCONConnectRetrySeconds=15 +App.RCONHeartbeatCommand=ping +App.RCONHeartbeatMinutes=0 +App.TelnetLoginFormat={0} +App.SteamUpdateAnonymousLogin=True +App.SteamForceLoginPrompt=False +App.SupportsUniversalSleep=False +App.WakeupMode=Any +App.TemplateMatchRegex={{(\$?[\w]+)}} +App.MonitorChildProcess=False +App.MonitorChildProcessWaitMs=1000 +App.MonitorChildProcessName= +App.Compatibility=1 +App.SteamWorkshopDownloadLocation={{$FullBaseDir}}undefined +Console.FilterMatchRegex= +Console.FilterMatchReplacement= +Console.ThrowawayMessageRegex=(WARNING|ERROR): Shader.+ +Console.UpdateAvailableRegex=^\[\d\d:\d\d:\d\d\] \[INFO\] A new server update is available! v[\d\.]+.$ +Console.SuppressLogAtStart=False +Console.ActivateLogRegex= +Console.UserActions={} +Console.SleepMode=False +Console.SleepOnStart=False +Console.SleepDelayMinutes=5 +Console.DozeDelay=2 +Console.AutoRetryCount=5 +Console.SleepStartThresholdSeconds=25 +Console.AppReadyRegex=^Entering\smain\sgame\sloop\.\.\.$ +Console.UserJoinRegex=^\*(?.+)\shas\s(?:rejoined|joined)\sthe\sgame\s\(player\s(?.+)\)$ +Console.UserLeaveRegex=^\*(?.+)\sleft\sthe\sgame$ +Console.UserChatRegex=^(?:|\[PM\])\<(?.+)\>\s(?.+)$ +Meta.OS=Linux +Meta.ConfigManifest=srb2config.json +Meta.MetaConfigManifest=srb2metaconfig.json +Meta.ConfigRoot=srb2.kvp +App.RootDir=./srb2/ +Meta.DisplayImageSource=url:https://cdn2.steamgriddb.com/thumb/cae4a57bcd2fa803df2270f5d8bbbbae.png +App.BaseDirectory=./srb2/ +App.WorkingDir= +App.ExecutableWin= +App.ExecutableLinux=srb2linux.exe +App.LinuxCommandLineArgs= +App.Ports=@IncludeJson[srb2ports.json] +App.UpdateSources=@IncludeJson[srb2updates.json] +App.EnvironmentVariables={"LD_LIBRARY_PATH": "{{$FullBaseDir}}linux64:{{$FullRootDir}}linux64:%LD_LIBRARY_PATH%", "WINEPREFIX": "{{$FullRootDir}}.wine", "WINEARCH": "win64", "WINEDEBUG": "-all"} diff --git a/srb2metaconfig.json b/srb2metaconfig.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/srb2metaconfig.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/srb2ports.json b/srb2ports.json new file mode 100644 index 000000000..2f07313fa --- /dev/null +++ b/srb2ports.json @@ -0,0 +1,9 @@ +[ + { + "Protocol": "UDP", + "Port": "5029", + "Name": "Main Game Port", + "Description": "Port used for main game traffic", + "Ref": "MainGamePort" + } +] \ No newline at end of file diff --git a/srb2updates.json b/srb2updates.json new file mode 100644 index 000000000..113d79af7 --- /dev/null +++ b/srb2updates.json @@ -0,0 +1,80 @@ +[ + { + "UpdateStageName": "Fetching Assets", + "UpdateSourcePlatform": "All", + "UpdateSource": "FetchURL", + "UpdateSourceData": "https://github.com/STJr/SRB2/releases/download/SRB2_release_2.2.15/SRB2-v2215-Full.zip", + "UpdateSourceArgs": "", + "UpdateSourceTarget": "", + "UnzipUpdateSource": true, + "OverwriteExistingFiles": true, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Git clone the source code", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/usr/bin/git", + "UpdateSourceArgs": "clone -b SRB2_release_2.2.15 https://github.com/STJr/SRB2.git srb2/SRB2", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Compile SRB2", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/usr/bin/make", + "UpdateSourceArgs": "-j 4 -C srb2/SRB2/", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Stripping debug symbols", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/usr/bin/strip", + "UpdateSourceArgs": "--strip-debug srb2/SRB2/bin/lsdl2srb2", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Copy linux binary", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "CopyFilePath", + "UpdateSourceData": "./srb2/srb2linux.exe", + "UpdateSourceArgs": "./srb2/SRB2/bin/lsdl2srb2", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Remove complation directory", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/usr/bin/rm", + "UpdateSourceArgs": "-R srb2/SRB2/", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Make game executable", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/usr/bin/chmod", + "UpdateSourceArgs": "+x srb2/srb2linux.exe", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + } +] From 73703c68cea6c76347275fd58b29220a4bdecf25 Mon Sep 17 00:00:00 2001 From: Hacksawfred3232 Date: Sun, 11 May 2025 12:37:11 +0100 Subject: [PATCH 2/5] Some cleanup, removed non-dockerfile varient --- srb2.kvp | 8 +- srb2_Dockerfile | 33 +++++++- srb2config.json => srb2_config.json | 0 srb2metaconfig.json => srb2_metaconfig.json | 0 srb2ports.json => srb2_ports.json | 0 srb2_updates.json | 36 +++++++++ srb2dockerbuild.kvp | 86 --------------------- srb2updates.json | 80 ------------------- 8 files changed, 69 insertions(+), 174 deletions(-) rename srb2config.json => srb2_config.json (100%) rename srb2metaconfig.json => srb2_metaconfig.json (100%) rename srb2ports.json => srb2_ports.json (100%) create mode 100644 srb2_updates.json delete mode 100644 srb2dockerbuild.kvp delete mode 100644 srb2updates.json diff --git a/srb2.kvp b/srb2.kvp index c442855ed..b1039c8c6 100644 --- a/srb2.kvp +++ b/srb2.kvp @@ -4,15 +4,15 @@ Meta.Arch=x86_64 Meta.Author=Hacksawfred3232 Meta.URL=https://www.srb2.org/ Meta.MinAMPVersion=2.4.6.6 -Meta.SpecificDockerImage= -Meta.DockerRequired=False +Meta.SpecificDockerImage=cubecoders/ampbase:deb12-srb2 +Meta.DockerRequired=True Meta.ContainerPolicy=RequiredOnLinux Meta.ContainerPolicyReason=Sonic Junior Team does not supply native Linux binaries. As such, the game needs to be compiled. Meta.ExtraSetupStepsURI=https://github.com/Hacksawfred3232/CustAMPTemplates/issues/1 Meta.Prerequsites=[] Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.Ports.$SteamQueryPort} -Meta.ExtraContainerPackages=['build-essential','git','wget','unzip','nasm','gcc','libsdl2-mixer-dev','libpng-dev','libcurl4-openssl-dev','libgme-dev','libopenmpt-dev','libminiupnpc-dev'] -Meta.AppConfigId=4d6de494-d4d8-4c9b-ab36-9d255a42fa42 +Meta.ExtraContainerPackages=[] +Meta.AppConfigId=2f92c0eb-ac61-4a06-b50a-29e73d123d12 App.AdminMethod=STDIO App.HasReadableConsole=true App.HasWritableConsole=true diff --git a/srb2_Dockerfile b/srb2_Dockerfile index e53631b95..8e65d00d5 100644 --- a/srb2_Dockerfile +++ b/srb2_Dockerfile @@ -1,10 +1,35 @@ -FROM cubecoders/ampbase:deb12 -# Compile to cubecoders/ampbase:deb12-srb2 +FROM debian:bookworm-20250407 AS build # Running upgrade command. RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade -# Apt-get install all required dependencies to compile SRB2 +# Apt-get install all required dependencies to compile this release. RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git wget unzip nasm gcc libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev libminiupnpc-dev +# Goto root and then clone the github repo. +WORKDIR /root +RUN git clone -b "SRB2_release_2.2.15" https://github.com/STJr/SRB2.git +ENV LIBGME_CFLAGS="" +ENV LIBGME_LDFLAGS="-lgme" +# Goto SRB2 and then make the program. +WORKDIR /root/SRB2 +RUN && make -j 4 +# Binary should be compiled now. +# There are still debug symbols on this file. Strip them. +WORKDIR / +RUN strip --strip-debug /root/SRB2/bin/lsdl2srb2 +# Copy the binary file. +RUN cp /root/SRB2/bin/lsdl2srb2 /root/srb2 +# This is where the build ends here. -# And that's about it. KVP and updates.json will handle the rest. +FROM cubecoders/ampbase:deb12 +# Retarget the above to cubecoders/ampbase:deb12-srb2 +# Copy from our builder the main file. updates.json will copy this to our working directory. +COPY --from=build /root/srb2 /srb2linux.exe +# Running upgrade command. +RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade +# Shortened version of the list above. +RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget unzip libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev libminiupnpc-dev +# Running clean up. +RUN apt-get clean && rm -rf /var/lib/apt/lists/* +# Ensure that WORKDIR is / +WORKDIR / \ No newline at end of file diff --git a/srb2config.json b/srb2_config.json similarity index 100% rename from srb2config.json rename to srb2_config.json diff --git a/srb2metaconfig.json b/srb2_metaconfig.json similarity index 100% rename from srb2metaconfig.json rename to srb2_metaconfig.json diff --git a/srb2ports.json b/srb2_ports.json similarity index 100% rename from srb2ports.json rename to srb2_ports.json diff --git a/srb2_updates.json b/srb2_updates.json new file mode 100644 index 000000000..af9f481b9 --- /dev/null +++ b/srb2_updates.json @@ -0,0 +1,36 @@ +[ + { + "UpdateStageName": "Fetching Assets", + "UpdateSourcePlatform": "All", + "UpdateSource": "FetchURL", + "UpdateSourceData": "https://github.com/STJr/SRB2/releases/download/SRB2_release_2.2.15/SRB2-v2215-Full.zip", + "UpdateSourceArgs": "", + "UpdateSourceTarget": "", + "UnzipUpdateSource": true, + "OverwriteExistingFiles": true, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Copy linux binary", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "CopyFilePath", + "UpdateSourceData": "./srb2/srb2linux.exe", + "UpdateSourceArgs": "/srb2linux.exe", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + }, + { + "UpdateStageName": "Make game executable", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/usr/bin/chmod", + "UpdateSourceArgs": "+x srb2/srb2linux.exe", + "UnzipUpdateSource": false, + "OverwriteExistingFiles": false, + "DeleteAfterExtract": true, + "OneShot": true + } +] diff --git a/srb2dockerbuild.kvp b/srb2dockerbuild.kvp deleted file mode 100644 index bf03f792f..000000000 --- a/srb2dockerbuild.kvp +++ /dev/null @@ -1,86 +0,0 @@ -Meta.DisplayName=SRB2 (Dockerfile) -Meta.Description=SRB2 Dedicated Server (v2.2.15) (Custom Docker Image) -Meta.Arch=x86_64 -Meta.Author=Hacksawfred3232 -Meta.URL=https://www.srb2.org/ -Meta.MinAMPVersion=2.4.6.6 -Meta.SpecificDockerImage=cubecoders/ampbase:deb12-srb2 -Meta.DockerRequired=False -Meta.ContainerPolicy=RequiredOnLinux -Meta.ContainerPolicyReason=Sonic Junior Team does not supply native Linux binaries. As such, the game needs to be compiled. -Meta.ExtraSetupStepsURI=https://github.com/Hacksawfred3232/CustAMPTemplates/issues/1 -Meta.Prerequsites=[] -Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.Ports.$SteamQueryPort} -Meta.ExtraContainerPackages=[] -Meta.AppConfigId=2f92c0eb-ac61-4a06-b50a-29e73d123d12 -App.AdminMethod=STDIO -App.HasReadableConsole=true -App.HasWritableConsole=true -App.DisplayName=SRB2 -App.CommandLineArgs={{$PlatformArgs}} {{$FormattedArgs}} -dedicated -nofork -serverport {{$MainGamePort}} -App.WindowsCommandLineArgs= -App.CommandLineParameterFormat=-{0} "{1}" -App.CommandLineParameterDelimiter= -App.RapidStartup=false -App.ApplicationReadyMode=RegexMatch -App.ExitMethod=OS_CLOSE -App.ExitString=stop -App.ExitTimeout=30 -App.ExitFile=app_exit.lck -App.SupportsLiveSettingsChanges=False -App.LiveSettingChangeCommandFormat=set {0} "{1}" -App.ApplicationIPBinding=0.0.0.0 -App.AdminPortRef=RemoteAdminPort -App.UniversalSleepApplicationUDPPortRef=GamePort1 -App.PrimaryApplicationPortRef=GamePort1 -App.UniversalSleepSteamQueryPortRef=SteamQueryPort -App.MaxUsers=8 -App.UseRandomAdminPassword=True -App.RemoteAdminPassword= -App.AdminLoginTransform=None -App.RCONConnectDelaySeconds=30 -App.RCONConnectRetrySeconds=15 -App.RCONHeartbeatCommand=ping -App.RCONHeartbeatMinutes=0 -App.TelnetLoginFormat={0} -App.SteamUpdateAnonymousLogin=True -App.SteamForceLoginPrompt=False -App.SupportsUniversalSleep=False -App.WakeupMode=Any -App.TemplateMatchRegex={{(\$?[\w]+)}} -App.MonitorChildProcess=False -App.MonitorChildProcessWaitMs=1000 -App.MonitorChildProcessName= -App.Compatibility=1 -App.SteamWorkshopDownloadLocation={{$FullBaseDir}}undefined -Console.FilterMatchRegex= -Console.FilterMatchReplacement= -Console.ThrowawayMessageRegex=(WARNING|ERROR): Shader.+ -Console.UpdateAvailableRegex=^\[\d\d:\d\d:\d\d\] \[INFO\] A new server update is available! v[\d\.]+.$ -Console.SuppressLogAtStart=False -Console.ActivateLogRegex= -Console.UserActions={} -Console.SleepMode=False -Console.SleepOnStart=False -Console.SleepDelayMinutes=5 -Console.DozeDelay=2 -Console.AutoRetryCount=5 -Console.SleepStartThresholdSeconds=25 -Console.AppReadyRegex=^Entering\smain\sgame\sloop\.\.\.$ -Console.UserJoinRegex=^\*(?.+)\shas\s(?:rejoined|joined)\sthe\sgame\s\(player\s(?.+)\)$ -Console.UserLeaveRegex=^\*(?.+)\sleft\sthe\sgame$ -Console.UserChatRegex=^(?:|\[PM\])\<(?.+)\>\s(?.+)$ -Meta.OS=Linux -Meta.ConfigManifest=srb2config.json -Meta.MetaConfigManifest=srb2metaconfig.json -Meta.ConfigRoot=srb2.kvp -App.RootDir=./srb2/ -Meta.DisplayImageSource=url:https://cdn2.steamgriddb.com/thumb/cae4a57bcd2fa803df2270f5d8bbbbae.png -App.BaseDirectory=./srb2/ -App.WorkingDir= -App.ExecutableWin= -App.ExecutableLinux=srb2linux.exe -App.LinuxCommandLineArgs= -App.Ports=@IncludeJson[srb2ports.json] -App.UpdateSources=@IncludeJson[srb2updates.json] -App.EnvironmentVariables={"LD_LIBRARY_PATH": "{{$FullBaseDir}}linux64:{{$FullRootDir}}linux64:%LD_LIBRARY_PATH%", "WINEPREFIX": "{{$FullRootDir}}.wine", "WINEARCH": "win64", "WINEDEBUG": "-all"} diff --git a/srb2updates.json b/srb2updates.json deleted file mode 100644 index 113d79af7..000000000 --- a/srb2updates.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "UpdateStageName": "Fetching Assets", - "UpdateSourcePlatform": "All", - "UpdateSource": "FetchURL", - "UpdateSourceData": "https://github.com/STJr/SRB2/releases/download/SRB2_release_2.2.15/SRB2-v2215-Full.zip", - "UpdateSourceArgs": "", - "UpdateSourceTarget": "", - "UnzipUpdateSource": true, - "OverwriteExistingFiles": true, - "DeleteAfterExtract": true, - "OneShot": true - }, - { - "UpdateStageName": "Git clone the source code", - "UpdateSourcePlatform": "Linux", - "UpdateSource": "Executable", - "UpdateSourceData": "/usr/bin/git", - "UpdateSourceArgs": "clone -b SRB2_release_2.2.15 https://github.com/STJr/SRB2.git srb2/SRB2", - "UnzipUpdateSource": false, - "OverwriteExistingFiles": false, - "DeleteAfterExtract": true, - "OneShot": true - }, - { - "UpdateStageName": "Compile SRB2", - "UpdateSourcePlatform": "Linux", - "UpdateSource": "Executable", - "UpdateSourceData": "/usr/bin/make", - "UpdateSourceArgs": "-j 4 -C srb2/SRB2/", - "UnzipUpdateSource": false, - "OverwriteExistingFiles": false, - "DeleteAfterExtract": true, - "OneShot": true - }, - { - "UpdateStageName": "Stripping debug symbols", - "UpdateSourcePlatform": "Linux", - "UpdateSource": "Executable", - "UpdateSourceData": "/usr/bin/strip", - "UpdateSourceArgs": "--strip-debug srb2/SRB2/bin/lsdl2srb2", - "UnzipUpdateSource": false, - "OverwriteExistingFiles": false, - "DeleteAfterExtract": true, - "OneShot": true - }, - { - "UpdateStageName": "Copy linux binary", - "UpdateSourcePlatform": "Linux", - "UpdateSource": "CopyFilePath", - "UpdateSourceData": "./srb2/srb2linux.exe", - "UpdateSourceArgs": "./srb2/SRB2/bin/lsdl2srb2", - "UnzipUpdateSource": false, - "OverwriteExistingFiles": false, - "DeleteAfterExtract": true, - "OneShot": true - }, - { - "UpdateStageName": "Remove complation directory", - "UpdateSourcePlatform": "Linux", - "UpdateSource": "Executable", - "UpdateSourceData": "/usr/bin/rm", - "UpdateSourceArgs": "-R srb2/SRB2/", - "UnzipUpdateSource": false, - "OverwriteExistingFiles": false, - "DeleteAfterExtract": true, - "OneShot": true - }, - { - "UpdateStageName": "Make game executable", - "UpdateSourcePlatform": "Linux", - "UpdateSource": "Executable", - "UpdateSourceData": "/usr/bin/chmod", - "UpdateSourceArgs": "+x srb2/srb2linux.exe", - "UnzipUpdateSource": false, - "OverwriteExistingFiles": false, - "DeleteAfterExtract": true, - "OneShot": true - } -] From 4b7948f08a9093239e5d07edbac1972e562d470b Mon Sep 17 00:00:00 2001 From: Hacksawfred3232 Date: Sun, 11 May 2025 12:42:48 +0100 Subject: [PATCH 3/5] Fixed some pathing. --- srb2.kvp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/srb2.kvp b/srb2.kvp index b1039c8c6..88928d01c 100644 --- a/srb2.kvp +++ b/srb2.kvp @@ -71,8 +71,8 @@ Console.UserJoinRegex=^\*(?.+)\shas\s(?:rejoined|joined)\sthe\sgame\s\ Console.UserLeaveRegex=^\*(?.+)\sleft\sthe\sgame$ Console.UserChatRegex=^(?:|\[PM\])\<(?.+)\>\s(?.+)$ Meta.OS=Linux -Meta.ConfigManifest=srb2config.json -Meta.MetaConfigManifest=srb2metaconfig.json +Meta.ConfigManifest=srb2_config.json +Meta.MetaConfigManifest=srb2_metaconfig.json Meta.ConfigRoot=srb2.kvp App.RootDir=./srb2/ Meta.DisplayImageSource=url:https://cdn2.steamgriddb.com/thumb/cae4a57bcd2fa803df2270f5d8bbbbae.png @@ -81,6 +81,6 @@ App.WorkingDir= App.ExecutableWin= App.ExecutableLinux=srb2linux.exe App.LinuxCommandLineArgs= -App.Ports=@IncludeJson[srb2ports.json] -App.UpdateSources=@IncludeJson[srb2updates.json] +App.Ports=@IncludeJson[srb2_ports.json] +App.UpdateSources=@IncludeJson[srb2_updates.json] App.EnvironmentVariables={"LD_LIBRARY_PATH": "{{$FullBaseDir}}linux64:{{$FullRootDir}}linux64:%LD_LIBRARY_PATH%", "WINEPREFIX": "{{$FullRootDir}}.wine", "WINEARCH": "win64", "WINEDEBUG": "-all"} From 0919b86b1bdf416d9345fea6e7b2488fc206c5a0 Mon Sep 17 00:00:00 2001 From: Hacksawfred3232 Date: Sun, 11 May 2025 13:41:05 +0100 Subject: [PATCH 4/5] Fixed Dockerfile --- srb2_Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srb2_Dockerfile b/srb2_Dockerfile index 8e65d00d5..6b878227b 100644 --- a/srb2_Dockerfile +++ b/srb2_Dockerfile @@ -12,7 +12,7 @@ ENV LIBGME_CFLAGS="" ENV LIBGME_LDFLAGS="-lgme" # Goto SRB2 and then make the program. WORKDIR /root/SRB2 -RUN && make -j 4 +RUN make -j 4 # Binary should be compiled now. # There are still debug symbols on this file. Strip them. WORKDIR / @@ -32,4 +32,4 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget unzip libsdl2-mixer-d # Running clean up. RUN apt-get clean && rm -rf /var/lib/apt/lists/* # Ensure that WORKDIR is / -WORKDIR / \ No newline at end of file +WORKDIR / From c98da5ebb057c6602106c2831ec62339e8600cb1 Mon Sep 17 00:00:00 2001 From: Hacksawfred3232 Date: Fri, 30 May 2025 11:40:42 +0100 Subject: [PATCH 5/5] Updated SRB2 --- srb2.kvp | 2 +- srb2_Dockerfile | 35 ----------------------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 srb2_Dockerfile diff --git a/srb2.kvp b/srb2.kvp index 88928d01c..85c0abe75 100644 --- a/srb2.kvp +++ b/srb2.kvp @@ -4,7 +4,7 @@ Meta.Arch=x86_64 Meta.Author=Hacksawfred3232 Meta.URL=https://www.srb2.org/ Meta.MinAMPVersion=2.4.6.6 -Meta.SpecificDockerImage=cubecoders/ampbase:deb12-srb2 +Meta.SpecificDockerImage=ghcr.io/hacksawfred3232/custampimages/ampcust:srb2 Meta.DockerRequired=True Meta.ContainerPolicy=RequiredOnLinux Meta.ContainerPolicyReason=Sonic Junior Team does not supply native Linux binaries. As such, the game needs to be compiled. diff --git a/srb2_Dockerfile b/srb2_Dockerfile deleted file mode 100644 index 6b878227b..000000000 --- a/srb2_Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM debian:bookworm-20250407 AS build - -# Running upgrade command. -RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade - -# Apt-get install all required dependencies to compile this release. -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git wget unzip nasm gcc libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev libminiupnpc-dev -# Goto root and then clone the github repo. -WORKDIR /root -RUN git clone -b "SRB2_release_2.2.15" https://github.com/STJr/SRB2.git -ENV LIBGME_CFLAGS="" -ENV LIBGME_LDFLAGS="-lgme" -# Goto SRB2 and then make the program. -WORKDIR /root/SRB2 -RUN make -j 4 -# Binary should be compiled now. -# There are still debug symbols on this file. Strip them. -WORKDIR / -RUN strip --strip-debug /root/SRB2/bin/lsdl2srb2 -# Copy the binary file. -RUN cp /root/SRB2/bin/lsdl2srb2 /root/srb2 -# This is where the build ends here. - -FROM cubecoders/ampbase:deb12 -# Retarget the above to cubecoders/ampbase:deb12-srb2 -# Copy from our builder the main file. updates.json will copy this to our working directory. -COPY --from=build /root/srb2 /srb2linux.exe -# Running upgrade command. -RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y upgrade -# Shortened version of the list above. -RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget unzip libsdl2-mixer-dev libpng-dev libcurl4-openssl-dev libgme-dev libopenmpt-dev libminiupnpc-dev -# Running clean up. -RUN apt-get clean && rm -rf /var/lib/apt/lists/* -# Ensure that WORKDIR is / -WORKDIR /