Dedicated Server Guide - dcs-liberation/dcs_liberation GitHub Wiki

There are a few additional steps and caveat to running a dcs-liberation mission on a dedicated DCS server.

I'll try and explain them, as the server manager of my squadron, and dcs-liberation contributor.

If you have any questions, comments, or think this document is incomplete or wrong, please contact me on dcs-liberation's Discord.

[VEAF]Zip.

Preparing the server

Modding MissionScripting.lua

Any DCS instance running dcs-liberation, be it a standalone installation or a dedicated server, must have a modified MissionScripting.lua in order for the LUA script to have access to the os, io and lfs packages.

When running on a standalone installation, usually (that is, if everything works as planned) the dcs-liberation program itself will replace the original MissionScripting.lua file with an edited version.

Of course, this is not possible when DCS run on a different machine, as a dedicated server.

In this case, you need to edit the file yourself. The easiest way to do it is to replace the original file (<dcs installation>\Scripts\MissionScripting.lua) with the file in dcs-liberation distribution (<dcs-liberation installation>\resources\scripts\MissionScripting.lua).

Sometimes, you'll have an already modded file because you're using scripts that need access to specific packages. That's alright, as long as the os, io and lfs packages are accessible.

To ensure this, simply be certain that these particular lines are commented out :

Original:

	sanitizeModule('os')
	sanitizeModule('io')
	sanitizeModule('lfs')

Commented out:

	--sanitizeModule('os')
	--sanitizeModule('io')
	--sanitizeModule('lfs')

Be advised, as soon as you use the dcs-updater to install a new version of DCS, this file will be restored and you'll have to mod it again !

The specific case of slmod

If you're using slmod, you have to be extra careful.

It also has a specific version of the MissionScripting.lua file which is used to replace DCS', and if you want the dcs-liberation script to work properly you have to edit it, too. Go and edit this file : <saved games>\dcs\Scripts\net\Slmodv7_5\SlmodMissionScripting.lua.

Make sure to comment the lines mentionned in the previous section.

You should also make the modification to the original file in DCS folder (see previous section), and the caveat about updating applies to slmod too.

Environment variables

The dcs-liberation script will try and write the state.json file at the following locations :

  • %LIBERATION_EXPORT_DIR% (an environment variable)
  • the dcs-liberation install folder, stored in the mission (probably not the same on the server and on the computer that generated the mission)
  • the system's temporary folder (as defined in the %TEMP% environment variable)
  • DCS' install directory

This will be stated in the DCS log file (accessible in <saved games>\dcs\logs\dcs.log) like this :

2020-10-20 20:44:52.652 INFO    SCRIPTING: DCSLiberation|discoverDebriefingFilePath|75: Using DCS Liberation install folder for state.json
2020-10-20 20:44:52.652 INFO    SCRIPTING: DCSLiberation|87: DCS Liberation state will be written as json to [D:\dev\_VEAF\dcs_liberation\state.json](/dcs-liberation/dcs_liberation/wiki/D:\dev\_VEAF\dcs_liberation\state.json)

You can (and should) set the %LIBERATION_EXPORT_DIR% environment variable on your server. Please note that you'll have to restart DCS, and maybe even your server, depending on your configuration, before it's taken into account. Setting the environment variable is a standard Windows server feature and there are multiple guides online for this.

Preparing the mission

After installing dcs-liberation on a computer (let's call it the mission computer), configure it the way you like (including plugins, if you want), and start a new campaign.

At one point, you'll want to fly a mission. When you press the Take off button in dcs-liberation, it'll generate a mission : <saved games>\dcs\missions\liberation_nextturn.miz.

Now, you can simply copy the mission file to your server and run it.

Note: It was previously the case that multiplayer .miz turns had to be opened and saved in the mission editor prior to use. This is NO longer required.

Getting the result of the mission

During the mission (at runtime, as we developers like to say), the state of the mission (destroyed units, captured bases) is written in the state.json file.

It should be updated whenever a destruction or capture event occurs. But sometimes this doesn't work, so you have to be careful.

When the mission is over, double-check that the state.json file is updated : check the file date, and if you dare, check its content.

If in doubt, end the mission on the server (running another mission is enough ; I keep one "empty" mission on each theater, it's very quick to run).

Then download the state.json file on the mission computer, and enter it in dcs-liberation, using the "Manually submit" button :

If the "Waiting for mission completion" window is not visible anymore (you may have closed it, or the program), simply click the "Take off" button again.

Dedicated Server set up without DCS server files

First download a premade .bat file and move it to "X:\DCS World OpenBeta\bin" https://www.mediafire.com/file/pfjh1gfsnisvi1u/dcs-server.bat/file

Don't wish to download? no problem!

  1. create a text file name it something on the lines of "DCS server start.bat" or which ever you prefer but make sure you edit the type of file by inserting .bat instead of "x.txt" should look on the lines of "x.bat"
  2. open text file and copy and paste this code (no quotes) "DCS.exe --server --norender -w DCS.server1" and hit save.
  3. drag the just now created file in the same directory stated above "X:\DCS World OpenBeta\bin" and follow instructions below.

To Start the server simply double click the .bat file provided, which will now open an instance of dcs and it will stay on the "DCS" splash screen which is normal.

to manage your server simply go to "X:\DCS World OpenBeta\WebGUI" and open "index.html" which now will open the WebUI server manager on your default internet browser.