Upgrade Doorstop to version 4.4.1 (#1156)

This commit is contained in:
Arrowmaster authored and GitHub committed 2025-09-10 10:46:59 +02:00
1 parent 0d627cdcf4
commit 8ad052a491
3 files changed
+111 -72

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@ Unity plugin framework
**[User and developer guides](https://bepinex.github.io/bepinex_docs/master/articles/index.html)**
## Used libraries
- [NeighTools/UnityDoorstop](https://github.com/NeighTools/UnityDoorstop) - 4.4.0 ([851712b](https://github.com/NeighTools/UnityDoorstop/commit/851712bfef21c90e01c951e024609e76716d55f9))
- [NeighTools/UnityDoorstop](https://github.com/NeighTools/UnityDoorstop) - 4.4.1 ([226bd1d](https://github.com/NeighTools/UnityDoorstop/commit/226bd1d7964a16c7479cc92151ee30ce4f8fc418))
- [BepInEx/HarmonyX](https://github.com/BepInEx/HarmonyX) - 2.7.0 ([2537257](https://github.com/BepInEx/HarmonyX/commit/253725768e59b0e1ea90105cdbcc4a0a477422c7))
- [MonoMod/MonoMod](https://github.com/MonoMod/MonoMod) - v21.12.13.01 ([ede81f4](https://github.com/MonoMod/MonoMod/commit/ede81f48924d58abf05359409fad740fe2b0dfb5))
- [jbevain/cecil](https://github.com/jbevain/cecil) - 0.10.4 ([98ec890](https://github.com/jbevain/cecil/commit/98ec890d44643ad88d573e97be0e120435eda732))
+1 -1
View File
@@ -4,7 +4,7 @@
#addin nuget:?package=Cake.Json&version=7.0.1
#addin nuget:?package=Newtonsoft.Json&version=13.0.3
const string DOORSTOP_VER = "4.4.0";
const string DOORSTOP_VER = "4.4.1";
var target = Argument("target", "Build");
var isBleedingEdge = Argument("bleeding_edge", false);
+109 -70
View File
@@ -8,8 +8,6 @@
# 1. Via CLI: Run ./run_bepinex.sh <path to game> [doorstop arguments] [game arguments]
# 2. Via config: edit the options below and run ./run.sh without any arguments
# 0 is false, 1 is true
# LINUX: name of Unity executable
# MACOS: name of the .app directory
executable_name=""
@@ -19,6 +17,7 @@ executable_name=""
# General Config Options
# Enable Doorstop?
# 0 is false, 1 is true
enabled="1"
# Path to the assembly to load and execute
@@ -51,45 +50,61 @@ debug_address="127.0.0.1:10000"
# If 1 and debug_enabled is 1, Mono debugger server will suspend the game execution until a debugger is attached
debug_suspend="0"
# CoreCLR options (IL2CPP)
# Path to coreclr shared library WITHOUT THE EXTENSION that contains the CoreCLR runtime
coreclr_path=""
# Path to the directory containing the managed core libraries for CoreCLR (mscorlib, System, etc.)
corlib_dir=""
################################################################################
# Everything past this point is the actual script
# Special case: program is launched via Steam
# In that case rerun the script via their bootstrapper to ensure Steam overlay works
if [ "$2" = "SteamLaunch" ]; then
# Conceptually: exec "$1" "$2" "$3" "$4" "$0" "rest of $@"
# But newer versions of Steam interleave the $1..$4 with some "--" arguments, so preserve them as well
# Bash has array subscripting, but POSIX sh doesn't, so avoid it
to_rotate=4
rotated=0
while [ $((to_rotate-=1)) -ge 0 ]; do
while [ "z$1" = "z--" ]; do
set -- "$@" "$1"
shift
rotated=$((rotated+1))
steam_arg_helper() {
if [ "$executable_name" != "" ] && [ "$1" != "${1%"$executable_name"}" ]; then
return 0
elif [ "$executable_name" = "" ] && [ "$1" != "${1%.x86_64}" ]; then
return 0
elif [ "$executable_name" = "" ] && [ "$1" != "${1%.x86}" ]; then
return 0
else
return 1
fi
}
for a in "$@"; do
if [ "$a" = "SteamLaunch" ]; then
rotated=0; max=$#
while [ $rotated -lt $max ]; do
if steam_arg_helper "$1"; then
to_rotate=$(($# - rotated))
set -- "$@" "$0"
while [ $((to_rotate-=1)) -ge 0 ]; do
set -- "$@" "$1"
shift
done
exec "$@"
else
set -- "$@" "$1"
shift
rotated=$((rotated+1))
fi
done
set -- "$@" "$1"
shift
rotated=$((rotated+1))
done
to_rotate=$(($# - rotated))
set -- "$@" "$0"
while [ $((to_rotate-=1)) -ge 0 ]; do
set -- "$@" "$1"
shift
done
exec "$@"
fi
echo "Please set executable_name to a valid name in a text editor" 1>&2
exit 1
fi
done
# Handle first param being executable name
if [ -x "$1" ] ; then
executable_name="$1"
echo "Target executable: $1"
shift
fi
if [ -z "${executable_name}" ] || [ ! -x "${executable_name}" ]; then
echo "Please set executable_name to a valid name in a text editor or as the first command line parameter"
echo "Please set executable_name to a valid name in a text editor or as the first command line parameter" 1>&2
exit 1
fi
@@ -100,50 +115,48 @@ arch=""
executable_path=""
lib_extension=""
abs_path() {
# Resolve relative path to absolute from BASEDIR
if [ "$1" = "${1#/}" ]; then
set -- "${BASEDIR}/${1}"
fi
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
# Set executable path and the extension to use for the libdoorstop shared object
os_type="$(uname -s)"
case ${os_type} in
Linux*)
executable_path="${executable_name}"
# Handle relative paths
if ! echo "$executable_path" | grep "^/.*$"; then
executable_path="${BASEDIR}/${executable_path}"
fi
executable_path="$(abs_path "$executable_name")"
lib_extension="so"
;;
Darwin*)
real_executable_name="${executable_name}"
# Handle relative directories
if ! echo "$real_executable_name" | grep "^/.*$"; then
real_executable_name="${BASEDIR}/${real_executable_name}"
fi
real_executable_name="$(abs_path "$executable_name")"
# If we're not even an actual executable, check .app Info for actual executable
if ! echo "$real_executable_name" | grep "^.*\.app/Contents/MacOS/.*"; then
# Add .app to the end if not given
if ! echo "$real_executable_name" | grep "^.*\.app$"; then
real_executable_name="${real_executable_name}.app"
fi
inner_executable_name=$(defaults read "${real_executable_name}/Contents/Info" CFBundleExecutable)
executable_path="${real_executable_name}/Contents/MacOS/${inner_executable_name}"
else
executable_path="${executable_name}"
fi
case $real_executable_name in
*.app/Contents/MacOS/*)
executable_path="${executable_name}"
;;
*)
# Add .app to the end if not given
if [ "$real_executable_name" = "${real_executable_name%.app}" ]; then
real_executable_name="${real_executable_name}.app"
fi
inner_executable_name=$(defaults read "${real_executable_name}/Contents/Info" CFBundleExecutable)
executable_path="${real_executable_name}/Contents/MacOS/${inner_executable_name}"
;;
esac
lib_extension="dylib"
;;
*)
# alright whos running games on freebsd
echo "Unknown operating system ($(uname -s))"
echo "Make an issue at https://github.com/NeighTools/UnityDoorstop"
echo "Unknown operating system ($(uname -s))" 1>&2
echo "Make an issue at https://github.com/NeighTools/UnityDoorstop" 1>&2
exit 1
;;
esac
abs_path() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
}
_readlink() {
# relative links with readlink (without -f) do not preserve the path info
ab_path="$(abs_path "$1")"
@@ -155,7 +168,6 @@ _readlink() {
echo "$link"
}
resolve_executable_path () {
e_path="$(abs_path "$1")"
@@ -165,9 +177,8 @@ resolve_executable_path () {
echo "${e_path}"
}
# Get absolute path of executable and show to user
# Get absolute path of executable
executable_path=$(resolve_executable_path "${executable_path}")
echo "${executable_path}"
# Figure out the arch of the executable with file
file_out="$(LD_PRELOAD="" file -b "${executable_path}")"
@@ -179,10 +190,10 @@ case "${file_out}" in
arch="x86"
;;
*)
echo "The executable \"${executable_path}\" is not compiled for x86 or x64 (might be ARM?)"
echo "If you think this is a mistake (or would like to encourage support for other architectures)"
echo "Please make an issue at https://github.com/NeighTools/UnityDoorstop"
echo "Got: ${file_out}"
echo "The executable \"${executable_path}\" is not compiled for x86 or x64 (might be ARM?)" 1>&2
echo "If you think this is a mistake (or would like to encourage support for other architectures)" 1>&2
echo "Please make an issue at https://github.com/NeighTools/UnityDoorstop" 1>&2
echo "Got: ${file_out}" 1>&2
exit 1
;;
esac
@@ -200,49 +211,78 @@ doorstop_bool() {
}
# Read from command line
while :; do
i=0; max=$#
while [ $i -lt $max ]; do
case "$1" in
--doorstop_enabled)
--doorstop_enabled) # For backwards compatibility. Renamed to --doorstop-enabled
enabled="$(doorstop_bool "$2")"
shift
i=$((i+1))
;;
--doorstop_target_assembly)
--doorstop_target_assembly) # For backwards compatibility. Renamed to --doorstop-target-assembly
target_assembly="$2"
shift
i=$((i+1))
;;
--doorstop-enabled)
enabled="$(doorstop_bool "$2")"
shift
i=$((i+1))
;;
--doorstop-target-assembly)
target_assembly="$2"
shift
i=$((i+1))
;;
--doorstop-boot-config-override)
boot_config_override="$2"
shift
i=$((i+1))
;;
--doorstop-mono-dll-search-path-override)
dll_search_path_override="$2"
shift
i=$((i+1))
;;
--doorstop-mono-debug-enabled)
debug_enable="$(doorstop_bool "$2")"
shift
i=$((i+1))
;;
--doorstop-mono-debug-suspend)
debug_suspend="$(doorstop_bool "$2")"
shift
i=$((i+1))
;;
--doorstop-mono-debug-address)
debug_address="$2"
shift
i=$((i+1))
;;
--doorstop-clr-runtime-coreclr-path)
coreclr_path="$2"
shift
i=$((i+1))
;;
--doorstop-clr-corlib-dir)
corlib_dir="$2"
shift
i=$((i+1))
;;
*)
if [ -z "$1" ]; then
break
fi
rest_args="$rest_args $1"
set -- "$@" "$1"
;;
esac
shift
i=$((i+1))
done
target_assembly="$(abs_path "$target_assembly")"
# Move variables to environment
export DOORSTOP_ENABLED="$enabled"
export DOORSTOP_TARGET_ASSEMBLY="$target_assembly"
export DOORSTOP_BOOT_CONFIG_OVERRIDE="$boot_config_override"
export DOORSTOP_IGNORE_DISABLED_ENV="$ignore_disable_switch"
export DOORSTOP_MONO_DLL_SEARCH_PATH_OVERRIDE="$dll_search_path_override"
export DOORSTOP_MONO_DEBUG_ENABLED="$debug_enable"
@@ -269,5 +309,4 @@ else
export DYLD_INSERT_LIBRARIES="${doorstop_name}:${DYLD_INSERT_LIBRARIES}"
fi
# shellcheck disable=SC2086
exec "$executable_path" $rest_args
exec "$executable_path" "$@"