From fc5be0bb7ac948e8b80788c65b1038b1e49fcde7 Mon Sep 17 00:00:00 2001 From: Greelan <53196309+Greelan@users.noreply.github.com> Date: Thu, 2 Nov 2023 19:28:22 +1100 Subject: [PATCH] Arma3 --- arma3.kvp | 2 +- arma3config.json | 16 ++++++++++++ arma3start.json | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 arma3start.json diff --git a/arma3.kvp b/arma3.kvp index 558101e..553f24b 100644 --- a/arma3.kvp +++ b/arma3.kvp @@ -60,7 +60,7 @@ App.RCONHeartbeatMinutes=0.5 App.RCONHeartbeatCommand=ping App.TelnetLoginFormat={0} App.UpdateSources=@IncludeJson[arma3updates.json] -App.PreStartStages=[{"UpdateStageName":"Delete Active File","UpdateSourcePlatform":"Linux","UpdateSource":"Executable","UpdateSourceData":"/bin/bash","UpdateSourceArgs":"-c 'rm -f {{$FullBaseDir}}battleye/beserver_x64_active_*.cfg'"},{"UpdateStageName":"Delete Active File","UpdateSourcePlatform":"Windows","UpdateSource":"Executable","UpdateSourceData":"cmd.exe","UpdateSourceArgs":"/C del /Q /F {{$FullBaseDir}}battleye\\beserver_x64_active_*.cfg"},{"UpdateStageName":"Headless Client Script Download","UpdateSourcePlatform":"Linux","UpdateSource":"FetchURL","UpdateSourceData":"https://github.com/CubeCoders/AMPTemplates/raw/main/arma3runhc.sh","UpdateSourceArgs":"runhc.sh","UpdateSourceTarget":"{{$FullInstanceDir}}","OverwriteExistingFiles":true},{"UpdateStageName":"Headless Client Script Download","UpdateSourcePlatform":"Windows","UpdateSource":"FetchURL","UpdateSourceData":"https://github.com/CubeCoders/AMPTemplates/raw/main/arma3runhc.ps1","UpdateSourceArgs":"runhc.ps1","UpdateSourceTarget":"{{$FullInstanceDir}}","OverwriteExistingFiles":true},{"UpdateStageName":"Start Headless Clients","UpdateSourcePlatform":"Linux","UpdateSource":"Executable","UpdateSourceData":"/bin/bash","UpdateSourceArgs":"-c 'chmod +x ./runhc.sh; ./runhc.sh {{HeadlessClientsNum}} {{$ApplicationIPBinding}} {{$GamePort}} \"{{password}}\" \"{{mod}}\" \"{{hc_parfile}}\" &'"},{"UpdateStageName":"Start Headless Clients","UpdateSourcePlatform":"Windows","UpdateSource":"Executable","UpdateSourceData":"cmd.exe","UpdateSourceArgs":"/C start powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File \"runhc.ps1\" {{HeadlessClientsNum}} {{$ApplicationIPBinding}} {{$GamePort}} \"{{password}}\" \"{{mod}}\" \"{{hc_parfile}}\""}] +App.PreStartStages=@IncludeJson[arma3start.json] App.Compatibility=None App.SteamUpdateAnonymousLogin=False App.SteamForceLoginPrompt=True diff --git a/arma3config.json b/arma3config.json index 8b75d83..a22f4b8 100644 --- a/arma3config.json +++ b/arma3config.json @@ -149,6 +149,22 @@ "DefaultValue":"", "EnumValues":{} }, + { + "DisplayName":"Manage Bikeys", + "Category":"Arma Server Settings", + "Description":"If enabled, the bikey files for each of the mods specified in Load Mods will be copied to the 'keys' directory on server start, to enable signature verification. All existing keys in that directory (other than the default a3.bikey) will be deleted", + "Keywords":"mods,addons,bikeys", + "FieldName":"ManageBikeys", + "InputType":"checkbox", + "IsFlagArgument":false, + "ParamFieldName":"ManageBikeys", + "IncludeInCommandLine":false, + "DefaultValue":"false", + "EnumValues":{ + "False":"false", + "True":"true" + } + }, { "DisplayName":"Server/RCON IP Binding", "Category":"Arma Server Settings", diff --git a/arma3start.json b/arma3start.json new file mode 100644 index 0000000..20c3650 --- /dev/null +++ b/arma3start.json @@ -0,0 +1,66 @@ +[ + { + "UpdateStageName":"Delete Active File", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'rm -f {{$FullBaseDir}}battleye/beserver_x64_active_*.cfg'" + }, + { + "UpdateStageName":"Delete Active File", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C del /Q /F {{$FullBaseDir}}battleye\\beserver_x64_active_*.cfg" + }, + { + "UpdateStageName":"Manage Bikeys", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'cd arma3/233780; find keys/ -name \"*.bikey\" ! -name \"a3.bikey\" -exec rm {} +; IFS=\";\" read -ra subdirs_array <<< \"{{mod}}\" && for subdir in \"${subdirs_array[@]}\"; do find \"$subdir/keys\" -maxdepth 1 -mindepth 1 -type f -name \"*.bikey\" -exec \\cp -t keys/ {} +; done'", + "UpdateSourceConditionSetting":"ManageBikeys", + "UpdateSourceConditionValue":"true" + }, + { + "UpdateStageName":"Manage Bikeys", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C start powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -Command \"$mod = '{{mod}}' -split ';'; Set-Location arma3\\233780; Get-ChildItem -Path 'keys' -Filter '*.bikey' | ForEach-Object { if ($_.Name -ne 'a3.bikey') { Remove-Item -Path $_.FullName -Force } }; foreach ($a in $mod) { Get-ChildItem -Path ('{0}\\keys' -f $a) -Filter '*.bikey' | Copy-Item -Destination 'keys' -Force }\"", + "UpdateSourceConditionSetting":"ManageBikeys", + "UpdateSourceConditionValue":"true" + }, + { + "UpdateStageName":"Headless Client Script Download", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://github.com/CubeCoders/AMPTemplates/raw/main/arma3runhc.sh", + "UpdateSourceArgs":"runhc.sh", + "UpdateSourceTarget":"{{$FullInstanceDir}}", + "OverwriteExistingFiles":true + }, + { + "UpdateStageName":"Headless Client Script Download", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"FetchURL", + "UpdateSourceData":"https://github.com/CubeCoders/AMPTemplates/raw/main/arma3runhc.ps1", + "UpdateSourceArgs":"runhc.ps1", + "UpdateSourceTarget":"{{$FullInstanceDir}}", + "OverwriteExistingFiles":true + }, + { + "UpdateStageName":"Start Headless Clients", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"Executable", + "UpdateSourceData":"/bin/bash", + "UpdateSourceArgs":"-c 'chmod +x ./runhc.sh; ./runhc.sh {{HeadlessClientsNum}} {{$ApplicationIPBinding}} {{$GamePort}} \"{{password}}\" \"{{mod}}\" \"{{hc_parfile}}\" &'" + }, + { + "UpdateStageName":"Start Headless Clients", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"Executable", + "UpdateSourceData":"cmd.exe", + "UpdateSourceArgs":"/C start powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File \"runhc.ps1\" {{HeadlessClientsNum}} {{$ApplicationIPBinding}} {{$GamePort}} \"{{password}}\" \"{{mod}}\" \"{{hc_parfile}}\"" + } +] \ No newline at end of file