diff --git a/arma3.kvp b/arma3.kvp index 3bd91c8..558101e 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}}\" &'"},{"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}}\""}] +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.Compatibility=None App.SteamUpdateAnonymousLogin=False App.SteamForceLoginPrompt=True diff --git a/arma3config.json b/arma3config.json index 1d98450..8b75d83 100644 --- a/arma3config.json +++ b/arma3config.json @@ -227,7 +227,7 @@ { "DisplayName":"Minimum Client Version", "Category":"Arma Server Settings", - "Description":"Sets the minimum client version, below which clients won't be allowed to join. Default of 99999999 equates to the server version", + "Description":"Sets the minimum client version, below which clients won't be allowed to join. Default of 99999999 equates to the server version. NOTE: If the server uses the Performance Profiling Build in any way, set this to 0, otherwise no client can connect", "Keywords":"required,build,requiredbuild", "FieldName":"requiredBuild", "InputType":"number", @@ -284,6 +284,22 @@ "Placeholder":"\"127.0.0.1\",\"210.187.254.121\"", "EnumValues":{} }, + { + "DisplayName":"Use Headless Client Startup Parameters File", + "Category":"Arma Server Settings", + "Description":"If enabled, allows the use of a [parameters file](https://community.bistudio.com/wiki/Startup_Parameters_Config_File) for additional startup parameters for headless clients. File is \"hc_parameters.txt\" in the server base directory. Useful if the server also uses its own Startup Parameters File for mods. Use with care", + "Keywords":"headless,client,custom,server,arguments,parameters,file,parfile", + "FieldName":"hc_parfile", + "InputType":"checkbox", + "IsFlagArgument":false, + "ParamFieldName":"hc_parfile", + "IncludeInCommandLine":false, + "DefaultValue":"", + "EnumValues":{ + "False":"", + "True":"hc_parameters.txt" + } + }, { "DisplayName":"Local Headless Client IPs", "Category":"Arma Server Settings", @@ -347,9 +363,9 @@ "EnumValues":{} }, { - "DisplayName":"Use Startup Parameters File", + "DisplayName":"Use Server Startup Parameters File", "Category":"Arma Server Settings", - "Description":"If enabled, allows the use of a [parameters file](https://community.bistudio.com/wiki/Startup_Parameters_Config_File) for additional startup parameters. File is \"parameters.txt\" in the server base directory. Useful for long startup parameters such as -mods or -servermods. Use with care", + "Description":"If enabled, allows the use of a [parameters file](https://community.bistudio.com/wiki/Startup_Parameters_Config_File) for additional startup parameters for the server. File is \"parameters.txt\" in the server base directory. Useful for long startup parameters such as -mod or -serverMod. Use with care", "Keywords":"custom,server,arguments,parameters,file,parfile", "FieldName":"parfile", "InputType":"checkbox", @@ -1178,7 +1194,7 @@ { "DisplayName":"Server Branch", "Category":"SteamCMD and Updates", - "Description":"Sets the server branch to install. NOTE: Update the server after switching branches!", + "Description":"Sets the server branch (or branches) to install. NOTE: Update the server after switching branches, and set the Minimum Client Version to 0 if using the Performance Profiling Build in any way!", "Keywords":"server,branch,depot", "FieldName":"ServerBranch", "InputType":"enum", @@ -1190,7 +1206,8 @@ "public":"Public (default)", "profiling":"Performance Profiling Build", "creatordlc":"Creator DLC Build", - "contact":"Contact Build" + "contact":"Contact Build", + "creatordlc-profiling":"Creator DLC + Performance Profiling Builds" } } ] diff --git a/arma3runhc.ps1 b/arma3runhc.ps1 index 6fd8dff..c4919be 100644 --- a/arma3runhc.ps1 +++ b/arma3runhc.ps1 @@ -1,4 +1,4 @@ -# Arguments: [number_clients] [server_binding] [server_port] "" "" +# Arguments: [number_clients] [server_binding] [server_port] "" "" "" # Check if any headless clients are to be run # If none, immediately exit @@ -19,6 +19,11 @@ if (-not $serverStarted) { exit 1 } # Start the headless clients $clients = @() $basePort = [int]$args[2] + 498 +if ($args.Length -lt 6) { + $parfile = "" +} else { + $parfile = $args[6] +} cd "$PSScriptRoot\arma3\233780" for ($i = 1; $i -le [int]$args[0]; $i++) { if ($args[1] -eq "0.0.0.0") { @@ -26,7 +31,7 @@ for ($i = 1; $i -le [int]$args[0]; $i++) { } else { $connect = $args[1] } - $hcProcess = Start-Process -FilePath "ArmA3Server_x64.exe" -ArgumentList "-client", "-nosound", "-connect=${connect}:$($args[2])", "-port=$basePort", "-password=`"$($args[3])`"", "`"-mod=$($args[4])`"" -WindowStyle Hidden -PassThru + $hcProcess = Start-Process -FilePath "ArmA3Server_x64.exe" -ArgumentList "-client", "-nosound", "-profiles=A3Master", "-connect=${connect}:$($args[2])", "-port=$basePort", "-password=`"$($args[3])`"", "`"-mod=$($args[4])`"", "`"-par=$parfile`"" -WindowStyle Hidden -PassThru $clients += $hcProcess.Id } diff --git a/arma3runhc.sh b/arma3runhc.sh index 33d0ad4..de6cee4 100644 --- a/arma3runhc.sh +++ b/arma3runhc.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Arguments: [number_clients] [server_binding] [server_port] "" "" +# Arguments: [number_clients] [server_binding] [server_port] "" "" "" netcommand="$(command -v "ss" >/dev/null 2>&1 && echo "ss" || echo "netstat")" @@ -24,6 +24,7 @@ fi # Start the headless clients baseport=$(($3 + 498)) +parfile="${6:-}" export LD_LIBRARY_PATH=$(dirname "$0")/linux64:$LD_LIBRARY_PATH cd ./arma3/233780 for i in $(seq 1 "$1"); do @@ -32,7 +33,7 @@ for i in $(seq 1 "$1"); do else connect="$2" fi - ./arma3server_x64 -client -nosound -connect=$connect:$3 -port=$baseport -password="$4" "-mod=$5" >/dev/null 2>&1 & + ./arma3server_x64 -client -nosound -profiles=A3Master -connect=$connect:$3 -port=$baseport -password="$4" "-mod=$5" "-par=$parfile" >/dev/null 2>&1 & clients+=($!) done diff --git a/arma3updates.json b/arma3updates.json index aa718aa..af800f2 100644 --- a/arma3updates.json +++ b/arma3updates.json @@ -5,7 +5,80 @@ "UpdateSource":"SteamCMD", "UpdateSourceData":"233780", "UpdateSourceArgs":"107410", - "UpdateSourceVersion":"{{ServerBranch}}" + "UpdateSourceVersion":"public", + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"public" + }, + { + "UpdateStageName":"SteamCMD Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"233780", + "UpdateSourceArgs":"107410", + "UpdateSourceVersion":"profiling", + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"profiling" + }, + { + "UpdateStageName":"SteamCMD Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"233780", + "UpdateSourceArgs":"107410", + "UpdateSourceVersion":"creatordlc", + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"creatordlc" + }, + { + "UpdateStageName":"SteamCMD Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"233780", + "UpdateSourceArgs":"107410", + "UpdateSourceVersion":"contact", + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"contact" + }, + { + "UpdateStageName":"SteamCMD Creator DLC Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"233780", + "UpdateSourceArgs":"107410", + "UpdateSourceVersion":"creatordlc", + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"creatordlc-profiling" + }, + { + "UpdateStageName":"SteamCMD Performance Profiling Download", + "UpdateSourcePlatform":"All", + "UpdateSource":"SteamCMD", + "UpdateSourceData":"233780", + "UpdateSourceArgs":"107410", + "UpdateSourceTarget":".profiling", + "UpdateSourceVersion":"profiling", + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"creatordlc-profiling" + }, + { + "UpdateStageName":"Performance Profiling Binary Copy", + "UpdateSourcePlatform":"Linux", + "UpdateSource":"CopyFilePath", + "UpdateSourceData":"{{$FullBaseDir}}arma3server_x64", + "UpdateSourceArgs":"{{$FullRootDir}}.profiling/arma3server_x64", + "OverwriteExistingFiles":true, + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"creatordlc-profiling" + }, + { + "UpdateStageName":"Performance Profiling Binary Copy", + "UpdateSourcePlatform":"Windows", + "UpdateSource":"CopyFilePath", + "UpdateSourceData":"{{$FullBaseDir}}ArmA3Server_x64.exe", + "UpdateSourceArgs":"{{$FullRootDir}}.profiling/ArmA3Server_x64.exe", + "OverwriteExistingFiles":true, + "UpdateSourceConditionSetting":"ServerBranch", + "UpdateSourceConditionValue":"creatordlc-profiling" }, { "UpdateStageName":"Server Config Template Download", @@ -26,12 +99,19 @@ "OverwriteExistingFiles":false }, { - "UpdateStageName":"Create Parameters File", + "UpdateStageName":"Create Server Parameters File", "UpdateSourcePlatform":"All", "UpdateSource":"CreateFile", "UpdateSourceArgs":"{{$FullBaseDir}}parameters.txt", "OverwriteExistingFiles":false }, + { + "UpdateStageName":"Create Headless Client Parameters File", + "UpdateSourcePlatform":"All", + "UpdateSource":"CreateFile", + "UpdateSourceArgs":"{{$FullBaseDir}}hc_parameters.txt", + "OverwriteExistingFiles":false + }, { "UpdateStageName":"Modscript Download", "UpdateSourcePlatform":"Linux",