71 lines
1.6 KiB
Bash
71 lines
1.6 KiB
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
WINEPREFIX=${WINEPREFIX:-/data/wine/wineprefix}
|
|
WINDROSE_HOME=${WINDROSE_HOME:-/server}
|
|
WINDROSE_R5=${WINDROSE_R5:-/server/R5}
|
|
SAVED_DIR=${SAVED_DIR:-/data/Saved}
|
|
|
|
SERVER_EXE="${WINDROSE_R5}/Binaries/Win64/WindroseServer-Win64-Shipping.exe"
|
|
|
|
export WINEDEBUG=-all
|
|
export DISPLAY=
|
|
export XDG_RUNTIME_DIR=/tmp/runtime-wine
|
|
mkdir -p "$XDG_RUNTIME_DIR"
|
|
|
|
# Intel ARC Vulkan ICDs
|
|
export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/intel_icd.x86_64.json:/usr/share/vulkan/icd.d/intel_icd.i686.json"
|
|
export LIBVA_DRIVER_NAME=iHD
|
|
|
|
DXVK_32="/opt/dxvk/x32"
|
|
DXVK_64="/opt/dxvk/x64"
|
|
|
|
# Initialize wineprefix if missing
|
|
if [ ! -d "$WINEPREFIX" ] || [ ! -f "$WINEPREFIX/system.reg" ]; then
|
|
echo "Initializing wineprefix at $WINEPREFIX"
|
|
mkdir -p "$WINEPREFIX"
|
|
wineboot --init || true
|
|
|
|
echo "Installing DXVK DLLs into wineprefix..."
|
|
WIN_SYS32="$WINEPREFIX/drive_c/windows/system32"
|
|
WIN_SYSWOW64="$WINEPREFIX/drive_c/windows/syswow64"
|
|
|
|
mkdir -p "$WIN_SYS32" "$WIN_SYSWOW64"
|
|
|
|
cp "$DXVK_64"/*.dll "$WIN_SYS32"/
|
|
cp "$DXVK_32"/*.dll "$WIN_SYSWOW64"/
|
|
fi
|
|
|
|
# Force DXVK to be used
|
|
export WINEDLLOVERRIDES="d3d11,dxgi,d3d10core,d3d9=native,builtin"
|
|
|
|
mkdir -p "$SAVED_DIR"
|
|
|
|
case "${1:-}" in
|
|
run-server)
|
|
echo "Starting Windrose dedicated server..."
|
|
|
|
if [ ! -f "$SERVER_EXE" ]; then
|
|
echo "ERROR: Windrose server binary not found:"
|
|
echo " $SERVER_EXE"
|
|
exit 1
|
|
fi
|
|
|
|
cd "$(dirname "$SERVER_EXE")"
|
|
|
|
exec wine "$SERVER_EXE" \
|
|
-log \
|
|
-unattended \
|
|
-nosteam \
|
|
-savedir "$SAVED_DIR"
|
|
;;
|
|
|
|
bash)
|
|
exec /bin/bash
|
|
;;
|
|
|
|
*)
|
|
exec "$@"
|
|
;;
|
|
esac
|