From c167c3a9bab7c37a4096930c90f371dcd8196c38 Mon Sep 17 00:00:00 2001 From: Overlord Date: Fri, 17 Apr 2026 16:58:42 +0200 Subject: [PATCH] minor fixes --- init/systemd/gzw-eac-fix.service | 3 +-- scripts/fix.sh | 16 ++++------------ scripts/watch.sh | 3 +-- setup.sh | 2 -- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/init/systemd/gzw-eac-fix.service b/init/systemd/gzw-eac-fix.service index 7d70ede..169174e 100644 --- a/init/systemd/gzw-eac-fix.service +++ b/init/systemd/gzw-eac-fix.service @@ -4,7 +4,6 @@ Description=GZW EAC fix - post-update cache patch [Service] Type=oneshot ExecStart=@@INSTALL_DIR@@/fix.sh -Environment=DISPLAY=:0 -PassEnvironment=DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR +PassEnvironment=DBUS_SESSION_BUS_ADDRESS DISPLAY WAYLAND_DISPLAY XDG_RUNTIME_DIR StandardOutput=journal StandardError=journal diff --git a/scripts/fix.sh b/scripts/fix.sh index 8034346..6f19c87 100644 --- a/scripts/fix.sh +++ b/scripts/fix.sh @@ -9,7 +9,6 @@ INSTALL_DIR="@@INSTALL_DIR@@" NOTIFY="@@NOTIFY@@" LOG_MAX_LINES="@@LOG_MAX_LINES@@" POLL_INTERVAL="@@POLL_INTERVAL@@" -POST_RESTORE_WAIT="@@POST_RESTORE_WAIT@@" GAME_SUBPATH="common/Gray Zone Warfare/GZW/Content/SKALLA/PrebuildWorldData/World/cache" MANIFEST_NAME="appmanifest_${STEAM_APP_ID}.acf" @@ -22,8 +21,6 @@ EAC_FILES=( LOG_FILE="$INSTALL_DIR/${SERVICE_NAME}.log" STATE_FILE="$INSTALL_DIR/.last_known_state" -# ─── logging ────────────────────────────────────────────────────────────────── - BLUE='\033[0;34m' RED='\033[0;31m' NC='\033[0m' @@ -72,8 +69,6 @@ _notify() { notify-send -a "$SERVICE_NAME" "$1" "$2" 2>/dev/null || true } -# ─── auto-detect steam library ──────────────────────────────────────────────── - find_steam_library() { local bases=( "$HOME/.local/share/Steam" @@ -113,11 +108,10 @@ MANIFEST="$STEAM_APPS/$MANIFEST_NAME" log_info "GZW found at: $CACHE_DIR" -# ─── build state detection ──────────────────────────────────────────────────── -# +# Build State Detection: # Fingerprint = buildid + all InstalledDepots manifest IDs (sorted). # Depot manifests rotate on every content update even if the buildid doesn't. -# If fingerprint matches last run, skip the fix — nothing was actually updated. +# If fingerprint matches last run, skip the fix - nothing was actually updated. read_game_state() { local acf="$1" @@ -153,10 +147,10 @@ if [[ -n "$LAST_STATE" ]]; then log_info " Previous: $LAST_STATE" log_info " Current: $CURRENT_STATE" else - log_info "No previous state — running fix and recording baseline." + log_info "No previous state - running fix and recording baseline." fi -# ─── fix ────────────────────────────────────────────────────────────────────── +# applying fix (remove -> regenerate -> lock) _notify -i dialog-information "Applying EAC cache fix..." @@ -183,8 +177,6 @@ done log_info "Flushing disk after restore..." sync -sleep "$POST_RESTORE_WAIT" - log_info "Setting files read-only..." for f in "${EAC_FILES[@]}"; do chmod 400 "$CACHE_DIR/$f" diff --git a/scripts/watch.sh b/scripts/watch.sh index 6491827..cb9315d 100644 --- a/scripts/watch.sh +++ b/scripts/watch.sh @@ -7,7 +7,6 @@ SERVICE_NAME="@@SERVICE_NAME@@" INSTALL_DIR="@@INSTALL_DIR@@" MANIFEST_PATH="@@MANIFEST_PATH@@" - LOG_FILE="$INSTALL_DIR/${SERVICE_NAME}.log" FIX_SCRIPT="$INSTALL_DIR/fix.sh" @@ -47,6 +46,6 @@ log_info "Watching: $MANIFEST_PATH" inotifywait -m -e close_write "$MANIFEST_PATH" 2>/dev/null \ | while read -r _dir _event _file; do - log_info "Manifest changed — invoking fix..." + log_info "Manifest changed - invoking fix..." bash "$FIX_SCRIPT" done diff --git a/setup.sh b/setup.sh index 27ecc3f..9402850 100644 --- a/setup.sh +++ b/setup.sh @@ -12,7 +12,6 @@ INSTALL_DIR="$HOME/.local/share/gzw-eac-fix" NOTIFY="false" # set to true to enable desktop notifications via notify-send LOG_MAX_LINES="200" # max lines kept in the log file POLL_INTERVAL="3" # seconds between file-exists checks after steam validate -POST_RESTORE_WAIT="2" # seconds to wait after files reappear before chmod BLUE='\033[0;34m' RED='\033[0;31m' @@ -119,7 +118,6 @@ substitute() { -e "s|@@NOTIFY@@|${NOTIFY}|g" \ -e "s|@@LOG_MAX_LINES@@|${LOG_MAX_LINES}|g" \ -e "s|@@POLL_INTERVAL@@|${POLL_INTERVAL}|g" \ - -e "s|@@POST_RESTORE_WAIT@@|${POST_RESTORE_WAIT}|g" \ "$src" > "$dst" }