Running a Server

From DCS World Wiki - Hoggitworld.com

Listen Server

Dedicated Server

Set up

AutoExec.cfg

This file should go in the C:\Users\<user>\Saved Games\DCS[.openbeta]\Config directory. This is a template with comments:

if not net then net = {} end -- prevent nil
net.download_speed = 1024*1024*256 -- Set download speed
net.upload_speed = 1024*1024*256 -- Set upload speed.
options.graphics.maxfps = 30 -- Max FPS, we don't need high fps so limit it.
options.graphics.render3D = false -- We don't need the graphics engine for a server.
options.graphics.ScreenshotQuality = 0 -- Don't need high quality on screenshots.
crash_report_mode = "silent" -- Capture report logs, but don't block the process from closing.
disable_write_track = true -- We don't need to store tracks on the server


SimpleRadio

Installing

Check out the Simple Radio Standalone page for details of how to install it. Note that you don't need to run the autoinstall to run the server.

Configuration

Changing the ports: Open server.cfg and change the SERVER_PORT to the lower of the two ports to open. Two ports are open, and they're contiguous starting from the port set. So if you set port 2000, then ports 2000 and 2001 will need to be opened. See the Official Documentation for more info.

Scripts and Code

Auto Restart

Copy the following into a .bat file and use it to start DCS. Make sure to change DCS.exe location if it's different.

@echo off

:CheckDCS
echo "Checking for DCS running"
TASKLIST /FI "IMAGENAME eq DCS.exe" 2>NUL | find /I /N "DCS.exe">NUL
IF NOT %ERRORLEVEL%==0 GOTO StartDCS
echo "DCS Already running. Checking again in 30 seconds."
timeout /t 30 /nobreak > NUL
GOTO CheckDCS

:StartDCS
echo "DCS Not running, starting it up."
start "" "C:\Program Files\Eagle Dynamics\DCS World\bin\DCS.exe"
timeout /t 30 /nobreak
GOTO CheckDCS

Firewalling

There's a problem with DCS' use of AsyncNet.dll that causes crashes if the server has a user connect to it while it's still loading up the mission. To prevent this, we've got a firewall rule that blocks 10308 that we enable during startup, and disable around 90 seconds afterwards.