Skip to content
6 changes: 3 additions & 3 deletions templates/7daystodie.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -173,6 +170,9 @@ $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) ",
Expand Down
11 changes: 5 additions & 6 deletions templates/left4dead2.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ $ServerDetails = @{
#Map
Map = "c1m1_hotel"

#Configuration File
ConfigFile = "server.cfg"

#Rcon IP
ManagementIP = "127.0.0.1"

Expand Down Expand Up @@ -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 ",
Expand Down Expand Up @@ -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)"
Expand Down
10 changes: 2 additions & 8 deletions templates/mordhau.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 = @(
Expand Down
7 changes: 5 additions & 2 deletions templates/paperclip.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 ",
Expand Down Expand Up @@ -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)) {
Expand Down
9 changes: 5 additions & 4 deletions templates/terraria.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)`" ",
Expand Down Expand Up @@ -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
Expand Down