From 195e2911f1d5a31ba5f5e2341a2671f5183a3075 Mon Sep 17 00:00:00 2001 From: Greelan <53196309+Greelan@users.noreply.github.com> Date: Thu, 2 Nov 2023 21:06:02 +1100 Subject: [PATCH] DayZ bikey settings --- dayz-experimental.kvp | 2 +- dayz-experimentalconfig.json | 16 ++++++++++++++++ dayz-experimentalstart.json | 34 ++++++++++++++++++++++++++++++++++ dayz-original.kvp | 2 +- dayz-originalconfig.json | 16 ++++++++++++++++ dayz-originalstart.json | 27 +++++++++++++++++++++++++++ 6 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 dayz-experimentalstart.json create mode 100644 dayz-originalstart.json diff --git a/dayz-experimental.kvp b/dayz-experimental.kvp index bdba629..78eab9f 100644 --- a/dayz-experimental.kvp +++ b/dayz-experimental.kvp @@ -60,7 +60,7 @@ App.RCONHeartbeatMinutes=0.5 App.RCONHeartbeatCommand=ping App.TelnetLoginFormat={0} App.UpdateSources=@IncludeJson[dayz-experimentalupdates.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"}] +App.PreStartStages=@IncludeJson[dayz-experimentalstart.json] App.Compatibility=None App.SteamUpdateAnonymousLogin=False App.SteamForceLoginPrompt=True diff --git a/dayz-experimentalconfig.json b/dayz-experimentalconfig.json index 8de3f34..fe43331 100644 --- a/dayz-experimentalconfig.json +++ b/dayz-experimentalconfig.json @@ -246,6 +246,22 @@ "DefaultValue":"", "EnumValues":{} }, + { + "DisplayName":"Manage Bikeys", + "Category":"Dayz 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 addon signature verification. All existing bikeys in that directory (other than the default 'dayz.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":"DayZ Server Settings", diff --git a/dayz-experimentalstart.json b/dayz-experimentalstart.json new file mode 100644 index 0000000..48fbf6d --- /dev/null +++ b/dayz-experimentalstart.json @@ -0,0 +1,34 @@ +[ + { + "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 dayz/1042420; find keys/ -name \"*.bikey\" ! -name \"dayz.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 dayz\\1042420; Get-ChildItem -Path 'keys' -Filter '*.bikey' | ForEach-Object { if ($_.Name -ne 'dayz.bikey' -and -not ($_.Name -like '*dayz.bikey*')) { Remove-Item -LiteralPath $_.FullName -Force } }; foreach ($a in $mod) { Get-ChildItem -Path ('{0}\\keys' -f $a) -Filter '*.bikey' | Copy-Item -Destination 'keys' -Force }\"", + "UpdateSourceConditionSetting":"ManageBikeys", + "UpdateSourceConditionValue":"true" + } +] \ No newline at end of file diff --git a/dayz-original.kvp b/dayz-original.kvp index 63c42b2..72d6a57 100644 --- a/dayz-original.kvp +++ b/dayz-original.kvp @@ -59,7 +59,7 @@ App.RCONHeartbeatMinutes=0.5 App.RCONHeartbeatCommand=ping App.TelnetLoginFormat={0} App.UpdateSources=@IncludeJson[dayz-originalupdates.json] -App.PreStartStages=[{"UpdateStageName":"Delete Active File","UpdateSourcePlatform":"Windows","UpdateSource":"Executable","UpdateSourceData":"cmd.exe","UpdateSourceArgs":"/C del /Q /F {{$FullBaseDir}}battleye\\beserver_x64_active_*.cfg"}] +App.PreStartStages=@IncludeJson[dayz-originalstart.json] App.Compatibility=None App.SteamUpdateAnonymousLogin=False App.SteamForceLoginPrompt=True diff --git a/dayz-originalconfig.json b/dayz-originalconfig.json index 6e21f94..4d3d5d5 100644 --- a/dayz-originalconfig.json +++ b/dayz-originalconfig.json @@ -246,6 +246,22 @@ "DefaultValue":"", "EnumValues":{} }, + { + "DisplayName":"Manage Bikeys", + "Category":"Dayz 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 addon signature verification. All existing bikeys in that directory (other than the default 'dayz.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":"DayZ Server Settings", diff --git a/dayz-originalstart.json b/dayz-originalstart.json new file mode 100644 index 0000000..553d1c0 --- /dev/null +++ b/dayz-originalstart.json @@ -0,0 +1,27 @@ +[ + { + "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 dayz/223350; find keys/ -name \"*.bikey\" ! -name \"dayz.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 dayz\\223350; Get-ChildItem -Path 'keys' -Filter '*.bikey' | ForEach-Object { if ($_.Name -ne 'dayz.bikey' -and -not ($_.Name -like '*dayz.bikey*')) { Remove-Item -LiteralPath $_.FullName -Force } }; foreach ($a in $mod) { Get-ChildItem -Path ('{0}\\keys' -f $a) -Filter '*.bikey' | Copy-Item -Destination 'keys' -Force }\"", + "UpdateSourceConditionSetting":"ManageBikeys", + "UpdateSourceConditionValue":"true" + } +] \ No newline at end of file