Skip to content

Commit

Permalink
Merge pull request #5 from indifferentbroccoli/feature/add-bepinex
Browse files Browse the repository at this point in the history
Add support for BepInEx
  • Loading branch information
thijsvanloef authored Sep 26, 2024
2 parents 7ffa674 + d75ae79 commit 7175fa3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM cm2network/steamcmd:root
RUN apt-get update && apt-get install -y --no-install-recommends \
libatomic1=12.2.0-14 \
libpulse-dev=16.1+dfsg1-2+b1 \
unzip=6.0-28 \
wget=1.21.3-1+b2 \
libpulse0=16.1+dfsg1-2+b1 \
libc6=2.36-9+deb12u8 \
gettext-base=0.21-12 \
Expand Down Expand Up @@ -37,7 +39,8 @@ ENV HOME=/home/steam \
NO_MAP=false \
PLAYER_EVENTS=false \
PASSIVE_MOBS=false \
NO_BUILD_COST=false
NO_BUILD_COST=false \
BEPINEX_ENABLED=false

COPY ./scripts /home/steam/server/

Expand All @@ -46,6 +49,12 @@ COPY branding /branding
RUN mkdir -p /valheim /valheim-saves && \
chmod +x /home/steam/server/*.sh

# Install BepInExPack
ENV BEPINEXPACK_VERSION=5.4.2202
RUN wget -q https://gcdn.thunderstore.io/live/repository/packages/denikson-BepInExPack_Valheim-"${BEPINEXPACK_VERSION}".zip -O /tmp/BepInExPack_Valheim.zip && \
unzip -q /tmp/BepInExPack_Valheim.zip -d /home/steam/server/BepInEx && \
rm /tmp/BepInExPack_Valheim.zip

WORKDIR /home/steam/server

HEALTHCHECK --start-period=5m \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ docker run -d \
| PLAYER_EVENTS | When set, raid events are player-based rather than world-base | false |
| PASSIVE_MOBS | Enables passive mobs. | false |
| NO_BUILD_COST | Disables building cost. | false |
| BEPINEX_ENABLED | Enables BepInEx modding. | false |

## Developer information

Expand Down
13 changes: 12 additions & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ LogAction "Starting server"
# remove double quotes from the modifiers array
MODIFIERS=("${MODIFIERS[@]//\"}")

if [ "${BEPINEX_ENABLED}" = true ]; then
LogInfo "BepInEx is enabled, starting server with BepInEx"
cp -rf /home/steam/server/BepInEx/BepInExPack_Valheim/* /valheim
export DOORSTOP_ENABLE=TRUE
export DOORSTOP_INVOKE_DLL_PATH="./BepInEx/core/BepInEx.Preloader.dll"
export DOORSTOP_CORLIB_OVERRIDE_PATH="./unstripped_corlib"
export LD_LIBRARY_PATH="./doorstop_libs:$LD_LIBRARY_PATH"
export LD_PRELOAD="libdoorstop_x64.so:$LD_PRELOAD"
export LD_LIBRARY_PATH="./linux64:$LD_LIBRARY_PATH"
fi

# shellcheck disable=SC2068
./valheim_server.x86_64 \
-name "${SERVER_NAME}" \
Expand All @@ -78,4 +89,4 @@ MODIFIERS=("${MODIFIERS[@]//\"}")
-preset "${SERVER_PRESET}" \
${MODIFIERS[@]} \
-nographics \
-batchmode
-batchmode

0 comments on commit 7175fa3

Please sign in to comment.