„install-xash3ds.sh“ ändern

This commit is contained in:
DeltaLima 2022-08-21 13:28:03 +00:00
parent b2f17c9732
commit e669104fb6

View file

@ -9,19 +9,27 @@ metamod_url="https://github.com/mittorn/metamod-p/releases/download/1/metamod.so
amxmod_url="http://www.amxmodx.org/release/amxmodx-$amxmod_version-base-linux.tar.gz"
jk_botti_url="http://koti.kapsi.fi/jukivili/web/jk_botti/jk_botti-$jk_botti_version-release.tar.xz"
XASH3D_BASEDIR=$(pwd)/build/xashds
mkdir -p $XASH3D_BASEDIR
XASH3D_BASEDIR=$(pwd)/build
mkdir -p $XASH3D_BASEDIR/result
# Prerequisits satisfied?
sudo dpkg --add-architecture i386
apt-get install -y --no-install-recommends build-essential ca-certificates cmake curl git gnupg2 g++-multilib lib32gcc1-s1 libstdc++6:i386 python unzip xz-utils zip
## compile xash3ds
# go to build directory
cd $XASH3D_BASEDIR
git clone --recursive https://github.com/FWGS/xash3d
mkdir -p xash3d/build
cd xash3d/build
cmake -DXASH_DEDICATED=ON -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" ../
make
mv engine/xash3d XASH3D_BASEDIR/xash3ds
mv engine/xash3d $XASH3D_BASEDIR/result/xash3ds
## get half-life data from steam
mkdir -p $XASH3D_BASEDIR/steam
cd $XASH3D_BASEDIR/steam
echo "login anonymous
force_install_dir ./xashds
app_set_config 90 mod valve
@ -29,18 +37,18 @@ app_update 90
app_update 90
app_update 90 validate
app_update 90 validate
quit" > ../../build/hlds.install
quit" > $XASH3D_BASEDIR/steam/hlds.install
cd ../../build
curl -sL "$steamcmd_url" | tar xzvf -
./steamcmd.sh +runscript hlds.install
curl -sLJO "$hlds_url"
unzip "hlds_build_$hlds_build.zip" -d "/opt/steam/hlds_build_$hlds_build"
mv "hlds_build_$hlds_build/hlds"/* xashds/
rm -rf "hlds_build_$hlds_build" "hlds_build_$hlds_build.zip"
mv "hlds_build_$hlds_build/hlds"/* $XASH3D_BASEDIR/result/
touch $XASH3D_BASEDIR/valve/listip.cfg
touch $XASH3D_BASEDIR/valve/banned.cfg
cd $XASH3D_BASEDIR
touch $XASH3D_BASEDIR/result/valve/listip.cfg
touch $XASH3D_BASEDIR/result/valve/banned.cfg
echo "./xash3ds +ip 0.0.0.0:27015 -pingboost 1" > $XASH3D_BASEDIR/result/start.sh
chmod +x $XASH3D_BASEDIR/result/start.sh
cd $XASH3D_BASEDIR/result