From d6adb0aa3d486c1b138d3dad8a18d1f247867ab8 Mon Sep 17 00:00:00 2001 From: Aeneas1 Date: Sat, 1 Jun 2024 19:07:33 +0200 Subject: [PATCH 1/4] add Soulmask template not sure if everything works fine --- templates/soulmask.psm1 | 237 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 templates/soulmask.psm1 diff --git a/templates/soulmask.psm1 b/templates/soulmask.psm1 new file mode 100644 index 0000000..04af8eb --- /dev/null +++ b/templates/soulmask.psm1 @@ -0,0 +1,237 @@ +#Server Name, Always Match the Launcher and config file name. +$Name = $ServerCfg + +#--------------------------------------------------------- +# Server Configuration +#--------------------------------------------------------- + +$ServerDetails = @{ + + #Login username used by SteamCMD + Login = "anonymous" + + #Name of the server in the Server Browser + SessionName = "Soulmask" + + #Maximum Number of Players + MaxPlayers = 20 + + #Password to join the server *NO SPACES* + Password = "" + + #Admin Password to manage your Server *NO SPACES* + AdminPassword = "" + + #Server Port + Port = 7777 + + #Query Port + QueryPort = 27015 + + #Enable PVE "True" or "False" + ServerPVE = "True" + + #Turns on game console output. "True" or "False" + ServerLog = "True" + + #Specifies the interval for writing game objects to the database (unit: seconds). + ServerSaving = 600 + + #Specifies the interval for writing the game database to disk (unit: seconds). + ServerBackup = 900 + + #Specifies how often (minutes) to automatically back up the world save. + BackupInterval = 10 + + #Specifies the local listening address. Use 0.0.0.0 or the local network card address. + MultihomeIP = "0.0.0.0" + + #Maintenance port, used for local telnet server maintenance, TCP, does not need to be open. + ManagementPort = 18888 + + #Backs up game saves when the game starts. "True" or "False" + InitBackup = "True" + + #--------------------------------------------------------- + # Server Installation Details + #--------------------------------------------------------- + + #Name of the Server Instance + Name = $Name + + #Server Installation Path + Path = ".\servers\$Name" + + #Server configuration folder + ConfigFolder = ".\servers\$Name\WS\Saved\Config\WindowsServer" + + #Steam Server App Id + AppID = 3017310 + + #Name of the Beta Build + BetaBuild = "" + + #Beta Build Password + BetaBuildPassword = "" + + #Set to $true if you want this server to automatically update. + AutoUpdates = $true + + #Set to $true if you want this server to automatically restart on crash. + AutoRestartOnCrash = $true + + #Set to $true if you want this server to automatically restart at set hour. + AutoRestart = $true + + #The time at which the server will restart daily. + #(Hour, Minute, Seconds) + AutoRestartTime = @(4, 0, 0) + + #Process name in the task manager + ProcessName = "WSServer-Win64-Shipping" + + #Use PID instead of Process Name. + UsePID = $true + + #Server Executable + Exec = ".\servers\$Name\WSServer.exe" + + #Allow force close, usefull for server without RCON and Multiple instances. + AllowForceClose = $true + + #Process Priority Realtime, High, AboveNormal, Normal, BelowNormal, Low + UsePriority = $true + AppPriority = "High" + + <# + Process Affinity (Core Assignation) + Core 1 = > 00000001 = > 1 + Core 2 = > 00000010 = > 2 + Core 3 = > 00000100 = > 4 + Core 4 = > 00001000 = > 8 + Core 5 = > 00010000 = > 16 + Core 6 = > 00100000 = > 32 + Core 7 = > 01000000 = > 64 + Core 8 = > 10000000 = > 128 + ---------------------------- + 8 Cores = > 11111111 = > 255 + 4 Cores = > 00001111 = > 15 + 2 Cores = > 00000011 = > 3 + #> + + UseAffinity = $false + AppAffinity = 15 + + #Should the server validate install after installation or update *(recommended) + Validate = $true + + #How long should it wait to check if the server is stable + StartupWaitTime = 10 +} +#Create the object +$Server = New-Object -TypeName PsObject -Property $ServerDetails + +#--------------------------------------------------------- +# Backups +#--------------------------------------------------------- + +$BackupsDetails = @{ + #Do Backups + Use = $true + + #Backup Folder + Path = ".\Backup\$($Server.Name)" + + #Number of days of backups to keep. + Days = 7 + + #Number of weeks of weekly backups to keep. + Weeks = 16 + + #Folder to include in backup + Saves = ".\servers\$($Server.Name)\WS\Saved\Worlds\Dedicated\Level01_Main" +} +#Create the object +$Backups = New-Object -TypeName PsObject -Property $BackupsDetails + +#--------------------------------------------------------- +# Restart Warnings (Require RCON, Telnet or WebSocket API) +#--------------------------------------------------------- + +$WarningsDetails = @{ + #Use Rcon to restart server softly. + Use = $true + + #What protocol to use : Rcon, Telnet, Websocket + Protocol = "Telnet" + + #Times at which the servers will warn the players that it is about to restart. (in seconds between each timers) + Timers = [System.Collections.ArrayList]@(240, 50, 10) #Total wait time is 240+50+10 = 300 seconds or 5 minutes + + #message that will be sent. % is a wildcard for the timer. + MessageMin = "The server will restart in % minutes !" + + #message that will be sent. % is a wildcard for the timer. + MessageSec = "The server will restart in % seconds !" + + #command to send a message. + CmdMessage = "" + + #command to save the server + CmdSave = "" + + #How long to wait in seconds after the save command is sent. + SaveDelay = 15 + + #command to stop the server + CmdStop = "" +} +#Create the object +$Warnings = New-Object -TypeName PsObject -Property $WarningsDetails + +#--------------------------------------------------------- +# Launch Arguments +#--------------------------------------------------------- + +#Launch Arguments +$ArgumentList = @( + "Level01_Main ", + "-server ", + "-UTF8Output ", + "-SteamServerName=`"$($Server.SessionName)`" ", + "-PSW=`"$($Server.Password)`" ", + "-adminpsw=`"$($Server.AdminPassword)`" ", + "-MaxPlayers=$($Server.MaxPlayers) ", + "-backup=$($Server.ServerBackup) ", + "-saving=$($Server.ServerSaving) ", + "-MULTIHOME=`"$($Server.MultihomeIP)`" ", + "-Port=$($Server.Port) ", + "-QueryPort=$($Server.QueryPort) ", + "-EchoPort=$($Server.ManagementPort) ", + "-backupinterval=$($Server.BackupInterval) ", + "-forcepassthrough " +) + +if ($Server.ServerLog -eq "True") { + $ArgumentList += "-log " +} + +if ($Server.InitBackup -eq "True") { + $ArgumentList += "-initbackup " +} + +Add-Member -InputObject $Server -Name "ArgumentList" -Type NoteProperty -Value $ArgumentList +Add-Member -InputObject $Server -Name "Launcher" -Type NoteProperty -Value "$($Server.Exec)" +Add-Member -InputObject $Server -Name "WorkingDirectory" -Type NoteProperty -Value "$($Server.Path)" + +#--------------------------------------------------------- +# Function that runs just before the server starts. +#--------------------------------------------------------- + +function Start-ServerPrep { + + Write-ScriptMsg "Port Forward : $($Server.Port), $($Server.Port+1) and $($Server.QueryPort) in TCP & UDP to $($Global.InternalIP)" + +} + +Export-ModuleMember -Function Start-ServerPrep -Variable @("Server", "Backups", "Warnings") From 2ff1a88212db291eb01e80485a3ee1b310d88940 Mon Sep 17 00:00:00 2001 From: Aeneas1 Date: Sat, 1 Jun 2024 19:09:53 +0200 Subject: [PATCH 2/4] Update soulmask.psm1 --- templates/soulmask.psm1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/soulmask.psm1 b/templates/soulmask.psm1 index 04af8eb..595020a 100644 --- a/templates/soulmask.psm1 +++ b/templates/soulmask.psm1 @@ -35,13 +35,13 @@ $ServerDetails = @{ ServerLog = "True" #Specifies the interval for writing game objects to the database (unit: seconds). - ServerSaving = 600 + ServerSaving = 600 #Specifies the interval for writing the game database to disk (unit: seconds). - ServerBackup = 900 + ServerBackup = 900 #Specifies how often (minutes) to automatically back up the world save. - BackupInterval = 10 + BackupInterval = 10 #Specifies the local listening address. Use 0.0.0.0 or the local network card address. MultihomeIP = "0.0.0.0" @@ -50,7 +50,7 @@ $ServerDetails = @{ ManagementPort = 18888 #Backs up game saves when the game starts. "True" or "False" - InitBackup = "True" + InitBackup = "True" #--------------------------------------------------------- # Server Installation Details From 1ed2d998c1d7c3007b41b2b330011916db7212f9 Mon Sep 17 00:00:00 2001 From: Aeneas1 Date: Sat, 1 Jun 2024 19:12:38 +0200 Subject: [PATCH 3/4] Update soulmask.psm1 --- templates/soulmask.psm1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/soulmask.psm1 b/templates/soulmask.psm1 index 595020a..a9db0f6 100644 --- a/templates/soulmask.psm1 +++ b/templates/soulmask.psm1 @@ -35,13 +35,13 @@ $ServerDetails = @{ ServerLog = "True" #Specifies the interval for writing game objects to the database (unit: seconds). - ServerSaving = 600 + ServerSaving = 600 #Specifies the interval for writing the game database to disk (unit: seconds). - ServerBackup = 900 + ServerBackup = 900 #Specifies how often (minutes) to automatically back up the world save. - BackupInterval = 10 + BackupInterval = 10 #Specifies the local listening address. Use 0.0.0.0 or the local network card address. MultihomeIP = "0.0.0.0" @@ -50,7 +50,7 @@ $ServerDetails = @{ ManagementPort = 18888 #Backs up game saves when the game starts. "True" or "False" - InitBackup = "True" + InitBackup = "True" #--------------------------------------------------------- # Server Installation Details From f5f18e0c0ad96ba236cf72e2e153508231124d78 Mon Sep 17 00:00:00 2001 From: Patrick Veilleux Date: Mon, 10 Jun 2024 11:02:57 -0400 Subject: [PATCH 4/4] Disable telnet Fix Formating Change default values --- templates/soulmask.psm1 | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/templates/soulmask.psm1 b/templates/soulmask.psm1 index a9db0f6..f78af20 100644 --- a/templates/soulmask.psm1 +++ b/templates/soulmask.psm1 @@ -8,49 +8,49 @@ $Name = $ServerCfg $ServerDetails = @{ #Login username used by SteamCMD - Login = "anonymous" + Login = "anonymous" #Name of the server in the Server Browser - SessionName = "Soulmask" + SessionName = "Soulmask" #Maximum Number of Players - MaxPlayers = 20 + MaxPlayers = 20 #Password to join the server *NO SPACES* - Password = "" - + Password = "" + #Admin Password to manage your Server *NO SPACES* - AdminPassword = "" + AdminPassword = "" #Server Port - Port = 7777 + Port = 7777 #Query Port - QueryPort = 27015 + QueryPort = 27015 #Enable PVE "True" or "False" - ServerPVE = "True" - + ServerPVE = "True" + #Turns on game console output. "True" or "False" - ServerLog = "True" - + ServerLog = "True" + #Specifies the interval for writing game objects to the database (unit: seconds). - ServerSaving = 600 - + ServerSaving = 600 + #Specifies the interval for writing the game database to disk (unit: seconds). - ServerBackup = 900 - + ServerBackup = 900 + #Specifies how often (minutes) to automatically back up the world save. - BackupInterval = 10 - + BackupInterval = 10 + #Specifies the local listening address. Use 0.0.0.0 or the local network card address. - MultihomeIP = "0.0.0.0" - + MultihomeIP = "0.0.0.0" + #Maintenance port, used for local telnet server maintenance, TCP, does not need to be open. - ManagementPort = 18888 - + ManagementPort = 18888 + #Backs up game saves when the game starts. "True" or "False" - InitBackup = "True" + InitBackup = "True" #--------------------------------------------------------- # Server Installation Details @@ -146,7 +146,7 @@ $BackupsDetails = @{ Days = 7 #Number of weeks of weekly backups to keep. - Weeks = 16 + Weeks = 4 #Folder to include in backup Saves = ".\servers\$($Server.Name)\WS\Saved\Worlds\Dedicated\Level01_Main" @@ -160,7 +160,7 @@ $Backups = New-Object -TypeName PsObject -Property $BackupsDetails $WarningsDetails = @{ #Use Rcon to restart server softly. - Use = $true + Use = $false #What protocol to use : Rcon, Telnet, Websocket Protocol = "Telnet"