From 1fdb670e193eaaa6b69a470af47fda90072a6db3 Mon Sep 17 00:00:00 2001 From: Nabil Redmann Date: Wed, 26 Aug 2026 12:03:55 +0200 Subject: [PATCH 1/6] 7daystoDie: make the used config file dependant on the $Server.ConfigFolder (instead of ignoring it and using its own prop) --- templates/7daystodie.psm1 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/templates/7daystodie.psm1 b/templates/7daystodie.psm1 index a9e3f2a..ca5ec6d 100644 --- a/templates/7daystodie.psm1 +++ b/templates/7daystodie.psm1 @@ -14,9 +14,6 @@ $ServerDetails = @{ #Login username used by SteamCMD Login = "anonymous" - #Server Configuration - ConfigFile = "$Env:userprofile\AppData\Roaming\7DaysToDie\Saves\serverconfig.xml" - #Rcon IP, usually localhost ManagementIP = "127.0.0.1" @@ -176,7 +173,7 @@ $Warnings = New-Object -TypeName PsObject -Property $WarningsDetails #Launch Arguments $ArgumentList = @( "-logfile $($Server.LogFile) ", - "-configfile=$($Server.ConfigFile) ", + "-configfile=$($Server.ConfigFolder)\serverconfig.xml ", "-batchmode ", "-nographics ", "-dedicated ", @@ -196,12 +193,13 @@ function Start-ServerPrep { Write-ScriptMsg "Port Forward : 26900 in TCP and 26900 to 26903 in UDP to $($Global.InternalIP)" #Copy Config File if not created. Do not modify the one in the server directory, it will be overwriten on updates. - $ConfigFilePath = Split-Path -Path $Server.ConfigFile + $ConfigFile = "$($Server.ConfigFolder)\serverconfig.xml" + $ConfigFilePath = Split-Path -Path $ConfigFile if (-not (Test-Path -Path $ConfigFilePath -ErrorAction SilentlyContinue)) { New-Item -ItemType "directory" -Path $ConfigFilePath -Force -ErrorAction SilentlyContinue } - If (-not (Test-Path -Path $Server.ConfigFile -PathType "leaf" -ErrorAction SilentlyContinue)) { - Copy-Item -Path "$($Server.Path)\serverconfig.xml" -Destination $Server.ConfigFile -Force -ErrorAction SilentlyContinue + If (-not (Test-Path -Path $ConfigFile -PathType "leaf" -ErrorAction SilentlyContinue)) { + Copy-Item -Path "$($Server.Path)\serverconfig.xml" -Destination $ConfigFile -Force -ErrorAction SilentlyContinue } } From 16966c512c7ac1f486fb54164cb12c853f7c8ef2 Mon Sep 17 00:00:00 2001 From: Nabil Redmann Date: Wed, 26 Aug 2026 12:16:55 +0200 Subject: [PATCH 2/6] mordhau: clenaer $ServerDetails (removed config related custom paths to match other configs), make the used config file dependant on the $Server.ConfigFolder (instead of ignoring it and using its own prop) --- templates/mordhau.psm1 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/templates/mordhau.psm1 b/templates/mordhau.psm1 index 2dd9087..0a31515 100644 --- a/templates/mordhau.psm1 +++ b/templates/mordhau.psm1 @@ -26,12 +26,6 @@ $ServerDetails = @{ #Beacon Port Beaconport = 15000 - #Modified Game.ini - GameIni = ".\servers\Mordhau\Mordhau\Saved\Config\WindowsServer\Game2.ini" - - #Modified Engine.ini - EngineIni = ".\servers\Mordhau\Mordhau\Saved\Config\WindowsServer\Engine2.ini" - #Rcon IP ManagementIP = "127.0.0.1" @@ -186,8 +180,8 @@ $Warnings = New-Object -TypeName PsObject -Property $WarningsDetails #--------------------------------------------------------- #Address parsing and slash flipping -$Server.GameIni = (Resolve-CompletePath -Path $Server.GameIni -ParentPath ".\servers\") -replace '\\', '/' -$Server.EngineIni = (Resolve-CompletePath -Path $Server.EngineIni -ParentPath ".\servers\") -replace '\\', '/' +Add-Member -InputObject $Server -Name "GameIni" -Type NoteProperty -Value ((Resolve-CompletePath -Path "$($Server.ConfigFolder)\Game2.ini" -ParentPath ".\servers\") -replace '\\', '/') +Add-Member -InputObject $Server -Name "EngineIni" -Type NoteProperty -Value ((Resolve-CompletePath -Path "$($Server.ConfigFolder)\Engine2.ini" -ParentPath ".\servers\") -replace '\\', '/') #Launch Arguments $ArgumentList = @( From 89cf3ec1f1851100548943d6c0fc2829edce4857 Mon Sep 17 00:00:00 2001 From: Nabil Redmann Date: Wed, 26 Aug 2026 12:23:15 +0200 Subject: [PATCH 3/6] 7daystodie: changed to use Add-Member and add the ConfigFile as its own prop, allowed to revert usge back to how it was before while transporting the ConfigFileProp in $Server through Export-ModuleMember --- templates/7daystodie.psm1 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/templates/7daystodie.psm1 b/templates/7daystodie.psm1 index ca5ec6d..e1fee90 100644 --- a/templates/7daystodie.psm1 +++ b/templates/7daystodie.psm1 @@ -170,10 +170,13 @@ $Warnings = New-Object -TypeName PsObject -Property $WarningsDetails # Launch Arguments #--------------------------------------------------------- +#Dynamic property +Add-Member -InputObject $Server -Name "ConfigFile" -Type NoteProperty -Value "$($Server.ConfigFolder)\serverconfig.xml" + #Launch Arguments $ArgumentList = @( "-logfile $($Server.LogFile) ", - "-configfile=$($Server.ConfigFolder)\serverconfig.xml ", + "-configfile=$($Server.ConfigFile) ", "-batchmode ", "-nographics ", "-dedicated ", @@ -193,13 +196,12 @@ function Start-ServerPrep { Write-ScriptMsg "Port Forward : 26900 in TCP and 26900 to 26903 in UDP to $($Global.InternalIP)" #Copy Config File if not created. Do not modify the one in the server directory, it will be overwriten on updates. - $ConfigFile = "$($Server.ConfigFolder)\serverconfig.xml" - $ConfigFilePath = Split-Path -Path $ConfigFile + $ConfigFilePath = Split-Path -Path $Server.ConfigFile if (-not (Test-Path -Path $ConfigFilePath -ErrorAction SilentlyContinue)) { New-Item -ItemType "directory" -Path $ConfigFilePath -Force -ErrorAction SilentlyContinue } - If (-not (Test-Path -Path $ConfigFile -PathType "leaf" -ErrorAction SilentlyContinue)) { - Copy-Item -Path "$($Server.Path)\serverconfig.xml" -Destination $ConfigFile -Force -ErrorAction SilentlyContinue + If (-not (Test-Path -Path $Server.ConfigFile -PathType "leaf" -ErrorAction SilentlyContinue)) { + Copy-Item -Path "$($Server.Path)\serverconfig.xml" -Destination $Server.ConfigFile -Force -ErrorAction SilentlyContinue } } From 56fc51c8481fb2c2b09ed59548e39725fbe18553 Mon Sep 17 00:00:00 2001 From: Nabil Redmann Date: Wed, 26 Aug 2026 12:34:12 +0200 Subject: [PATCH 4/6] left4dead2: clenaer $ServerDetails (removed config related custom paths to match other configs), make the used config file dependant on the $Server.ConfigFolder (instead of ignoring it and being hardcoded) --- templates/left4dead2.psm1 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/templates/left4dead2.psm1 b/templates/left4dead2.psm1 index 85bb408..d2fdcaf 100644 --- a/templates/left4dead2.psm1 +++ b/templates/left4dead2.psm1 @@ -32,9 +32,6 @@ $ServerDetails = @{ #Map Map = "c1m1_hotel" - #Configuration File - ConfigFile = "server.cfg" - #Rcon IP ManagementIP = "127.0.0.1" @@ -188,6 +185,9 @@ $Warnings = New-Object -TypeName PsObject -Property $WarningsDetails # Launch Arguments #--------------------------------------------------------- +#Dynamic property +Add-Member -InputObject $Server -Name "ConfigFile" -Type NoteProperty -Value "server.cfg" + #Launch Arguments $ArgumentList = @( "-console ", @@ -250,11 +250,10 @@ $FileContent = ($FileContentList -join "`n") function Start-ServerPrep { - #Copy Config File if not created. Do not modify the one in the server directory, it will be overwriten on updates. - if (-not (Test-Path -Path ".\servers\$($Server.Name)\left4dead2\cfg\$($Server.ConfigFile)" -ErrorAction SilentlyContinue)) { + if (-not (Test-Path -Path "$($Server.ConfigFolder)\$($Server.ConfigFile)" -ErrorAction SilentlyContinue)) { Write-Host "Creating Config File" - New-Item -Path ".\servers\$($Server.Name)\left4dead2\cfg\" -Name "$($Server.ConfigFile)" -ItemType "file" -Value $FileContent + New-Item -Path $Server.ConfigFolder -Name "$($Server.ConfigFile)" -ItemType "file" -Value $FileContent } Write-ScriptMsg "Port Forward : $($Server.Port) in TCP and UDP to $($Global.InternalIP)" From f3136e477dc384b60bfb6a3ae553aa7fdf844217 Mon Sep 17 00:00:00 2001 From: Nabil Redmann Date: Wed, 26 Aug 2026 12:42:48 +0200 Subject: [PATCH 5/6] paperclip: clenaer $ServerDetails (removed config related custom paths to match other configs), make the used config file dependant on the $Server.ConfigFolder (instead of ignoring it and being hardcoded) --- templates/paperclip.psm1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/paperclip.psm1 b/templates/paperclip.psm1 index a5fb634..d9bc788 100644 --- a/templates/paperclip.psm1 +++ b/templates/paperclip.psm1 @@ -196,6 +196,9 @@ $Warnings = New-Object -TypeName PsObject -Property $WarningsDetails # Launch Arguments #--------------------------------------------------------- +#Dynamic property +Add-Member -InputObject $Server -Name "ConfigFile" -Type NoteProperty -Value "server.properties" + #Launch Arguments $ArgumentList = @( "-Xms$($Server.Ram)G ", @@ -236,9 +239,9 @@ $FileContent = ($FileContentList -join "`n") function Start-ServerPrep { #Create Config File if not created. - if (-not (Test-Path -Path ".\servers\$($Server.Name)\server.properties" -ErrorAction SilentlyContinue)) { + if (-not (Test-Path -Path "$($Server.ConfigFolder)\$($Server.ConfigFile)" -ErrorAction SilentlyContinue)) { Write-Host "Creating Config File" - New-Item -Path ".\servers\$($Server.Name)\" -Name "server.properties" -ItemType "file" -Value $FileContent + New-Item -Path "$($Server.ConfigFolder)\" -Name $Server.ConfigFile -ItemType "file" -Value $FileContent } #Create eula File if not created. if (-not (Test-Path -Path ".\servers\$($Server.Name)\eula.txt" -ErrorAction SilentlyContinue)) { From 273c7cfa995b51302bfb4b838a44e642191df289 Mon Sep 17 00:00:00 2001 From: Nabil Redmann Date: Wed, 26 Aug 2026 12:54:32 +0200 Subject: [PATCH 6/6] terraria: clenaer $ServerDetails (removed config related custom paths to match other configs), make the used config file dependant on the $Server.ConfigFolder (instead of ignoring it and using its own prop and ignoring it on copy) --- templates/terraria.psm1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/terraria.psm1 b/templates/terraria.psm1 index 6392664..7eefb5e 100644 --- a/templates/terraria.psm1 +++ b/templates/terraria.psm1 @@ -14,9 +14,6 @@ $ServerDetails = @{ #Login username used by SteamCMD Login = "anonymous" - # Specifies the configuration file to use *(relative the the game) - ConfigFile = "serverconfig.txt" - # Specifies the port to listen on. Port = 7777 @@ -185,6 +182,10 @@ $Warnings = New-Object -TypeName PsObject -Property $WarningsDetails # Launch Arguments #--------------------------------------------------------- +#Dynamic property +# Specifies the configuration file to use *(relative the the game exe, or absolute path) +Add-Member -InputObject $Server -Name "ConfigFile" -Type NoteProperty -Value (Resolve-CompletePath -Path "$($Server.ConfigFolder)\serverconfig.txt" -ParentPath ".\servers\") + #Launch Arguments $ArgumentList = @( "-config `"$($Server.ConfigFile)`" ", @@ -227,7 +228,7 @@ function Start-ServerPrep { Copy-Item -Path ".\downloads\terraria\$($Server.Version)\Windows\TerrariaServer.exe" -Destination $Server.Path -Force Copy-Item -Path ".\downloads\terraria\$($Server.Version)\Windows\ReLogic.Native.dll" -Destination $Server.Path -Force if (-not (Test-Path -Path $Server.ConfigFile -PathType "leaf" -ErrorAction SilentlyContinue)) { - Copy-Item -Path ".\downloads\terraria\$($Server.Version)\Windows\serverconfig.txt" -Destination $Server.Path + Copy-Item -Path ".\downloads\terraria\$($Server.Version)\Windows\serverconfig.txt" -Destination $Server.ConfigFile } #Cleanup Remove-Item -Path ".\downloads" -Recurse -Force -ErrorAction SilentlyContinue