Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Fix #11 by Changing Working Directory #13

Merged
merged 1 commit into from
Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore the docker-compose override file
docker-compose.override.yml

# Ignore any local files and folders that may be loaded by the user
/*.local.*
/*.local/
13 changes: 9 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
if [[ ! -s "${CONFIG}"/SpaceEngineers-Dedicated.cfg ]]; then
# Upsert a default configuration with sane defaults for this containerized environment.
: ${WORLD_SAVE_WINE_PATH:="C:\\\users\\\root\\\AppData\\\Roaming\\\SpaceEngineersDedicated\\\Saves\\"}
: ${PREMADE_WINE_PATH:="C:\\\space-engineers-server\\\Content\\\CustomWorlds\\\Star System"}
: ${PREMADE_WINE_PATH:="C:\\\SpaceEngineersDedicatedServer\\\Content\\\CustomWorlds\\\Star System"}

declare -A defaults=(
[SteamPort]="${STEAM_PORT}"
Expand All @@ -26,9 +26,10 @@ if [[ ! -s "${CONFIG}"/SpaceEngineers-Dedicated.cfg ]]; then
[LoadWorld]="${WORLD_SAVE_WINE_PATH}\\${WORLD_NAME}"
[PremadeCheckpointPath]="${PREMADE_WINE_PATH}"
)

modifications=()
for tag in "${!defaults[@]}"; do
modifications+=("-e" "s=<${tag}>.*</${tag}>=<${tag}>${defaults[$tag]}</${tag}>=g")
modifications+=("-e" "s#<${tag}>.*</${tag}>#<${tag}>${defaults[$tag]}</${tag}>#g")
done

</home/root/SpaceEngineers-Dedicated.cfg sed "${modifications[@]}" >"${CONFIG}"/SpaceEngineers-Dedicated.cfg
Expand All @@ -44,7 +45,11 @@ steamcmd \
# on a multi-homed server, or multiple instances of this game.
: ${SERVER_IP:="0.0.0.0"}

# Change the working directory to the directory containing the steam binaries,
# otherwise the game server won't start.
cd "${WORK}/DedicatedServer64"

exec wine64 \
C:\\SpaceEngineersDedicatedServer\\DedicatedServer64\\SpaceEngineersDedicated.exe \
SpaceEngineersDedicated.exe \
-noconsole -ignorelastsession \
-ip "${SERVER_IP}" -path "$(winepath -w -0 "${CONFIG}")"
-ip "${SERVER_IP}" -path "$(winepath -w "${CONFIG}")"