Expand auto-hunt pursuit ranges and show server bonus effects

This commit is contained in:
shen
2026-09-30 23:02:04 -07:00
parent 922954dd97
commit eb5833747a
22 changed files with 676 additions and 82 deletions
+19 -2
View File
@@ -20,10 +20,15 @@ set -eu
SRC=${SRC:-/usr/metin2/src}
SERVER=${SERVER:-/usr/metin2/server}
HERE=$(cd "$(dirname "$0")" && pwd)
PATCHES="inventory-5-pages hunt-set shop-item-time autohunt-pull"
PATCHES="inventory-5-pages hunt-set shop-item-time autohunt-pull autohunt-pull-range"
TS=$(date +%Y%m%d-%H%M%S)
patch_state() {
# The follow-up changes the header added by the base patch.
if [ "$1" = autohunt-pull ] && patch -p1 -R -C -s -f -d "$SRC" < "$HERE/autohunt-pull-range/server.patch" > /dev/null 2>&1; then
echo applied
return
fi
if patch -p1 -R -C -s -f -d "$SRC" < "$HERE/$1/server.patch" > /dev/null 2>&1; then
echo applied
elif patch -p1 -C -s -f -d "$SRC" < "$HERE/$1/server.patch" > /dev/null 2>&1; then
@@ -36,6 +41,16 @@ patch_state() {
stop_server() {
(cd "$SERVER" && sh close.sh) > /dev/null 2>&1 || true
sleep 8
remaining=$(ps ax -o pid,command | awk '$2 ~ /^\.\/(game|db|auth)$/ {print $1}')
if [ -n "$remaining" ]; then
# Some old shut.sh scripts reference stale/missing pid files. Still request a graceful exit.
kill -TERM $remaining
attempts=0
while ps ax -o command | grep -q '^[.]/\(game\|db\|auth\)' && [ "$attempts" -lt 15 ]; do
sleep 2
attempts=$((attempts + 1))
done
fi
if ps ax -o command | grep -q '^[.]/\(game\|db\|auth\)'; then echo "server still running" >&2; exit 1; fi
}
@@ -58,7 +73,9 @@ build)
conflict) echo "$p/server.patch does not apply" >&2; exit 1 ;;
esac
done
OUT=/root/rebuild/$TS
# The legacy makefile does not track includes. Recompile commands after header patches.
touch "$SRC/server/game/src/cmd_general.cpp"
OUT=/root/rebuild/$TS
mkdir -p "$OUT"
# The Makefiles move the binary to GAMEDIR/DBDIR (default: the live share/bin).
(cd "$SRC/server/game/src" && gmake -j2 GAMEDIR="$OUT") > "$OUT/game.log" 2>&1 || { tail "$OUT/game.log" >&2; exit 1; }