Skip to content

Commit

Permalink
Merge pull request #3 from sveken/main
Browse files Browse the repository at this point in the history
Add initial automated modding support
  • Loading branch information
bredo228 authored Jul 15, 2024
2 parents c2d8082 + 6e9043d commit 43a7568
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ RUN apt update \

RUN mkdir /Logs \
&& chown -R container:container /Logs

RUN mkdir -p /RML /RML/rml_mods /RML/rml_libs /RML/rml_config \
&& chown -R container:container /RML
USER container

USER container
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ Additional variables are
This image by default stores the Config files and logs in named volumes that persist between container restarts/recreation. The cache and database are automatically cleared every restart of the headless or container.
If you prefer to bind all the locations to a location on the host for easy management then use something like [compose-bindmount-example.yml](examples/compose-bindmount-example.yml)

The installation of the headless inside the container is wiped every time the container is deleted or updated so you can start fresh with a new container.
However if you are wanting to mod your headless server this behavior is not ideal. [Please read the modding section to change this.](modding)
Modding is currently WIP [Please Read our Modding Section](modding)
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ STEAM_PASS="YourSteamPassword"
BETA_CODE="SteamBetaCode"
STEAM_BRANCH="headless"
LOG_RETENTION="30"
ENABLE_MODS="false"
2 changes: 1 addition & 1 deletion modding/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Modding Resonite Headless Container

## NOTE: As of writing this mods are currently broken under dotnet8
## NOTE: Currently WIP and beung automated

To mod the headless some changes need to be made to the default compose file.

Expand Down
1 change: 1 addition & 0 deletions portainer/environment-portainer-examples
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ STEAM_PASS=steampasswordhere
BETA_CODE=betacodehere
STEAM_BRANCH=headless
LOG_RETENTION=30
ENABLE_MODS=false
7 changes: 6 additions & 1 deletion scripts/launch-resonite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@ rm -r /home/container/Headless/Cache
find /Logs -type f -name *.log -atime +${LOG_RETENTION:-30} -delete

cd /home/container/Headless/net8.0
dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ ${ADDITIONAL_ARGUMENTS}

if [ "${ENABLE_MODS}" = "true" ]; then
dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ -LoadAssembly Libraries/ResoniteModLoader.dll ${ADDITIONAL_ARGUMENTS}
else
dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ ${ADDITIONAL_ARGUMENTS}
fi
22 changes: 22 additions & 0 deletions scripts/update-resonite.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
#!/bin/sh

HEADLESS_DIRECTORY="/home/container/Headless/net8.0"

/home/container/steamcmd/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} +force_install_dir /home/container +app_update 2519830 -beta ${STEAM_BRANCH} -betapassword ${BETA_CODE} +quit

# Fix for issue with NVR.json migrations exploding
ln -sf /home/container/Migrations /home/container/Headless/Migrations

#Mod installation if ENABLE_MODS is true. Heavily inspired and pulled from work by Spex. Thank you
if [ "${ENABLE_MODS}" = "true" ]; then

# Create Libraries directory for RML to live in
mkdir -p ${HEADLESS_DIRECTORY}/Libraries

# Create RML directories on RML volume, mods and config will be stored in here.
mkdir -p /RML/rml_mods /RML/rml_libs /RML/rml_config

# Symlink rml_mods, rml_libs and rml_config to where Resonite will read them.
ln -s /RML/rml_mods ${HEADLESS_DIRECTORY}/rml_mods
ln -s /RML/rml_libs ${HEADLESS_DIRECTORY}/rml_libs
ln -s /RML/rml_config ${HEADLESS_DIRECTORY}/rml_config

# Download RML and 0harmony
curl -SslL https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/0Harmony-Net8.dll -o ${HEADLESS_DIRECTORY}/rml_libs/0Harmony-Net8.dll
curl -SslL https://github.com/resonite-modding-group/ResoniteModLoader/releases/latest/download/ResoniteModLoader.dll -o ${HEADLESS_DIRECTORY}/Libraries/ResoniteModLoader.dll

fi

0 comments on commit 43a7568

Please sign in to comment.