rust: add support for Carbon, a rust modding framework (#43)

This commit is contained in:
João Brázio 2023-09-30 21:08:29 +01:00 committed by GitHub
parent 2d150d4260
commit fc00b710fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}"