Allow launcher scripts to run from other working directories.

This commit is contained in:
Paul Chote
2021-11-13 13:38:49 +00:00
committed by Matthias Mailänder
parent e00efbf53d
commit 31bd32e7ef
3 changed files with 9 additions and 6 deletions

View File

@@ -6,7 +6,8 @@
# $ Mod="d2k" ./launch-dedicated.sh # Launch a dedicated server with default settings but override the Mod
# Read the file to see which settings you can override
if command -v mono >/dev/null 2>&1 && [ "$(grep -c .NETCoreApp,Version= bin/OpenRA.Server.dll)" = "0" ]; then
ENGINEDIR=$(dirname "$0")
if command -v mono >/dev/null 2>&1 && [ "$(grep -c .NETCoreApp,Version= ${ENGINEDIR}/bin/OpenRA.Server.dll)" = "0" ]; then
RUNTIME_LAUNCHER="mono --debug"
else
RUNTIME_LAUNCHER="dotnet"
@@ -34,7 +35,7 @@ JoinChatDelay="${JoinChatDelay:-"5000"}"
SupportDir="${SupportDir:-""}"
while true; do
${RUNTIME_LAUNCHER} bin/OpenRA.Server.dll Engine.EngineDir=".." Game.Mod="$Mod" \
${RUNTIME_LAUNCHER} ${ENGINEDIR}/bin/OpenRA.Server.dll Engine.EngineDir=".." Game.Mod="$Mod" \
Server.Name="$Name" \
Server.ListenPort="$ListenPort" \
Server.AdvertiseOnline="$AdvertiseOnline" \