Fix.
This commit is contained in:
@@ -107,7 +107,6 @@ $date = Get-Date
|
|||||||
|
|
||||||
$date2 = Get-Date -Format 's' | ForEach-Object { $_ -replace 'T', ' ' }
|
$date2 = Get-Date -Format 's' | ForEach-Object { $_ -replace 'T', ' ' }
|
||||||
Write-Host "$($date2) Starting $($myName) $($myVersion) script"
|
Write-Host "$($date2) Starting $($myName) $($myVersion) script"
|
||||||
Write-Host "Init = $($init), Update = $($update), noDelete = $($noDelete)"
|
|
||||||
|
|
||||||
$ini = $config = $servers = $clientMods = $serverMods = $steamProcess = $null
|
$ini = $config = $servers = $clientMods = $serverMods = $steamProcess = $null
|
||||||
$modNI = $modNS = $namalskMission = $pathNamalskMission = $null
|
$modNI = $modNS = $namalskMission = $pathNamalskMission = $null
|
||||||
@@ -148,10 +147,6 @@ foreach ($mod in $ini.ServerMods.GetEnumerator()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Update {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($updatePeriod) {
|
switch ($updatePeriod) {
|
||||||
D { if ($currentHour -eq $updateHour) { $update = $true } }
|
D { if ($currentHour -eq $updateHour) { $update = $true } }
|
||||||
W { if (($currentDayOfWeek -eq $updateDay) -and ($currentHour -eq $updateHour)) { $update = $true } }
|
W { if (($currentDayOfWeek -eq $updateDay) -and ($currentHour -eq $updateHour)) { $update = $true } }
|
||||||
@@ -159,6 +154,8 @@ switch ($updatePeriod) {
|
|||||||
default { $update = $false }
|
default { $update = $false }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "Init = $($init), Update = $($update), noDelete = $($noDelete)"
|
||||||
|
|
||||||
if ($update) {
|
if ($update) {
|
||||||
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
|
||||||
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
|
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
|
||||||
@@ -370,7 +367,7 @@ foreach ($srv in $servers) {
|
|||||||
Write-Host "Creating new file: `"$($serverProfile)\BattlEye\BEServer_x64.cfg`""
|
Write-Host "Creating new file: `"$($serverProfile)\BattlEye\BEServer_x64.cfg`""
|
||||||
New-Item -ItemType File -Path "$($serverProfile)\BattlEye\BEServer_x64.cfg" | Out-Null
|
New-Item -ItemType File -Path "$($serverProfile)\BattlEye\BEServer_x64.cfg" | Out-Null
|
||||||
if (!$?) { Exit }
|
if (!$?) { Exit }
|
||||||
[int]$rconPort = [int]$serverPort + 3
|
[int]$rconPort = [int]$serverPort + 5
|
||||||
$content = "RConPassword ChangeMe123`r`nRConPort $($rconPort)`r`nRestrictRCon 0"
|
$content = "RConPassword ChangeMe123`r`nRConPort $($rconPort)`r`nRestrictRCon 0"
|
||||||
Add-Content -Path "$($serverProfile)\BattlEye\BEServer_x64.cfg" -Value $content -Encoding ASCII
|
Add-Content -Path "$($serverProfile)\BattlEye\BEServer_x64.cfg" -Value $content -Encoding ASCII
|
||||||
$content = $null
|
$content = $null
|
||||||
|
|||||||
Reference in New Issue
Block a user