Moved Namalsk patching.

Namalsk server mods patching moved to update scope.
This commit is contained in:
Vladislav Salikov
2024-11-19 22:05:52 +03:00
parent a8a061464f
commit 206599127c
4 changed files with 114 additions and 77 deletions

View File

@@ -1,6 +1,19 @@
@echo off @echo off
set scriptPath=%~dp0 set scriptPath=%~dp0
set customPath=D:\DayZ\Server\.customs set customPath=Z:\Servers\dayzserver\.customs
set d=%DATE%
set t=%TIME:~0,8%
set t=%t: =0%
set t=%t::=-%
set day=%d:~0,2%
set month=%d:~3,2%
set year=%d:~6%
set filename=wDayzManager_%year%-%month%-%day%_%t%.log
::: Kill ghost instances
taskkill /im DayZServer_x64.exe /F >nul 2>&1
timeout 3 /nobreak >nul
cd /d %scriptPath% cd /d %scriptPath%
pushd %scriptPath% pushd %scriptPath%
@@ -12,11 +25,6 @@ if "%1" equ "-U" set update=1
if "%1" equ "-u" set update=1 if "%1" equ "-u" set update=1
if "%1" equ "--update" set update=1 if "%1" equ "--update" set update=1
powershell -ExecutionPolicy RemoteSigned -File wDayzManager.ps1 %update% powershell -ExecutionPolicy RemoteSigned -File wDayzManager.ps1 %update% > %filename%
@REM powershell -ExecutionPolicy RemoteSigned -File wDayzManager.ps1 %update% > wDayzManager.log
@REM echo Customization...
@REM cd /d %customPath%
@REM copy /Y messages.xml d:\dayz\server\mpmissions\hardcore.namalsk\db
popd popd

View File

@@ -1,14 +1,13 @@
; wDayzManager.ini ; wDayzManager.ini
[Config] [Config]
serverLocation=D:\DayZ\Server serverLocation=Z:\Servers\dayzserver
steamCMD=D:\DayZ\SteamCMD steamCMD=Z:\SteamCMD
; steamCMD=V:\SteamCMD
steamUser=w0lf_2k steamUser=w0lf_2k
appidGame=221100 appidGame=221100
appidServer=223350 appidServer=223350
rotateLogs=0 rotateLogs=1
daysAmount=3 daysAmount=7
rotatedLogsFolderName=RotatedLogs rotatedLogsFolderName=RotatedLogs
; rotatedLogsFolderName= ; rotatedLogsFolderName=
becFolderName=BEC becFolderName=BEC
@@ -38,18 +37,58 @@ updateHour=4
[ServerMods] [ServerMods]
@SurvivorMissions=1988925918 @SurvivorMissions=1988925918
[Server-5] [Server-1]
serverPort=35500 serverPort=35100
serverConfig=serverDZ.cfg serverConfig=serverDZ.cfg
serverExeName=DayZServer_x64.exe serverExeName=DayZServer_x64.exe
serverCPU=4 serverCPU=2
; startupClientMods=@CF;@COT startupClientMods=@CF;@VPPadminTools
startupClientMods=@CF;@VPPAdminTools;@Namalsk_Island;@Namalsk_Survival
startupServerMods= startupServerMods=
additionalParams= -name=Server -filePatching additionalParams= -name=Server -adminLog
namalskMission=Hardcore namalskMission=
; [Server 6] [Server-2]
serverPort=35200
serverConfig=serverDZ.cfg
serverExeName=DayZServer_x64.exe
serverCPU=2
startupClientMods=@CF;@VPPadminTools
startupServerMods=
additionalParams= -name=Server -adminLog
namalskMission=
[Server-3]
serverPort=35300
serverConfig=serverDZ.cfg
serverExeName=DayZServer_x64.exe
serverCPU=2
startupClientMods=@CF;@VPPadminTools;@Namalsk_Island;@Namalsk_Survival
startupServerMods=
additionalParams= -name=Server -adminLog
namalskMission=Regular
[Server-4]
serverPort=35400
serverConfig=serverDZ.cfg
serverExeName=DayZServer_x64.exe
serverCPU=2
startupClientMods=@CF;@VPPadminTools
startupServerMods=
additionalParams= -name=Server -adminLog
namalskMission=
; [Server-5]
; serverPort=35500
; serverConfig=serverDZ.cfg
; serverExeName=DayZServer_x64.exe
; serverCPU=4
; ; startupClientMods=@CF;@COT
; startupClientMods=@CF;@VPPAdminTools;@Namalsk_Island;@Namalsk_Survival
; startupServerMods=
; additionalParams= -name=Server -filePatching
; namalskMission=Hardcore
; [Server-6]
; serverPort=35600 ; serverPort=35600
; serverConfig=serverDZ.cfg ; serverConfig=serverDZ.cfg
; serverExeName=DayZServer_x64.exe ; serverExeName=DayZServer_x64.exe

View File

@@ -11,10 +11,10 @@ param (
$param = 0 $param = 0
) )
[bool]$update = $param [bool]$update = $param
[bool]$noDelete = $true # For tests - don't delete logs [bool]$noDelete = $false # For tests - don't delete logs
[string]$logFile = ".\wDayzManager.log" [string]$logFile = ".\wDayzManager.log"
[string]$steamScript = "wDayzManager.txt" [string]$steamScript = "wDayzManager.txt"
[string]$iniFile = "wDayzManager.ini" [string]$iniFile = ".\wDayzManager.ini"
if (-not (Test-Path $iniFile)) { if (-not (Test-Path $iniFile)) {
Write-Error "Can't find file '$iniFile'" Write-Error "Can't find file '$iniFile'"
Exit Exit
@@ -25,6 +25,10 @@ $date = Get-Date
[int]$currentDay = ([datetime]$date).Day [int]$currentDay = ([datetime]$date).Day
[int]$currentHour = ([datetime]$date).Hour [int]$currentHour = ([datetime]$date).Hour
$date2 = Get-Date -Format 's' | ForEach-Object { $_ -replace 'T', ' ' }
Write-Host "$($date2) Starting wDayzManager script"
Write-Host "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
$dayzProcess = $becProcess = $instance = $null $dayzProcess = $becProcess = $instance = $null
@@ -35,8 +39,6 @@ $startupClientMods = $startupServerMods = $startupMods = $startupParams = $null
$serverProfile = $additionalParams = $dayzArguments = $dayz = $bec = $becArguments = $null $serverProfile = $additionalParams = $dayzArguments = $dayz = $bec = $becArguments = $null
$logsName = $atLogsLocation = $becLogsLocation = $rotatedLogsLocation = $null $logsName = $atLogsLocation = $becLogsLocation = $rotatedLogsLocation = $null
Write-Host "=========="
$ini = (Get-IniContent -FilePath $iniFile) $ini = (Get-IniContent -FilePath $iniFile)
$config = $ini.Config $config = $ini.Config
[string]$serverLocation = $config.serverLocation [string]$serverLocation = $config.serverLocation
@@ -121,6 +123,33 @@ if ($update) {
} }
Start-Sleep -Seconds 1 Start-Sleep -Seconds 1
# Patching Namalsk
[bool]$isNamalskIslandPresent = $false
[bool]$isNamalskSurvivalPresent = $false
$clientMods.Item1 | ForEach-Object {
if ($_ -like "*namalsk*" -and $_ -like "*island*") {
$isNamalskIslandPresent = $true
$modNI = $_
Write-Host "Patching Namalsk Island server meta.cpp file ..."
$whatFind_NI = "2288339650"
$replaceWith_NI = "2289456201"
$content = Get-Content -Path "$($serverLocation)\$($modNI)\meta.cpp"
$content = $content -replace $whatFind_NI, $replaceWith_NI
Set-Content -Path "$($serverLocation)\$($modNI)\meta.cpp" -Value $content
}
if ($_ -like "*namalsk*" -and $_ -like "*survival*") {
$isNamalskSurvivalPresent = $true
$modNS = $_
Write-Host "Patching Namalsk Survival server meta.cpp file ..."
$whatFind_NS = "2288336145"
$replaceWith_NS = "2289461232"
$content = Get-Content -Path "$($serverLocation)\$($modNS)\meta.cpp"
$content = $content -replace $whatFind_NS, $replaceWith_NS
Set-Content -Path "$($serverLocation)\$($modNS)\meta.cpp" -Value $content
}
}
# # Customizing servers # # Customizing servers
# # Overwriting default messages.xml from Namalsk by custom file # # Overwriting default messages.xml from Namalsk by custom file
# if (Test-Path -Path "$($serverLocation)\.customs") { # if (Test-Path -Path "$($serverLocation)\.customs") {
@@ -130,34 +159,7 @@ if ($update) {
Write-Host "End of updating server." Write-Host "End of updating server."
Start-Sleep -Seconds 1 Start-Sleep -Seconds 1
} }
Write-Host
# Patching Namalsk
[bool]$isNamalskIslandPresent = $false
[bool]$isNamalskSurvivalPresent = $false
$clientMods.Item1 | ForEach-Object {
if ($_ -like "*namalsk*" -and $_ -like "*island*") {
$isNamalskIslandPresent = $true
$modNI = $_
Write-Host "Patching Namalsk Island server meta.cpp file ..."
$whatFind_NI = "2288339650"
$replaceWith_NI = "2289456201"
$content = Get-Content -Path "$($serverLocation)\$($modNI)\meta.cpp"
$content = $content -replace $whatFind_NI, $replaceWith_NI
Set-Content -Path "$($serverLocation)\$($modNI)\meta.cpp" -Value $content
}
if ($_ -like "*namalsk*" -and $_ -like "*survival*") {
$isNamalskSurvivalPresent = $true
$modNS = $_
Write-Host "Patching Namalsk Survival server meta.cpp file ..."
$whatFind_NS = "2288336145"
$replaceWith_NS = "2289461232"
$content = Get-Content -Path "$($serverLocation)\$($modNS)\meta.cpp"
$content = $content -replace $whatFind_NS, $replaceWith_NS
Set-Content -Path "$($serverLocation)\$($modNS)\meta.cpp" -Value $content
}
}
Write-Host Write-Host
if ($rotateLogs) { if ($rotateLogs) {
@@ -411,18 +413,22 @@ foreach ($srv in $servers) {
# Write-Host " daysAmount: $($daysAmount)" # Write-Host " daysAmount: $($daysAmount)"
# Write-Host " noDelete: $($noDelete)" # Write-Host " noDelete: $($noDelete)"
# # Starting servers # Starting servers
# Set-Location -Path "$($serverLocation)" Set-Location -Path "$($serverLocation)"
# $dayzProcess[$processID] = Start-Process -FilePath $dayz -ArgumentList $dayzArguments -PassThru $dayzProcess[$processID] = Start-Process -FilePath $dayz -ArgumentList $dayzArguments -PassThru
# $dayzProcess[$processID] # $dayzProcess[$processID]
# if ($becLocation) { # Starting BEC
# Set-Location -Path "$($becLocation)" if ($becLocation) {
# $becProcess[$processID] = Start-Process -FilePath $bec -ArgumentList $becArguments -PassThru Set-Location -Path "$($becLocation)"
# $becProcess[$processID] $becProcess[$processID] = Start-Process -FilePath $bec -ArgumentList $becArguments -PassThru
# } # $becProcess[$processID]
}
$processID++ $processID++
Write-Host
Start-Sleep -Seconds 1
} }
# Start-Sleep -Seconds 5
Write-Host "==========" Write-Host "End of wDayzManager script"

View File

@@ -1,16 +0,0 @@
// wDayzManager.txt - Steam script
@NoPromptForPassword 1
@ShutdownOnFailedCommand 1
force_install_dir "D:\DayZ\Server"
login w0lf_2k
app_update 223350 validate
workshop_download_item 221100 2731398623 validate
workshop_download_item 221100 1559212036 validate
workshop_download_item 221100 1564026768 validate
workshop_download_item 221100 1828439124 validate
workshop_download_item 221100 1623711988 validate
workshop_download_item 221100 2288339650 validate
workshop_download_item 221100 2288336145 validate
workshop_download_item 221100 2561482171 validate
workshop_download_item 221100 1988925918 validate
quit