From fc00b710fa2f90c8ebae91732da56504a2cf8a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Sat, 30 Sep 2023 21:08:29 +0100 Subject: [PATCH] rust: add support for Carbon, a rust modding framework (#43) --- games/rust/entrypoint.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/games/rust/entrypoint.sh b/games/rust/entrypoint.sh index 9895369..d817953 100644 --- a/games/rust/entrypoint.sh +++ b/games/rust/entrypoint.sh @@ -16,17 +16,28 @@ fi MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` echo ":/home/container$ ${MODIFIED_STARTUP}" -# OxideMod has been replaced with uMod -if [ -f OXIDE_FLAG ] || [ "${OXIDE}" = 1 ] || [ "${UMOD}" = 1 ]; then +if [[ "${FRAMEWORK}" == "carbon" ]]; then + # Carbon: https://github.com/CarbonCommunity/Carbon.Core + echo "Updating Carbon..." + curl -sSL "https://github.com/CarbonCommunity/Carbon.Core/releases/download/production_build/Carbon.Linux.Release.tar.gz" | tar zx + echo "Done updating Carbon!" + + export DOORSTOP_ENABLED=1 + export DOORSTOP_TARGET_ASSEMBLY="$(pwd)/carbon/managed/Carbon.Preloader.dll" + MODIFIED_STARTUP="LD_PRELOAD=$(pwd)/libdoorstop.so ${MODIFIED_STARTUP}" + +elif [[ "$OXIDE" == "1" ]] || [[ "${FRAMEWORK}" == "oxide" ]]; then + # Oxide: https://github.com/OxideMod/Oxide.Rust echo "Updating uMod..." curl -sSL "https://github.com/OxideMod/Oxide.Rust/releases/latest/download/Oxide.Rust-linux.zip" > umod.zip unzip -o -q umod.zip rm umod.zip echo "Done updating uMod!" +# else Vanilla, do nothing fi # Fix for Rust not starting -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd) +export LD_LIBRARY_PATH=$(pwd)/RustDedicated_Data/Plugins/x86_64:$(pwd) # Run the Server node /wrapper.js "${MODIFIED_STARTUP}"