From 4439ff3656a4cbd841096ceb628aaf122b099726 Mon Sep 17 00:00:00 2001 From: Greelan <53196309+Greelan@users.noreply.github.com> Date: Wed, 14 Sep 2022 05:56:51 +1000 Subject: [PATCH] Unturned: Updates for new ports system and simplified update stages (#187) --- unturned.kvp | 33 ++++++++++++++++------- unturnedconfig.json | 2 +- unturnedmetaconfig.json | 2 +- unturnedupdates.json | 60 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 unturnedupdates.json diff --git a/unturned.kvp b/unturned.kvp index 6005cde..1ba499f 100644 --- a/unturned.kvp +++ b/unturned.kvp @@ -1,16 +1,23 @@ Meta.DisplayName=Unturned Meta.Description=Unturned 3 Dedicated Server Meta.OS=Windows, Linux +Meta.Arch=x86_64 Meta.Author=Greelan Meta.URL=https://smartlydressedgames.com/#unturned Meta.DisplayImageSource=url:https://cdn.cloudflare.steamstatic.com/steam/apps/304930/library_hero.jpg?t=1613683705 -Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.ApplicationPort1} +Meta.EndpointURIFormat=steam://connect/{ip}:{GenericModule.App.Ports.$ApplicationPort1} Meta.ConfigManifest=unturnedconfig.json Meta.MetaConfigManifest=unturnedmetaconfig.json Meta.ConfigRoot=unturned.kvp -Meta.MinAMPVersion=2.3.2.0 +Meta.MinAMPVersion=2.4.0.2 Meta.SpecificDockerImage= +Meta.DockerRequired=False +Meta.ContainerPolicy=Supported +Meta.ContainerPolicyReason= Meta.Prerequsites=[] +Meta.ExtraContainerPackages=[] +Meta.ConfigReleaseState=NotSpecified +Meta.NoCommercialUsage=False App.DisplayName=Unturned App.RootDir=./U3DS/ App.BaseDirectory=./U3DS/1110390/ @@ -20,6 +27,7 @@ App.WorkingDir=1110390 App.LinuxCommandLineArgs= App.WindowsCommandLineArgs= App.CommandLineArgs={{$PlatformArgs}} -batchmode -nographics {{$FormattedArgs}} +{{ServerType}}/Unturned +App.UseLinuxIOREDIR=False App.AppSettings={} App.EnvironmentVariables={"LD_LIBRARY_PATH":"{{$FullBaseDir}}linux64:{{$FullRootDir}}linux64:%LD_LIBRARY_PATH%","SteamAppId":"304930"} App.CommandLineParameterFormat=-{0}={1} @@ -33,25 +41,30 @@ App.HasReadableConsole=True App.SupportsLiveSettingsChanges=False App.LiveSettingChangeCommandFormat=set {0} "{1}" App.ApplicationIPBinding=0.0.0.0 -App.ApplicationPort1=27015 -App.ApplicationPort2=27016 -App.ApplicationPort3=0 -App.RemoteAdminPort=27115 +App.Ports=[{"Protocol":"Both","Port":27015,"Ref":"ApplicationPort1","Name":"Game Port","Description":"Port for game traffic"},{"Protocol":"Both","Port":27016,"Ref":"QueryPort","Name":"Query Port","Description":"Port for query traffic"},{"Protocol":"TCP","Port":27115,"Ref":"RemoteAdminPort","Name":"RCON Port","Description":"Port for RCON traffic"}] +App.AdminPortRef=RemoteAdminPort +App.PrimaryApplicationPortRef=ApplicationPort1 +App.UniversalSleepApplicationUDPPortRef=ApplicationPort1 +App.UniversalSleepSteamQueryPortRef=QueryPort App.MaxUsers=10 App.UseRandomAdminPassword=True App.RemoteAdminPassword= App.AdminMethod=TelnetRCON +App.AdminLoginTransform=None App.RCONConnectDelaySeconds=5 App.RCONConnectRetrySeconds=5 +App.RCONHeartbeatMinutes=0 +App.RCONHeartbeatCommand=ping App.TelnetLoginFormat=login {0} -App.UpdateSources=[{"UpdateStageName":"SteamCMD Download","UpdateSourcePlatform":"All","UpdateSource":"SteamCMD","UpdateSourceData":"1110390"},{"UpdateStageName":"Main Config File Download","UpdateSourcePlatform":"All","UpdateSource":"FetchURL","UpdateSourceData":"https://raw.githubusercontent.com/CubeCoders/AMPTemplates/main/unturnedconfigfile.dat","UpdateSourceTarget":"../","OverwriteExistingFiles":true},{"UpdateStageName":"Workshop Config File Download","UpdateSourcePlatform":"All","UpdateSource":"FetchURL","UpdateSourceData":"https://raw.githubusercontent.com/CubeCoders/AMPTemplates/main/unturnedworkshopconfig.json","UpdateSourceTarget":"../","OverwriteExistingFiles":true},{"UpdateStageName":"Config Directory Creation","UpdateSourcePlatform":"All","UpdateSource":"CreateDirectory","UpdateSourceArgs":"./U3DS/1110390/Servers/Unturned/Server"},{"UpdateStageName":"Config File Copy","UpdateSourcePlatform":"All","UpdateSource":"CopyFilePath","UpdateSourceData":"./U3DS/1110390/Servers/Unturned/Server/Commands.dat","UpdateSourceArgs":"./unturnedconfigfile.dat","OverwriteExistingFiles":false},{"UpdateStageName":"Rocket Directory Creation","UpdateSourcePlatform":"All","UpdateSource":"CreateDirectory","UpdateSourceArgs":"./U3DS/1110390/Modules/Rocket.Unturned"},{"UpdateStageName":"First Rocket File Copy","UpdateSourcePlatform":"All","UpdateSource":"CopyFilePath","UpdateSourceData":"./U3DS/1110390/Modules/Rocket.Unturned/English.dat","UpdateSourceArgs":"./U3DS/1110390/Extras/Rocket.Unturned/English.dat","OverwriteExistingFiles":true},{"UpdateStageName":"Second Rocket File Copy","UpdateSourcePlatform":"All","UpdateSource":"CopyFilePath","UpdateSourceData":"./U3DS/1110390/Modules/Rocket.Unturned/Rocket.API.dll","UpdateSourceArgs":"./U3DS/1110390/Extras/Rocket.Unturned/Rocket.API.dll","OverwriteExistingFiles":true},{"UpdateStageName":"Third Rocket File Copy","UpdateSourcePlatform":"All","UpdateSource":"CopyFilePath","UpdateSourceData":"./U3DS/1110390/Modules/Rocket.Unturned/Rocket.Core.dll","UpdateSourceArgs":"./U3DS/1110390/Extras/Rocket.Unturned/Rocket.Core.dll","OverwriteExistingFiles":true},{"UpdateStageName":"Fourth Rocket File Copy","UpdateSourcePlatform":"All","UpdateSource":"CopyFilePath","UpdateSourceData":"./U3DS/1110390/Modules/Rocket.Unturned/Rocket.Unturned.dll","UpdateSourceArgs":"./U3DS/1110390/Extras/Rocket.Unturned/Rocket.Unturned.dll","OverwriteExistingFiles":true},{"UpdateStageName":"Fifth Rocket File Copy","UpdateSourcePlatform":"All","UpdateSource":"CopyFilePath","UpdateSourceData":"./U3DS/1110390/Modules/Rocket.Unturned/Rocket.Unturned.module","UpdateSourceArgs":"./U3DS/1110390/Extras/Rocket.Unturned/Rocket.Unturned.module","OverwriteExistingFiles":true},{"UpdateStageName":"Start Server","UpdateSourcePlatform":"All","UpdateSource":"StartApplication"},{"UpdateStageName":"Wait For Server Start","UpdateSourcePlatform":"All","UpdateSource":"WaitForStartupComplete"},{"UpdateStageName":"Stop Server","UpdateSourcePlatform":"All","UpdateSource":"ShutdownApplication"}] +App.UpdateSources=@IncludeJson[unturnedupdates.json] App.Compatibility=None App.SteamUpdateAnonymousLogin=True App.SteamForceLoginPrompt=False App.RapidStartup=False +App.MonitorChildProcess=False +App.MonitorChildProcessWaitMs=100 +App.MonitorChildProcessName= App.SupportsUniversalSleep=True -App.UniversalSleepApplicationUDPPort=2 -App.UniversalSleepSteamQueryPort=1 App.WakeupMode=Any App.ApplicationReadyMode=RegexMatch App.TemplateMatchRegex={{(\$?[\w]+)}} @@ -63,6 +76,7 @@ Console.UserJoinRegex=^Connecting: PlayerID: (?.+?) Name: (?.+ Console.UserLeaveRegex=^Disconnecting: PlayerID: (?.+?) Name: (?.+?) Character: (?.+?)$ Console.UserChatRegex=^\[(?:World|Area|Group)\] (?.+?) \[(?.+?)\]: "(?.+)"$ Console.UpdateAvailableRegex=^\[\d\d:\d\d:\d\d\] \[INFO\] A new server update is available! v[\d\.]+.$ +Console.MetricsRegex= Console.SuppressLogAtStart=False Console.ActivateLogRegex= Console.UserActions={} @@ -71,3 +85,4 @@ Limits.SleepOnStart=False Limits.SleepDelayMinutes=5 Limits.DozeDelay=2 Limits.AutoRetryCount=5 +Limits.SleepStartThresholdSeconds=25 diff --git a/unturnedconfig.json b/unturnedconfig.json index a6b638e..567bdb9 100644 --- a/unturnedconfig.json +++ b/unturnedconfig.json @@ -1,6 +1,6 @@ [ { - "DisplayName": "Server Port", + "DisplayName": "Game Port", "Category": "Server Settings", "Description": "", "Keywords": "", diff --git a/unturnedmetaconfig.json b/unturnedmetaconfig.json index c1e1656..1e812e2 100644 --- a/unturnedmetaconfig.json +++ b/unturnedmetaconfig.json @@ -17,4 +17,4 @@ "AutoMap": true, "ConfigType": "xml" } -] +] \ No newline at end of file diff --git a/unturnedupdates.json b/unturnedupdates.json new file mode 100644 index 0000000..28f5ae0 --- /dev/null +++ b/unturnedupdates.json @@ -0,0 +1,60 @@ +[ + { + "UpdateStageName":"SteamCMD Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"1110390" + }, + { + "UpdateStageName":"Config Directory Creation", + "UpdateSourcePlatform":"All", + "UpdateSource":"CreateDirectory", + "UpdateSourceArgs":"{{$FullBaseDir}}Servers/Unturned/Server" + }, + { + "UpdateStageName":"Main Config File Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://raw.githubusercontent.com/CubeCoders/AMPTemplates/main/unturnedconfigfile.dat", + "UpdateSourceArgs":"Commands.dat", + "UpdateSourceTarget":"{{$FullBaseDir}}Servers/Unturned/Server/", + "OverwriteExistingFiles":false + }, + { + "UpdateStageName":"Workshop Config File Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://raw.githubusercontent.com/CubeCoders/AMPTemplates/main/unturnedworkshopconfig.json", + "UpdateSourceTarget":"{{$FullInstanceDir}}", + "OverwriteExistingFiles":true + }, + { + "UpdateStageName":"Copy Rocket Directory", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C xcopy /E /Y /I .\\U3DS\\1110390\\Extras\\Rocket.Unturned .\\U3DS\\1110390\\Modules\\Rocket.Unturned" + }, + { + "UpdateStageName":"Copy Rocket Directory", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/cp", + "UpdateSourceArgs":"-rf ./U3DS/1110390/Extras/Rocket.Unturned ./U3DS/1110390/Modules" + }, + { + "UpdateStageName":"Start Server", + "UpdateSourcePlatform":"All", + "UpdateSource":"StartApplication" + }, + { + "UpdateStageName":"Wait For Server Start", + "UpdateSourcePlatform":"All", + "UpdateSource":"WaitForStartupComplete" + }, + { + "UpdateStageName":"Stop Server", + "UpdateSourcePlatform":"All", + "UpdateSource":"ShutdownApplication" + } +] \ No newline at end of file