Skip to content

GlitchWorks404/dayz-server-utilities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DayZ Server Utilities

PowerShell utilities for managing DayZ servers. Includes startup scripts with mod management, resource limiting, and an XML configuration merger.


Utilities

Utility Purpose Best For
dayz_server_start.ps1 Basic server startup with mod sorting and auto-restart Standard deployments
dayz_server_start_cpumemlimit.ps1 Server startup with CPU/RAM/FPS limits and affinity pinning Resource-constrained hosts
mergexml.ps1 Merge multiple XML config files into one Consolidating mod configurations

Requirements

  • Windows Server or Windows 10/11
  • PowerShell 5.0+
  • DayZ Server installed in the same directory or accessible via path
  • Mod folders (prefixed with @) in the server root

dayz_server_start.ps1

Basic server launcher with automatic mod detection, key management, and crash recovery.

What It Does

  1. Detects mods — Scans for folders starting with @
  2. Sorts by priority — Loads essential mods first (CF, Expansion, etc.)
  3. Copies .bikey files — Keeps server keys in sync with mod updates
  4. Watches server — Detects crashes and restarts automatically
  5. Scheduled restarts — Restarts server on interval (default 3.5 hours)

Configuration

Edit the top of the script:

$ServerExe       = "DayZServer_x64.exe"
$Port            = 2302
$RestartInterval = 3.5                  # Hours
$CpuCount        = 4

$LoadOrderPriority = @{
    "@CF"                       = 0
    "@Community-Online-Tools"   = 1
    # ... add/modify mods here ...
}

$ServerModList = @(
    # "@ServerAdminTools"      # Server-side only mods
)

Usage

.\dayz_server_start.ps1

Runs indefinitely, restarting the server on crash or interval. Press Ctrl+C in the PowerShell window to stop.


dayz_server_start_cpumemlimit.ps1

Advanced server launcher with strict resource limits and CPU core pinning.

What It Does

Everything dayz_server_start.ps1 does, plus:

  1. Caps FPS — Limits server simulation FPS
  2. Limits RAM — Sets max memory pool allocation
  3. Pins CPU cores — Uses CPU affinity mask to lock the process to specific cores
  4. Prevents runaway usage — Keeps resource-heavy mods contained

Configuration

Same as basic script, plus:

$LimitFPS        = 60               # Server simulation FPS cap
$MaxMem          = 4096             # MB (4096 = 4GB, 6144 = 6GB)
$CpuCount        = 4                # Cores to optimize for

$CpuAffinityMask = 15               # Bitmask for cores
# 1  = Core 0 only
# 3  = Cores 0, 1
# 15 = Cores 0, 1, 2, 3
# 63 = Cores 0-5

Usage

.\dayz_server_start_cpumemlimit.ps1

Same as basic script, but with resource constraints applied at startup.

CPU Affinity Reference

Calculate your mask based on available cores:

Cores desired | Mask
-----------+------
1           | 1
2           | 3
3           | 7
4           | 15
5           | 31
6           | 63
8           | 255

mergexml.ps1

Combines multiple XML files (typically DayZ configuration files from mods) into a single consolidated file.

What It Does

  1. Finds all .xml files in the current directory
  2. Uses first file as base — Keeps its root structure
  3. Appends nodes from others — Imports child elements from each subsequent file
  4. Outputs types_MERGED.xml — New consolidated file
  5. Progress tracking — Shows merge status and node counts

When to Use

  • Merging custom types.xml files from multiple mods
  • Consolidating mod configuration XMLs
  • Preparing files for server config deployment

Usage

# Place all XML files to merge in a folder
# Run from that folder:
.\mergexml.ps1

Creates types_MERGED.xml in the same directory.

Example Output

--------------------------------------------------
XML MERGE TOOL v2.0
--------------------------------------------------
[INIT] Found 5 files to process:
   - types_base.xml
   - types_expansion.xml
   - types_custom.xml
   - types_vehicles.xml
   - types_items.xml

[STEP 1] Loading base file: types_base.xml
   > Base loaded successfully. Root element: <types>
   > Initial node count: 1200

[STEP 2] Starting merge process...
   + Reading file: types_expansion.xml -> Appended 340 nodes.
   + Reading file: types_custom.xml -> Appended 85 nodes.
   ...

[STEP 3] Saving output...
SUCCESS!
--------------------------------------------------
Total Files Merged : 5
Final Node Count   : 1847
Output File        : types_MERGED.xml

Common Workflow

Setting Up a Fresh Server

  1. Place server files and mods in a directory
  2. Edit dayz_server_start.ps1 with your config
  3. Run the script:
    .\dayz_server_start.ps1

With Resource Limits

  1. Use dayz_server_start_cpumemlimit.ps1 instead
  2. Set $CpuAffinityMask based on available cores
  3. Adjust $MaxMem and $LimitFPS as needed
  4. Run the script

Merging Mod Configs

  1. Collect all mod types.xml files
  2. Put them in a folder with mergexml.ps1
  3. Run the script
  4. Use types_MERGED.xml in your server config

Troubleshooting

Server won't start

  • Check that DayZServer_x64.exe exists in the script directory
  • Verify the path in $ServerExe matches your installation
  • Check Event Viewer for system-level errors

Mods not loading

  • Ensure mod folders start with @
  • Check load order priorities match your mods
  • Look for .bikey files in the keys/ folder

CPU/Memory limits not working

  • Some systems don't allow ProcessorAffinity changes
  • Try running PowerShell as Administrator
  • Check Windows Task Scheduler affinity settings

mergexml.ps1 fails

  • Ensure you have at least 2 XML files in the directory
  • Check that XML files are valid (no syntax errors)
  • Run with Administrator privileges if permission denied

License

MIT

Changelog

v1.0 — Initial release with three utilities

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors