diff --git a/library/ix-dev/community/palworld/Chart.yaml b/library/ix-dev/community/palworld/Chart.yaml index e1d0c8c6e7..70bb405db3 100644 --- a/library/ix-dev/community/palworld/Chart.yaml +++ b/library/ix-dev/community/palworld/Chart.yaml @@ -3,7 +3,7 @@ description: Palworld is a multiplayer, open-world survival crafting game where annotations: title: Palworld type: application -version: 1.0.4 +version: 1.0.5 apiVersion: v2 appVersion: palworld kubeVersion: '>=1.16.0-0' diff --git a/library/ix-dev/community/palworld/questions.yaml b/library/ix-dev/community/palworld/questions.yaml index 749c36498b..db7d763a76 100644 --- a/library/ix-dev/community/palworld/questions.yaml +++ b/library/ix-dev/community/palworld/questions.yaml @@ -53,6 +53,17 @@ questions: type: string private: true default: "" + - variable: allowPlatform + label: Platform + description: Specify which platforms are allowed to connect + schema: + type: string + required: true + enum: + - value: "Steam" + description: Steam platform + - value: "Xbox" + description: Xbox platform - variable: iniKeys label: Configure INI Keys description: | diff --git a/library/ix-dev/community/palworld/templates/_palworld.tpl b/library/ix-dev/community/palworld/templates/_palworld.tpl index 2d85985c16..ade67e0f46 100644 --- a/library/ix-dev/community/palworld/templates/_palworld.tpl +++ b/library/ix-dev/community/palworld/templates/_palworld.tpl @@ -110,7 +110,16 @@ workload: fi echo "Setting ${key}..." - sed -i "s|\(${key}=\)[^,]*|\1${escaped_value}|g" "${cfgFile}" + + # Check if the key already exists + if grep -q "^OptionSettings=\(.*${key}=.*\)$" "${cfgFile}"; then + # Key exists, update its value using the original logic + sed -i "s|\(${key}=\)[^,]*|\1${escaped_value}|g" "${cfgFile}" + else + # Key doesn't exist, append it right after "OptionSettings=(" + sed -i "s|^\(OptionSettings=(\)|\1${key}=${escaped_value}, |" "${cfgFile}" + fi + if [ "$print" = true ]; then echo "Set to $(grep -Po "(?<=${key}=)[^,]*" "${cfgFile}")" fi @@ -123,6 +132,7 @@ workload: set_ini_value "ServerDescription" {{ .Values.palworldConfig.server.description | quote }} true set_ini_value "ServerPassword" {{ .Values.palworldConfig.server.password | squote }} true false set_ini_value "AdminPassword" {{ .Values.palworldConfig.adminPassword | squote }} true false + set_ini_value "AllowConnectPlatform" {{ .Values.palworldConfig.allowPlatform }} false {{- range $item := .Values.palworldConfig.iniKeys }} {{- $k := $item.key -}} diff --git a/library/ix-dev/community/palworld/templates/_params.tpl b/library/ix-dev/community/palworld/templates/_params.tpl index 85a4db9b63..6b6f5eef50 100644 --- a/library/ix-dev/community/palworld/templates/_params.tpl +++ b/library/ix-dev/community/palworld/templates/_params.tpl @@ -18,7 +18,7 @@ {{- $reservedKeys := list "RCONEnabled" "RCONPort" "PublicPort" "ServerName" - "ServerDescription" "ServerPassword" "AdminPassword" + "ServerDescription" "ServerPassword" "AdminPassword" "AllowConnectPlatform" -}} {{- range $item := .Values.palworldConfig.iniKeys }} diff --git a/library/ix-dev/community/palworld/values.yaml b/library/ix-dev/community/palworld/values.yaml index dcd9794f72..5ab2cd49b2 100644 --- a/library/ix-dev/community/palworld/values.yaml +++ b/library/ix-dev/community/palworld/values.yaml @@ -14,6 +14,7 @@ palworldConfig: name: TrueNAS Palworld Server description: Palworld Server running on TrueNAS password: '' + allowPlatform: Steam backup: enabled: false interval: 60