Nabend zusammen,
Sicherlich wissen einige, dass ich hier und da mal einem DayZ Server arbeiten. Um nicht immer für alles einen Server zu mieten, habe ich mir zum Testen ein lokales Powershell Script gebastet.
"Warum ein eigenes und keines von den 400000 bestehen Scripts?" Ganz einfach, in 90% aller Scripts, welchen die Mods immer wie folgt aufgelistet.
-mod=@mod1;@mod2;@servermod1;@servermod2
was mich schon immer gestört hat.
Somit hab ich folgende Gemacht.
Code
- <#
- DayZ Start Powershell by M3ragon
- NormalConfig
- #>
- $ExeName = "DayZServer_x64.exe"
- $ExeDZSA = "DZSALModServer.exe"
- $ExePath = "H:\SteamLibrary\steamapps\common\DayZServer\"
- $ProfileConfig = "Config\Profile_Chernarus" #Profielname
- $ServerDZ = "Config\serverDZ_Chernarus.cfg" #Server Config
- $PORT = "2302" #Server Port
- $BattleEye = "H:\SteamLibrary\steamapps\common\DayZServer\battleye\"
- <# ------------------------- Client Mods ------------------------- #>
- $ModDirSteam = "C:\Program Files (x86)\Steam\steamapps\workshop\content\221100\" #if run in diffrent dir
- $ModDirSteam2 = "" #if run in same dir
- #$ModDirDZSA = "H:\SteamLibrary\steamapps\common\DayZ\!dzsal\"
- $mods= @(
- [pscustomobject]@{ModID='1559212036';ModName='@CF'}
- [pscustomobject]@{ModID='2723473426';ModName='@CA'}
- [pscustomobject]@{ModID='1828439124';ModName='@VPPAdminTools'}
- [pscustomobject]@{ModID='2546583347';ModName='@BuildEverywhere'}
- [pscustomobject]@{ModID='1707653948';ModName='@StaminaSettings'}
- [pscustomobject]@{ModID='2264162971';ModName='@SimpleAutorun'}
- [pscustomobject]@{ModID='2534883520';ModName='@SchanaParty'}
- [pscustomobject]@{ModID='2115602332';ModName='@SchanaModGlobalChat'}
- [pscustomobject]@{ModID='2449234595';ModName='@MagObfuscation'}
- [pscustomobject]@{ModID='1819514788';ModName='@EarPlugs'}
- [pscustomobject]@{ModID='2444247391';ModName='@InventoryMoveSounds'}
- [pscustomobject]@{ModID='2353998362';ModName='@Notifications'}
- [pscustomobject]@{ModID='2225837273';ModName='@ClothingInventoryFix'}
- [pscustomobject]@{ModID='1565871491';ModName='@BuilderItems'}
- [pscustomobject]@{ModID='2106663048';ModName='@NatureOverhaul'}
- [pscustomobject]@{ModID='2270215132';ModName='@BasicMap'}
- [pscustomobject]@{ModID='2393138357';ModName='@M3ragonScripts'}
- [pscustomobject]@{ModID='2398911445';ModName='@BasicTerritories'}
- [pscustomobject]@{ModID='2670506982';ModName='@Building_Fortifications'}
- [pscustomobject]@{ModID='1814422822';ModName='@SimpleBase'}
- [pscustomobject]@{ModID='2693902243';ModName='@MassMisc'}
- [pscustomobject]@{ModID='1646187754';ModName='@CodeLock'}
- [pscustomobject]@{ModID='1827241477';ModName='@Breachingcharge'}
- [pscustomobject]@{ModID='2464098674';ModName='@BC-Codelock'}
- [pscustomobject]@{ModID='2458896948';ModName='@TraderPlus'}
- [pscustomobject]@{ModID='2691041685';ModName='@CarePackages'}
- [pscustomobject]@{ModID='2303554682';ModName='@Dogtags'}
- [pscustomobject]@{ModID='2723807644';ModName='@FOXWEAPONS'}
- [pscustomobject]@{ModID='2646817942';ModName='@TacticalFlava'}
- [pscustomobject]@{ModID='2143128974';ModName='@AdvancedWeaponScopes'}
- [pscustomobject]@{ModID='2051775667';ModName='@CustomisableZombies'}
- )
- $ListMods = for ($Modlister = 0; $Modlister -lt $mods.count; $Modlister++){
- "$ModDirSteam2{0}" -f $mods.ModName[$Modlister]
- }
- $Modlist = ($ListMods -join';') #Remove Spacer and LineBreack
- <# ------------------------- Server Mods ------------------------- #>
- $ServerMod= @(
- [pscustomobject]@{ModID='2372233619';ModName='@DumpAttatch'}
- [pscustomobject]@{ModID='2464526692';ModName='@GameLabs'}
- )
- $ListServerMods = for ($ServerModlister = 0; $ServerModlister -lt $ServerMod.count; $ServerModlister++){
- "$ModDirSteam2{0}" -f $ServerMod.ModName[$ServerModlister]
- }
- $ServerModlist = ($ListServerMods -join';') #Remove Spacer and LineBreack
- <# ------------------------- Parameter ------------------------- #>
- $ArgList =@(
- "-profiles=$ProfileConfig",
- "-config=$ServerDZ",
- "-BEPath=$BattleEye",
- "-port=$PORT",
- "-mod=$Modlist",
- "-serverMod=$ServerModlist",
- '-doLogs',
- '-adminLog',
- '-netLog',
- #'-filePatching',
- #'-cpuCount=8',
- #'-limitFPS=60',
- '-freezeCheck'
- )
- $ArgListJoin = $ArgList -join' ' #Spacer
- <# ------------------------- DZSA ------------------------- #>
- $ArgListDZSA =@(
- "-port=$PORT",
- "-mod=$Modlist",
- "-skipserver" #start only WebConnecton
- )
- $ArgListDZSAJoin = $ArgListDZSA -join' ' #Spacer
- $FullPath = "$ExePath$ExeName" #FullPath to Exe
- $DZSAModServerPath = "$ExePath$ExeDZSA"
- <# ------------------------- Copy Server Keys ------------------------- #>
- Remove-Item -Path "$ExePath\keys" -Exclude dayz.bikey -Recurse
- for ($i = 0; $i -lt $mods.count; $i++){
- $CopyServerKeyPath = $ModDirSteam + $mods.ModID[$i]
- Get-ChildItem -Path "$CopyServerKeyPath" -Include *.bikey -Recurse | Copy-Item -Destination "$ExePath\keys"
- }
- <# ------------------------- Move Logs ------------------------- #>
- #Get-ChildItem "$ExePath\$ProfileConfig\*" -include *.ADM,*.RPT,.log -Recurse | Move-Item -Destination "$ExePath\$ProfileConfig\LogsFiles\"
- $LogPath = $ExePath + $ProfileConfig
- $LogPath2 = $ExePath + "ServerLogs\"
- Move-Item -Path $LogPath\*.RPT -Destination $LogPath2
- Move-Item -Path $LogPath\*.ADM -Destination $LogPath2
- Move-Item -Path $LogPath\*.log -Destination $LogPath2
- Move-Item -Path $LogPath\*.mdmp -Destination $LogPath2
- Start-Sleep 1
- <# ------------------------- Create Symlinks for Mods ------------------------- #>
- Write-Host "Remove old Mods"
- $strings=@("@*")
- Get-Childitem -Path "$ExePath" -Include ($strings) -Recurse -force | Remove-Item -Force -Recurse
- Write-Host "Create neu Symlinks"
- <# ------------------------- Working Create Symlink ------------------------- #>
- for ($i = 0; $i -lt $mods.count; $i++){
- $Target = $ModDirSteam + $Mods.ModID[$i]
- $Destination = $ExePath + $Mods.ModName[$i]
- New-Item -ItemType Junction -Path $Destination -Target $Target
- }
- for ($i = 0; $i -lt $ServerMod.count; $i++){
- $Target = $ModDirSteam + $ServerMod.ModID[$i]
- $Destination = $ExePath + $ServerMod.ModName[$i]
- New-Item -ItemType Junction -Path $Destination -Target $Target
- }
- <# ------------------------- START DAYZ SERVER ------------------------- #>
- #Write-Host "Start DayZ Server"
- Start-Process -FilePath $FullPath -WorkingDirectory $ExePath -ArgumentList $ArgListJoin
- Write-HOST -FilePath $FullPath -WorkingDirectory $ExePath -ArgumentList $ArgListJoin
- <# ------------------------- START DASA-WEBHOST SERVER ------------------------- #>
- #Write-Host "Start DZSA-ModServer"
- #Start-Process -FilePath $DZSAModServerPath -WorkingDirectory $ExePath -ArgumentList $ArgListDZSAJoin
- Write-HOST -FilePath $DZSAModServerPath -WorkingDirectory $ExePath -ArgumentList $ArgListDZSAJoin
Frage an euch Pro Dev´s gibt es Ideen das ganze zu "verbessern"?