RECORDANDRONCO/launch-dedicated.cmd
penev92 b03c98b462 Updated ModSDK packaging and launching scripts
Updates SDK scripts to match the current latest version of OpenRA (coming up on a 12.2022 release).
 - Launch scripts - OpenRA PRs 17578, 19317, 19486.
 - Make scripts - OpenRA PRs 16529, 19379, 19671, 19737, 19747, 19780, 20559.
 - Packaging scripts - OpenRA PRs 19780, 19782, 19886, 20559, 20610.
2023-01-15 21:44:53 +01:00

55 lines
2.0 KiB
Batchfile

:: example launch script, see https://github.com/OpenRA/OpenRA/wiki/Dedicated for details
@echo on
set Name="Dedicated Server"
set ListenPort=1234
set AdvertiseOnline=True
set Password=""
set RecordReplays=False
set RequireAuthentication=False
set ProfileIDBlacklist=""
set ProfileIDWhitelist=""
set EnableSingleplayer=False
set EnableSyncReports=False
set EnableGeoIP=True
set EnableLintChecks=True
set ShareAnonymizedIPs=True
set JoinChatDelay=5000
@echo off
setlocal EnableDelayedExpansion
title %Name%
FOR /F "tokens=1,2 delims==" %%A IN (mod.config) DO (set %%A=%%B)
if exist user.config (FOR /F "tokens=1,2 delims==" %%A IN (user.config) DO (set %%A=%%B))
set MOD_SEARCH_PATHS=%~dp0mods,./mods
if "!MOD_ID!" == "" goto badconfig
if "!ENGINE_VERSION!" == "" goto badconfig
if "!ENGINE_DIRECTORY!" == "" goto badconfig
if not exist %ENGINE_DIRECTORY%\bin\OpenRA.exe goto noengine
>nul find %ENGINE_VERSION% %ENGINE_DIRECTORY%\VERSION || goto noengine
cd %ENGINE_DIRECTORY%
:loop
bin\OpenRA.Server.exe Game.Mod=%MOD_ID% Engine.EngineDir=".." Server.Name=%Name% Server.ListenPort=%ListenPort% Server.AdvertiseOnline=%AdvertiseOnline% Server.EnableSingleplayer=%EnableSingleplayer% Server.Password=%Password% Server.RequireAuthentication=%RequireAuthentication% Server.RecordReplays=%RecordReplays% Server.ProfileIDBlacklist=%ProfileIDBlacklist% Server.ProfileIDWhitelist=%ProfileIDWhitelist% Server.EnableSyncReports=%EnableSyncReports% Server.EnableGeoIP=%EnableGeoIP% Server.ShareAnonymizedIPs=%ShareAnonymizedIPs% Server.EnableLintChecks=%EnableLintChecks% Engine.SupportDir=%SupportDir% Server.JoinChatDelay=%JoinChatDelay%
goto loop
:noengine
echo Required engine files not found.
echo Run `make all` in the mod directory to fetch and build the required files, then try again.
pause
exit /b
:badconfig
echo Required mod.config variables are missing.
echo Ensure that MOD_ID ENGINE_VERSION and ENGINE_DIRECTORY are
echo defined in your mod.config (or user.config) and try again.
pause
exit /b