• No results found

The run-server command provides a convenient method for running DayZ Server locally (i.e. for testing mods).

It supports loading collections of mods and configuring server parameters through the use of “bundles”, which are specified on the command line. Bundles can be defined either in the server.toml config file or as functions in a Python module.

Bundles defined in the config file generally look like:

[bundle.mybundle]

mods = '@CF;@MasPuertas;P:\MyModPack'

mission_directory = 'mpmissions\dayzoffline.enoch'

To load a bundle, specify it on the command line as a positional argument. For example:

run-server mybundle

Bundles defined in Python require more typing but offer more flexibility than config file bundles.

See also:

Bundles as Configuration Python Bundles

2.3.1 Configuration File

The run-server command can be configured using a config file, named server.toml by default. Most settings are in the server table of the file. For example:

[server]

executable = "server.exe"

config = "config.cfg"

directory = 'server\dir' profile_directory = "profile"

mission_directory = 'mpmissions\dayzoffline.enoch' bundles = 'path\to\module.py'

parameters = [ '-opt1', '-opt2=value' ] [workshop]

directory = 'E:\DayZ\Workshop'

Note: All settings are optional and have reasonable defaults.

6 Chapter 2. Commands

dayz-dev-tools

Server Executable

By default, run-server will try to run DayZ Server by running .\DayZServer_x64.exe on Windows or ./

DayZServeron Linux. To override the executable path, set the executable key:

[server]

executable = "server.exe"

Server Configuration

By default, run-server will tell DayZ Server to load its configuration from serverDZ.cfg. To override the config file path, set the config key:

[server]

config = "config.cfg"

Server Directory

By default, run-server will run DayZ Server from the current working directory. To have run-server change to a different directory before running DayZ Server, set the directory key:

[server]

directory = 'server\directory'

Note: The current working directory is changed after loading bundles specified on the command line.

Profile Directory

By default, run-server will let DayZ Server choose a profile directory automatically (usually, %LOCALAPPDATA%\

DayZ). The profile directory is where DayZ Server writes logs and other information. To override the profile directory, set the profile_directory key:

[server]

profile_directory = "profile"

DayZ Mission Directory

By default, run-server will let DayZ Server choose the mission directory based on the server configuration file (e.g.

serverDZ.cfg). To override the mission directory, set the mission_directory key:

[server]

mission_directory = 'mpmissions\dayzoffline.enoch'

Bundles Python Module

By default, run-server will look for bundles in a Python file named bundles.py. To override the Python bundles module filename, set the bundles key:

[server]

bundles = 'path\to\module.py'

Bundles can also be loaded from the run-server config file, as described below.

Extra Parameters

Use the parameters key to pass extra command line parameters to DayZ Server. For example, to enable admin logs:

[server]

parameters = [ '-adminLog' ]

DayZ Workshop Directory

By default, run-server will load mods prefixed with @ from the C:\Program Files (x86)\Steam\steamapps\

common\DayZ\!Workshop directory on Windows or $HOME/.steam/steamapps/common/DayZ/!Workshop on Linux. If DayZ client is installed in a different location or you have installed mods from the Steam workshop in a different location, override the default by setting the directory key in the workshop table:

[workshop]

directory = 'E:\DayZ\Workshop'

Note: As there is currently no Linux version of DayZ client, Linux users who want to specify mods using the @ prefix should override this setting to the location where they have installed mods using SteamCMD.

Bundles as Configuration

In the config file, each bundle is defined as atable. For example, to define a bundle named example:

[bundle.example]

parameters = [ '-extraParam', '-another=arg' ]

These settings work the same as the ones of the same names described inConfiguration File. In addition, bundles can define DayZ mods and server mods to add to the command line:

[bundle.example]

mods = '@Mod1;@Mod2;C:\path\to\mod'

server_mods = '@ServerMod;@ServerMod2;C:\path\to\servermod'

8 Chapter 2. Commands

dayz-dev-tools

Mods and server mods can also be configured as lists of strings:

[bundle.example]

mods = [ '@Mod1', '@Mod2', 'C:\path\to\mod' ]

server_mods = [ '@ServerMod', '@ServerMod2', 'C:\path\to\servermod' ]

Mod names and server mod names that start with @ will be loaded from the DayZ workshop directory (see DayZ Workshop Directory).

2.3.2 Python Bundles

More advanced bundles can be created using Python code in theBundles Python Module. Each function defined in the module can be referenced as a bundle. Bundle functions must take a singledayz_dev_tools.launch_settings.

LaunchSettingsargument. For example, to define a bundle named example:

def example(settings):

settings.set_mission_directory(r"path\to\mission") settings.add_mod("@Mod1")

settings.add_mod(r"C:\path\to\mod")

10 Chapter 2. Commands

CHAPTER

THREE

API REFERENCE

The APIs documented in this section are the public interface of the dayz-dev-tools package. All other functions and classes are considered private and may change without notice.

3.1 Extracting PBO Content

dayz_dev_tools.extract_pbo.extract_pbo(reader:dayz_dev_tools.pbo_reader.PBOReader, files_to_extract:

List[str], *, verbose: bool, deobfuscate: bool, cfgconvert:

Optional[str]) →None Extract one or more files contained in a PBO archive.

Parameters

• reader: APBOReaderinstance representing the PBO archive containing the file(s) to be extracted.

• files_to_extract: A list of fully-qualified paths of the files to be extracted.

• verbose: When True, print the paths of the files being extracted to stdout.

• deobfuscate: When True, attempt to deobfuscate obfuscated script files.

Note: Deobfuscation may not always work, as obfuscation techniques may evolve over time.

Related documents