Added check for profiles location.

This commit is contained in:
2024-11-29 22:23:21 +03:00
parent 1f731756fd
commit 71604d9b0b
2 changed files with 73 additions and 59 deletions

View File

@@ -253,8 +253,6 @@ if ($becLocation) {
$becProcess = [Object[]]::new($servers.Count)
}
EXIT
foreach ($srv in $servers) {
$instance = ${srv}
$serverPort = $ini.${srv}.serverPort
@@ -283,7 +281,16 @@ foreach ($srv in $servers) {
}
}
$serverProfile = "$($serverLocation)\profiles\$($instance)"
# Checks for profile location
if ([System.IO.Path]::IsPathRooted($profilesLocation)) {
$serverProfile = "$($profilesLocation)\$($instance)"
}
else {
$serverProfile = "$($serverLocation)\$($profilesLocation)\$($instance)"
}
$serverProfile = [System.IO.Path]::GetFullPath($serverProfile)
Write-Host "serverProfile: $($serverProfile)"
$startupMods = @("`"-mod=$($startupClientMods)`"", "`"-serverMod=$($startupServerMods)`"")
$startupParams = @("`"-profiles=$($serverProfile)`"", "`"-config=$($serverProfile)\$($serverConfig)`"", "-port=$($serverPort)", "-cpuCount=$($serverCPU)")
$dayzArguments = $startupParams + $startupMods + $additionalParams
@@ -431,6 +438,14 @@ foreach ($srv in $servers) {
Write-Host
}
#endregion
#region ### wDayzManager ###
#endregion
#region ### Dayz stats logs ###
#endregion
}
# Write-Host " instance: $($instance)"