From 83239c502cb7701e5816441c107219a983473a24 Mon Sep 17 00:00:00 2001 From: Greelan <53196309+Greelan@users.noreply.github.com> Date: Mon, 29 May 2023 13:29:22 +1000 Subject: [PATCH] Assetto Corsa: switch to native Linux and add modded server option (#379) --- assetto-corsa.kvp | 40 +++++++++++----- assetto-corsaconfig.json | 32 ++++++++++++- assetto-corsaupdates.json | 96 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 155 insertions(+), 13 deletions(-) create mode 100644 assetto-corsaupdates.json diff --git a/assetto-corsa.kvp b/assetto-corsa.kvp index b8dcf1b..39feeae 100644 --- a/assetto-corsa.kvp +++ b/assetto-corsa.kvp @@ -1,6 +1,7 @@ Meta.DisplayName=Assetto Corsa Meta.Description=Assetto Corsa Dedicated Server Meta.OS=Windows, Linux +Meta.AarchSupport=Unknown Meta.Arch=x86_64 Meta.Author=Greelan Meta.URL=https://steamdb.info/app/244210 @@ -9,24 +10,32 @@ Meta.EndpointURIFormat= Meta.ConfigManifest=assetto-corsaconfig.json Meta.MetaConfigManifest=assetto-corsametaconfig.json Meta.ConfigRoot=assetto-corsa.kvp -Meta.MinAMPVersion=2.4.0.2 -Meta.SpecificDockerImage=cubecoders/ampbase:wine +Meta.MinAMPVersion=2.4.3.6 +Meta.SpecificDockerImage= Meta.DockerRequired=False -Meta.ContainerPolicy=SupportedOnWindows, RecommendedOnLinux -Meta.ContainerPolicyReason=The server requires Wine to run on Linux. Using a container avoids the need to install this dependency on the host. +Meta.ContainerPolicy=Supported +Meta.ContainerPolicyReason= +Meta.ExtraSetupStepsURI= Meta.Prerequsites=[] +Meta.ExtraContainerPackages=[] Meta.ConfigReleaseState=NotSpecified +Meta.NoCommercialUsage=False +Meta.ConfigVersion=0.0.0.0 +Meta.ReleaseNotes= +Meta.BreakingReleaseNotes= App.DisplayName=Assetto Corsa App.RootDir=./assetto-corsa/ -App.BaseDirectory=./assetto-corsa/302550 +App.BaseDirectory=./assetto-corsa/302550/ +App.SteamWorkshopDownloadLocation= App.ExecutableWin=302550\acServer.exe -App.ExecutableLinux=/usr/bin/wine +App.ExecutableLinux=302550/acServer App.WorkingDir=302550 -App.LinuxCommandLineArgs="./acServer.exe" +App.LinuxCommandLineArgs= App.WindowsCommandLineArgs= App.CommandLineArgs={{$PlatformArgs}} {{$FormattedArgs}} +App.UseLinuxIOREDIR=False App.AppSettings={} -App.EnvironmentVariables={"LD_LIBRARY_PATH":"{{$FullBaseDir}}linux64:%LD_LIBRARY_PATH%","SteamAppId":"244210","WINEPREFIX":"{{$FullRootDir}}.wine","WINEARCH":"win32","WINEDEBUG":"-all"} +App.EnvironmentVariables={"LD_LIBRARY_PATH":"{{$FullBaseDir}}linux64:%LD_LIBRARY_PATH%","SteamAppId":"244210","DOTNET_ROOT":"{{$FullBaseDir}}dotnet"} App.CommandLineParameterFormat=-{0} "{1}" App.CommandLineParameterDelimiter= App.ExitMethod=OS_CLOSE @@ -39,23 +48,30 @@ App.SupportsLiveSettingsChanges=False App.LiveSettingChangeCommandFormat=set {0} "{1}" App.ApplicationIPBinding=0.0.0.0 App.Ports=[{"Protocol":"Both","Port":9600,"Ref":"GamePort","Name":"Game Port","Description":"Port for game traffic"},{"Protocol":"TCP","Port":9601,"Ref":"HTTPPort","Name":"HTTP Port","Description":"Port for lobby info"}] +App.AdminPortRef=0 App.PrimaryApplicationPortRef=GamePort App.UniversalSleepApplicationUDPPortRef=GamePort App.UniversalSleepSteamQueryPortRef=GamePort App.MaxUsers=18 App.UseRandomAdminPassword=False -App.RemoteAdminPassword=Password123 +App.PersistRandomPassword=False +App.RemoteAdminPassword= App.AdminMethod=STDIO App.AdminLoginTransform=None +App.LoginTransformPrefix= App.RCONConnectDelaySeconds=5 App.RCONConnectRetrySeconds=5 +App.RCONHeartbeatMinutes=0 +App.RCONHeartbeatCommand=ping App.TelnetLoginFormat={0} -App.UpdateSources=[{"UpdateStageName":"SteamCMD Server Download","UpdateSourcePlatform":"All","UpdateSource":"SteamCMD","UpdateSourceData":"302550","UpdateSourceArgs":"244210","ForceDownloadPlatform":"Windows"},{"UpdateStageName":"Initialise Wine","UpdateSourcePlatform":"Linux","UpdateSource":"Executable","UpdateSourceData":"/bin/bash","UpdateSourceArgs":"-c 'WINEPREFIX=\"{{$FullRootDir}}.wine\" WINEARCH=win32 /usr/bin/wineboot --init --update'"}] +App.UpdateSources=@IncludeJson[assetto-corsaupdates.json] +App.PreStartStages=[] App.Compatibility=None App.SteamUpdateAnonymousLogin=False App.SteamForceLoginPrompt=False App.RapidStartup=False App.MonitorChildProcess=True +App.DumpFullChildProcessTree=False App.MonitorChildProcessWaitMs=2000 App.MonitorChildProcessName=acServer.exe App.SupportsUniversalSleep=False @@ -64,8 +80,8 @@ App.ApplicationReadyMode=RegexMatch App.TemplateMatchRegex={{(\$?[\w]+)}} Console.FilterMatchRegex= Console.FilterMatchReplacement= -Console.ThrowawayMessageRegex=^((WARNING|ERROR): Shader.+|Could not find Wine Gecko.*)$ -Console.AppReadyRegex=^Server started$ +Console.ThrowawayMessageRegex=^((WARNING|ERROR): Shader.+)$ +Console.AppReadyRegex=^(Server started|\[[\d:]+ INF\] Starting update loop with an update rate of \d+hz)$ Console.UserJoinRegex=^DRIVER ACCEPTED FOR CAR (?.+?)$ Console.UserLeaveRegex=^Clean exit, driver disconnected:\s+(?.+?) \[\]$ Console.UserChatRegex=^$ diff --git a/assetto-corsaconfig.json b/assetto-corsaconfig.json index 439d70e..8cf53fa 100644 --- a/assetto-corsaconfig.json +++ b/assetto-corsaconfig.json @@ -638,5 +638,35 @@ "Suffix":"%", "Placeholder":"90", "EnumValues":{} - } + }, + { + "DisplayName":"Server Version", + "Category":"SteamCMD and Updates", + "Description":"Sets the server version to install. The Modded version is installed from the [AssettoServer](https://assettoserver.org/) repo. Select the required Dotnet Version as well. NOTE: Update the server after switching versions!", + "Keywords":"server,version,modded", + "FieldName":"ServerVersion", + "InputType":"enum", + "IsFlagArgument":false, + "ParamFieldName":"ServerVersion", + "IncludeInCommandLine":false, + "DefaultValue":"vanilla", + "EnumValues":{ + "vanilla":"Vanilla (default)", + "modded":"Modded (AssettoServer)" + } + }, + { + "DisplayName":"Dotnet Version", + "Category":"SteamCMD and Updates", + "Description":"Sets the [ASP.NET Core 7.0 version](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) to install for the Modded server. NOTE: Update the server after switching versions!", + "Keywords":"dotnet,version", + "FieldName":"DotnetVersion", + "InputType":"text", + "IsFlagArgument":false, + "ParamFieldName":"DotnetVersion", + "IncludeInCommandLine":false, + "DefaultValue":"7.0.5", + "Placeholder":"7.0.5", + "EnumValues":{} + } ] \ No newline at end of file diff --git a/assetto-corsaupdates.json b/assetto-corsaupdates.json new file mode 100644 index 0000000..a7ee31d --- /dev/null +++ b/assetto-corsaupdates.json @@ -0,0 +1,96 @@ +[ + { + "UpdateStageName":"SteamCMD Server Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"302550", + "UpdateSourceArgs":"244210", + "ForceDownloadPlatform":"Windows" + }, + { + "UpdateStageName":"Modded Server Download", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"GithubRelease", + "UpdateSourceArgs":"compujuckel/AssettoServer", + "UpdateSourceData":"assetto-server-win-x64.zip", + "UpdateSourceTarget":"{{$FullBaseDir}}", + "UnzipUpdateSource":true, + "OverwriteExistingFiles":true, + "DeleteAfterExtract":true, + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + }, + { + "UpdateStageName":"Modded Server Download", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"GithubRelease", + "UpdateSourceArgs":"compujuckel/AssettoServer", + "UpdateSourceData":"assetto-server-linux-x64.tar.gz", + "UpdateSourceTarget":"{{$FullBaseDir}}", + "UnzipUpdateSource":true, + "OverwriteExistingFiles":true, + "DeleteAfterExtract":true, + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + }, + { + "UpdateStageName":"Modded Server Overwrite", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C move /Y assetto-corsa\\302550\\AssettoServer.exe assetto-corsa\\302550\\acServer.exe", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + }, + { + "UpdateStageName":"Modded Server Overwrite", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'mv -f ./assetto-corsa/302550/AssettoServer ./assetto-corsa/302550/acServer && chmod +x ./assetto-corsa/302550/acServer'", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + }, + { + "UpdateStageName":"SteamCMD Component Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"1007", + "UpdateSourceTarget":"302550", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + }, + { + "UpdateStageName":"Create Dotnet Directory", + "UpdateSourcePlatform":"All", + "UpdateSource":"CreateDirectory", + "UpdateSourceArgs":"{{$FullBaseDir}}dotnet", + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + }, + { + "UpdateStageName":"ASP.NET Core Runtime Download", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/{{DotnetVersion}}/aspnetcore-runtime-{{DotnetVersion}}-win-x64.zip", + "UpdateSourceTarget":"{{$FullBaseDir}}dotnet", + "UnzipUpdateSource":true, + "OverwriteExistingFiles":true, + "DeleteAfterExtract":true, + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + }, + { + "UpdateStageName":"ASP.NET Core Runtime Download", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://dotnetcli.azureedge.net/dotnet/aspnetcore/Runtime/{{DotnetVersion}}/aspnetcore-runtime-{{DotnetVersion}}-linux-x64.tar.gz", + "UpdateSourceTarget":"{{$FullBaseDir}}", + "UpdateSourceTarget":"{{$FullBaseDir}}dotnet", + "UnzipUpdateSource":true, + "OverwriteExistingFiles":true, + "DeleteAfterExtract":true, + "UpdateSourceConditionSetting":"ServerVersion", + "UpdateSourceConditionValue":"modded" + } +] \ No newline at end of file