Open source configuration and automation developed for the Carim DayZ Server, but usable by all. This is intended to be used in conjunction with CFTools.
To see sample output, visit https://github.com/schana/dayz-server-carim-output.
- Perform initial setup of CFTools OmegaManager
- Copy
auth.json
andpreexec.bat
somewhere outside of the repository for security purposes - Edit the files with the appropriate values
- Run
preexec.bat
- Your server should now be configured to automatically pull updates and apply them every time your server restarts
All the configurations are stored in the resources
directory.
It is encouraged to copy everything except original-mod-files
into your own resources directory where you can
individually manage your server's configuration.
auth.json
is where admins, priority, steam credentials, etc. are storedpreexec.bat
is the script that runs the config utility with loggingmodifications/omega/mods.json
contains the mods enabled on the servermodifications/server/types_config.json
is wheretypes.xml
is configuredmodifications/mods
is the folder containing all the mod specific configuration
@Airdrop-Upgraded
@Base Fortifications
@Cl0uds Military Gear
@Code Lock
@DayzWeaponsPainting
@Leather Crafting
@MasssManyItemOverhaul
@MunghardsItempack
@Notes
@OP_BaseItems
@SchanaModLockPick
@SQUAD MSF-C
@Server_Information_Panel
@Simple Base
@Trader
@VPPAdminTools
@VanillaPlusPlusMap
@WindstridesClothingPack
usage: main.py [-h] [-c] -d DEPLOY -a AUTH [-o OUTPUT] [-v] [-r RESOURCES]
[-m MISSION]
Automate configuration
optional arguments:
-h, --help show this help message and exit
-c clean generated
-d DEPLOY deploy directory containing the original dayz server files
-a AUTH auth config file
-o OUTPUT output destination directory
-v verbosity of the output
-r RESOURCES resources directory to use
-m MISSION mission name
Example:
python3 -m carim.main -c -d <path to omega deploy directory> -a <path to your auth config> -o <path to output config to>
Configuration is generated and output in a folder named generated-<timestamp>
. The contents of this can be copied into your omega directory.
Configurations are represented as functions. Decorators are added to specify how the application should treat them.
carim.configuration.decorators
Decorators for configs should always be applied in the following order
@register
indicates that the configuration should be registered to be automatically applied at runtime- If order of application is important, then this should be omitted. For example, the Trader config relies on Types config, so it is not registered so execution order can be manually managed.
@mod
indicates that the config should only be applied if the specified mod is enabled@config
marks the function as a configuration and handles creating directories for the output as well as logging- decorators that inherit from
config
can also be used - they usually only add specific directory prefixes
located_config
,server
,mission
,profile
- decorators that inherit from
Examples:
from carim.configuration import decorators
@decorators.register # registers this config to be applied automatically
@decorators.mod('@SQUAD MSF-C') # only apply this config if this mod is enabled
@decorators.profile # denotes the function as a configuration
def items_msfc():
# do things
from carim.configuration import decorators
@decorators.register
@decorators.mod('@VPPAdminTools')
@decorators.profile(directory='VPPAdminTools/ConfigurablePlugins/TeleportManager')
# directory parameter is a relative path to where the configuration should be placed
# the profile decorator adds the prefix 'servers/0/profiles' to this
# the directory parameter for the function will be populated with the output path to where configs should be written
def vpp_teleports(directory):
with file_writing.f_open(pathlib.Path(directory, 'TeleportLocation.json'), mode='w') as f:
# file_writing.f_open is a utility that handles errors when writing to files
# this is helpful when you try to write to a file that is currently opened by the server process
# write the config
Automatic registering of configurations is handled in the __init__.py
for each package within carim.configuration
.
When adding a new module within the configuration package, corresponding entries must be added in the relevant __init__.py
file.
For examples, see the following:
mods/__init__.py
omega/__init__.py
server/__init__.py
universal/__init__.py