Space Engineers: add Linux support (#400)

This commit is contained in:
Greelan 2023-06-21 15:17:14 +10:00 committed by GitHub
parent 7241c62480
commit 391eacb472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 116 additions and 55 deletions

View File

@ -1,32 +1,39 @@
Meta.DisplayName=Space Engineers Meta.DisplayName=Space Engineers
Meta.Description=Space Engineers Dedicated Server Meta.Description=Space Engineers Dedicated Server
Meta.OS=Windows Meta.OS=Windows, Linux
Meta.AarchSupport=Unknown
Meta.Arch=x86_64 Meta.Arch=x86_64
Meta.Author=IceOfWraith, CubeCoders(base) Meta.Author=IceOfWraith, Greelan, CubeCoders(base)
Meta.URL=https://store.steampowered.com/app/244850/Space_Engineers/ Meta.URL=https://store.steampowered.com/app/244850/Space_Engineers/
Meta.DisplayImageSource=steam:244850 Meta.DisplayImageSource=steam:244850
Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.ApplicationPort2} Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.Ports.$ApplicationPort1}
Meta.ConfigManifest=space-engineers-genericconfig.json Meta.ConfigManifest=space-engineers-genericconfig.json
Meta.MetaConfigManifest=space-engineers-genericmetaconfig.json Meta.MetaConfigManifest=space-engineers-genericmetaconfig.json
Meta.ConfigRoot=space-engineers-generic.kvp Meta.ConfigRoot=space-engineers-generic.kvp
Meta.MinAMPVersion=2.4.0.10 Meta.MinAMPVersion=2.4.3.0
Meta.SpecificDockerImage= Meta.SpecificDockerImage=cubecoders/ampbase:wine8
Meta.DockerRequired=False Meta.DockerRequired=False
Meta.ContainerPolicy=NotSupported Meta.ContainerPolicy=SupportedOnWindows, RecommendedOnLinux
Meta.ContainerPolicyReason=This game has dependencies that are not currently supported by AMP. Meta.ContainerPolicyReason=The server requires Wine 8 (or later), Xvfb and cabextract to install and run on Linux. Using a container avoids the need to install these dependencies on the host.
Meta.ExtraSetupStepsURI=
Meta.Prerequsites=[] Meta.Prerequsites=[]
Meta.ExtraContainerPackages=[] Meta.ExtraContainerPackages=[]
Meta.ConfigReleaseState=NotSpecified Meta.ConfigReleaseState=NotSpecified
Meta.NoCommercialUsage=False Meta.NoCommercialUsage=False
Meta.ConfigVersion=0.0.0.0
Meta.ReleaseNotes=
Meta.BreakingReleaseNotes=
App.DisplayName=Space Engineers App.DisplayName=Space Engineers
App.RootDir=./space-engineers-generic/ App.RootDir=./space-engineers-generic/
App.BaseDirectory=./space-engineers-generic/298740/ App.BaseDirectory=./space-engineers-generic/298740/
App.SteamWorkshopDownloadLocation=
App.ExecutableWin=298740\DedicatedServer64\SpaceEngineersDedicated.exe App.ExecutableWin=298740\DedicatedServer64\SpaceEngineersDedicated.exe
App.ExecutableLinux= App.ExecutableLinux=/usr/bin/wine
App.WorkingDir=298740/DedicatedServer64 App.WorkingDir=298740/DedicatedServer64
App.LinuxCommandLineArgs= App.LinuxCommandLineArgs="./SpaceEngineersDedicated.exe"
App.WindowsCommandLineArgs= App.WindowsCommandLineArgs=
App.CommandLineArgs={{$PlatformArgs}} -console -path "{{$FullBaseDir}}servers" {{$FormattedArgs}} App.CommandLineArgs={{$PlatformArgs}} -console -path "{{$FullBaseDir}}servers" {{$FormattedArgs}}
App.UseLinuxIOREDIR=False
App.AppSettings={} App.AppSettings={}
App.EnvironmentVariables={"LD_LIBRARY_PATH":"./linux64:%LD_LIBRARY_PATH%","SteamAppId":"244850","WINEPREFIX":"{{$FullRootDir}}.wine","WINEARCH":"win64","WINEDEBUG":"-all"} App.EnvironmentVariables={"LD_LIBRARY_PATH":"./linux64:%LD_LIBRARY_PATH%","SteamAppId":"244850","WINEPREFIX":"{{$FullRootDir}}.wine","WINEARCH":"win64","WINEDEBUG":"-all"}
App.CommandLineParameterFormat=-{0} "{1}" App.CommandLineParameterFormat=-{0} "{1}"
@ -47,29 +54,33 @@ App.UniversalSleepApplicationUDPPortRef=ApplicationPort1
App.UniversalSleepSteamQueryPortRef=ApplicationPort2 App.UniversalSleepSteamQueryPortRef=ApplicationPort2
App.MaxUsers=4 App.MaxUsers=4
App.UseRandomAdminPassword=False App.UseRandomAdminPassword=False
App.RemoteAdminPassword=Password123 App.PersistRandomPassword=True
App.RemoteAdminPassword=
App.AdminMethod=STDIO App.AdminMethod=STDIO
App.AdminLoginTransform=None App.AdminLoginTransform=None
App.LoginTransformPrefix=
App.RCONConnectDelaySeconds=5 App.RCONConnectDelaySeconds=5
App.RCONConnectRetrySeconds=5 App.RCONConnectRetrySeconds=5
App.RCONHeartbeatMinutes=0 App.RCONHeartbeatMinutes=0
App.RCONHeartbeatCommand=ping App.RCONHeartbeatCommand=ping
App.TelnetLoginFormat={0} App.TelnetLoginFormat={0}
App.UpdateSources=@IncludeJson[space-engineers-genericupdates.json] App.UpdateSources=@IncludeJson[space-engineers-genericupdates.json]
App.PreStartStages=[]
App.Compatibility=None App.Compatibility=None
App.SteamUpdateAnonymousLogin=True App.SteamUpdateAnonymousLogin=True
App.SteamForceLoginPrompt=False App.SteamForceLoginPrompt=False
App.RapidStartup=False App.RapidStartup=False
App.MonitorChildProcess=True
App.DumpFullChildProcessTree=False
App.MonitorChildProcessWaitMs=1000
App.MonitorChildProcessName=SpaceEngineersDedicated.exe
App.SupportsUniversalSleep=True App.SupportsUniversalSleep=True
App.WakeupMode=Any App.WakeupMode=Any
App.ApplicationReadyMode=RegexMatch App.ApplicationReadyMode=RegexMatch
App.TemplateMatchRegex={{(\$?[\w]+)}} App.TemplateMatchRegex={{(\$?[\w]+)}}
App.MonitorChildProcess=True
App.MonitorChildProcessWaitMs=3000
App.MonitorChildProcessName=wine64
Console.FilterMatchRegex= Console.FilterMatchRegex=
Console.FilterMatchReplacement= Console.FilterMatchReplacement=
Console.ThrowawayMessageRegex=^(WARNING|ERROR): Shader.+$ Console.ThrowawayMessageRegex=^(WARNING|ERROR): Shader.+|.+\|WARN\|GameAnalyticsSDK\.Net\.Logging\.GALogger\|Warning\/GameAnalytics: Event queue: Failed to send events to collector - Retrying next time$
Console.AppReadyRegex=^\d+\-\d+\-\d+ \d+\:\d+\:\d+.\d+\: Game ready.*$ Console.AppReadyRegex=^\d+\-\d+\-\d+ \d+\:\d+\:\d+.\d+\: Game ready.*$
Console.UserJoinRegex=^\d+\-\d+\-\d+ \d+\:\d+\:\d+.\d+\: World request received: (?<username>.+?)$ Console.UserJoinRegex=^\d+\-\d+\-\d+ \d+\:\d+\:\d+.\d+\: World request received: (?<username>.+?)$
Console.UserLeaveRegex=^\d+\-\d+\-\d+ \d+\:\d+\:\d+.\d+\: User left (?<username>.+?)$ Console.UserLeaveRegex=^\d+\-\d+\-\d+ \d+\:\d+\:\d+.\d+\: User left (?<username>.+?)$

View File

@ -5,7 +5,8 @@
"UpdateSource":"SteamCMD", "UpdateSource":"SteamCMD",
"UpdateSourceData":"298740", "UpdateSourceData":"298740",
"UpdateSourceArgs":"244850", "UpdateSourceArgs":"244850",
"UpdateSourceVersion": "{{Stream}}" "UpdateSourceVersion":"{{Stream}}",
"ForceDownloadPlatform":"Windows"
}, },
{ {
"UpdateStageName":"Create Config Directory", "UpdateStageName":"Create Config Directory",
@ -52,6 +53,22 @@
"UpdateSourcePlatform":"Linux", "UpdateSourcePlatform":"Linux",
"UpdateSource":"Executable", "UpdateSource":"Executable",
"UpdateSourceData":"/bin/bash", "UpdateSourceData":"/bin/bash",
"UpdateSourceArgs": "-c 'WINEPREFIX=\"{{$FullRootDir}}.wine\" WINEARCH=win64 /usr/bin/wineboot --init --update'" "UpdateSourceArgs":"-c 'WINEPREFIX=\"{{$FullRootDir}}.wine\" WINEARCH=win64 WINEDEBUG=-all WINEDLLOVERRIDES=\"mscoree,mshtml=\" /usr/bin/wineboot --init --update'"
},
{
"UpdateStageName":"Winescript Download",
"UpdateSourcePlatform":"Linux",
"UpdateSource":"FetchURL",
"UpdateSourceData":"https://raw.githubusercontent.com/CubeCoders/AMPTemplates/main/space-engineers-genericwinescript.sh",
"UpdateSourceArgs":"winescript.sh",
"UpdateSourceTarget":"{{$FullInstanceDir}}",
"OverwriteExistingFiles":true
},
{
"UpdateStageName":"Install Windows Components",
"UpdateSourcePlatform":"Linux",
"UpdateSource":"Executable",
"UpdateSourceData":"/bin/bash",
"UpdateSourceArgs":"./winescript.sh"
} }
] ]

View File

@ -0,0 +1,33 @@
#!/bin/bash
SCRIPT_NAME=$(echo \"$0\" | xargs readlink -f)
SCRIPTDIR=$(dirname "$SCRIPT_NAME")
exec 6>display.log
/usr/bin/Xvfb -displayfd 6 &
XVFB_PID=$!
while [[ ! -s display.log ]]; do
sleep 1
done
read -r DPY_NUM < display.log
rm display.log
wget -N https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
export WINEPREFIX="$SCRIPTDIR/space-engineers-generic/.wine"
export WINEDLLOVERRIDES="mscoree,mshtml="
export WINEARCH=win64
export WINEDEBUG=fixme-all
export DISPLAY=:$DPY_NUM
./winetricks corefonts > winescript_log.txt 2>&1
./winetricks sound=disabled >> winescript_log.txt 2>&1
./winetricks -q vcrun2013 >> winescript_log.txt 2>&1
./winetricks -q vcrun2019 >> winescript_log.txt 2>&1
./winetricks -q dotnet48 >> winescript_log.txt 2>&1
rm -rf ~/.cache/winetricks ~/.cache/fontconfig
exec 6>&-
kill $XVFB_PID
exit 0