Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
customize server launch with environment variables
Browse files Browse the repository at this point in the history
copied the name of these variables so they match what a lot of common of other palworld server dockers use
  • Loading branch information
ripps818 committed Feb 15, 2024
1 parent e3738f9 commit 4f34bb1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ENV PUID=99 \
RCON_ENABLED=true \
BACKUP_ENABLED=true \
OLD_BACKUP_DAYS=30 \
DELETE_OLD_BACKUPS=false
DELETE_OLD_BACKUPS=false \
COMMUNITY=

# Install Supercronic
# Latest releases available at https://github.com/aptible/supercronic/releases
Expand Down
42 changes: 35 additions & 7 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash
export WINEDEBUG=-all

steamcmd_url="https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip"

if [ ! -d "$WINEPREFIX" ]; then
printf "\e[0;32m%s\e[0m\n" "Initializing Wine configuration"
wineboot --init && wineserver -w
fi

# Install steamcmd executable
if [ ! -f /app/steamcmd.exe ]; then
steamcmd_url="https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip"
printf "\e[0;32m%s\e[0m\n" "Downloading SteamCmd for Windows"
wget -O /app/steamcmd.zip ${steamcmd_url}
unzip /app/steamcmd.zip*
Expand All @@ -17,9 +18,10 @@ if [ ! -f /app/steamcmd.exe ]; then
fi

# Install Visual C++ Runtime
/usr/bin/winetricks \
--optout -f -q vcrun2022 && \
wineserver -w
trickscmd=("/usr/bin/winetricks")
trickscmd+=("--optout -f -q vcrun2022")
echo "${trickscmd[*]}"
exec "${trickscmd[@]}"

# Update Palworld Server
if [ "${UPDATE_ON_BOOT,,}" = true ]; then
Expand All @@ -32,6 +34,32 @@ fi

# Start Palworld Server
printf "\e[0;32m%s\e[0m\n" "Starting Palword Server"
/usr/bin/wine \
/app/steamapps/common/PalServer/Pal/Binaries/Win64/PalServer-Win64-Test-Cmd.exe \
-useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS

startcmd=("/usr/bin/wine")
paldir="/app/steamapps/common/PalServer/Pal/Binaries/Win64"
palcmd="${paldir}/PalServer-Win64-Test-Cmd.exe"
startcmd+=("${palcmd}")

if ! fileExists "${startcmd[0]}"; then
echo "Try restarting with UPDATE_ON_BOOT=true"
exit 1
fi

if [ -n "${PORT}" ]; then
startcmd+=("-port=${PORT}")
fi

if [ -n "${QUERY_PORT}" ]; then
startcmd+=("-queryport=${QUERY_PORT}")
fi

if [ "${MULTITHREADING,,}" = true ]; then
startcmd+=("-useperfthreads" "-NoAsyncLoadingThread" "-UseMultithreadForDS")
fi

if [ "${COMMUNITY,,}" = true ]; then
startcmd+=("EpicApp=PalServer")
fi

echo "${startcmd[*]}"
exec "${startcmd[@]}"

0 comments on commit 4f34bb1

Please sign in to comment.