From bd71842f7d32baa7d2d8633585782a5afb5e0003 Mon Sep 17 00:00:00 2001 From: David Pierron Date: Wed, 21 Oct 2020 13:20:52 +0200 Subject: [PATCH] Updated Dedicated Server Guide (markdown) --- Dedicated-Server-Guide-[WIP].md | 65 +++++++++++++++++++++++++++++++++ Dedicated-Server-Guide.md | 10 ----- 2 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 Dedicated-Server-Guide-[WIP].md delete mode 100644 Dedicated-Server-Guide.md diff --git a/Dedicated-Server-Guide-[WIP].md b/Dedicated-Server-Guide-[WIP].md new file mode 100644 index 0000000..81de9d4 --- /dev/null +++ b/Dedicated-Server-Guide-[WIP].md @@ -0,0 +1,65 @@ +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 (`\Scripts\MissionScripting.lua`) with the file in dcs-liberation distribution (`\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:__ +```lua + sanitizeModule('os') + sanitizeModule('io') + sanitizeModule('lfs') +``` +__Commented out:__ +```lua + --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](https://github.com/mrSkortch/DCS-SLmod), you have to be extra careful. +It also has [a specific version](https://github.com/mrSkortch/DCS-SLmod/blob/master/Scripts/net/Slmodv7_5/SlmodMissionScripting.lua) 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 : `\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 `\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]] +``` + +## Preparing the mission + +## Getting the result of the mission + diff --git a/Dedicated-Server-Guide.md b/Dedicated-Server-Guide.md deleted file mode 100644 index 96a32bd..0000000 --- a/Dedicated-Server-Guide.md +++ /dev/null @@ -1,10 +0,0 @@ -[WIP] - -The state file should be written in /state.json. - -If you are running the mission on a server, so not on the same PC as DCS Liberation, make sure to recreate the same directory structure on the server, so there is a fake DCS Liberation directory somewhere. (It is not very well supported yet) - -To allow the DCS process on the server to write the state file, you also have to replace the file by the one here : /resources/scripts/MissionScripting.lua> - -You can close the mission whenever you feel it is over. Then retrieve the state.json file from FTP and submit it in DCS Liberation on your PC; -