now also assuring that -console is stripped out
This commit is contained in:
+18
-8
@@ -57,17 +57,26 @@ if [ ! -d "$GAME_ROOT" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── 1. rev.ini: ensure -vulkan launch parameter ──────────────────────────────
|
# ── 1. rev.ini: ensure -vulkan launch parameter, strip -console ─────────────
|
||||||
# Uses Python operating on the raw file bytes rather than sed — rev.ini has
|
# Uses Python operating on the raw file bytes rather than sed — rev.ini has
|
||||||
# Windows-style CRLF line endings, and two earlier sed-based attempts here
|
# Windows-style CRLF line endings, and two earlier sed-based attempts here
|
||||||
# both mishandled embedded/stray \r characters in different ways, corrupting
|
# both mishandled embedded/stray \r characters in different ways, corrupting
|
||||||
# the ProcName line. This version is fully idempotent and self-correcting:
|
# the ProcName line. This version is fully idempotent and self-correcting:
|
||||||
# it strips any \r and any existing -vulkan occurrence(s) from the matched
|
# it strips any \r, strips any existing -vulkan occurrence(s), and strips any
|
||||||
# span (using a lookahead for the TRUE \r?\n line ending, so it can't stop
|
# existing -console occurrence(s) from the matched span (using a lookahead
|
||||||
# early on a stray embedded \r the way earlier attempts did), then cleanly
|
# for the TRUE \r?\n line ending, so it can't stop early on a stray embedded
|
||||||
# re-adds -vulkan exactly once — producing the same correct result whether
|
# \r the way earlier attempts did), then cleanly re-adds -vulkan exactly
|
||||||
# the line was already correct, missing -vulkan, or corrupted from a prior
|
# once — producing the same correct result whether the line was already
|
||||||
# buggy run.
|
# correct, missing -vulkan, had -console, or corrupted from a prior buggy
|
||||||
|
# run.
|
||||||
|
#
|
||||||
|
# -console must never survive here: it forces the in-game developer console
|
||||||
|
# open from boot, which the whole autoexec.cfg console lockdown (con_enable
|
||||||
|
# 0, blanked toggleconsole/showconsole/hideconsole aliases) cannot suppress
|
||||||
|
# retroactively — those only stop it being toggled back OPEN after startup,
|
||||||
|
# they don't stop it opening in the first place. A shipped nosteam.zip's raw
|
||||||
|
# rev.ini has been observed to carry -console by default, so this has to be
|
||||||
|
# stripped on every prep run, the same way -vulkan has to be re-added.
|
||||||
REV_INI="$GAME_ROOT/rev.ini"
|
REV_INI="$GAME_ROOT/rev.ini"
|
||||||
if [ -f "$REV_INI" ]; then
|
if [ -f "$REV_INI" ]; then
|
||||||
if grep -q "^ProcName=" "$REV_INI"; then
|
if grep -q "^ProcName=" "$REV_INI"; then
|
||||||
@@ -82,6 +91,7 @@ def fix_line(match):
|
|||||||
line = match.group(0)
|
line = match.group(0)
|
||||||
line = line.replace(b'\r', b'')
|
line = line.replace(b'\r', b'')
|
||||||
line = re.sub(rb'\s*-vulkan\s*', b'', line)
|
line = re.sub(rb'\s*-vulkan\s*', b'', line)
|
||||||
|
line = re.sub(rb'\s*-console\b', b'', line)
|
||||||
return line + b' -vulkan'
|
return line + b' -vulkan'
|
||||||
|
|
||||||
new_content, n = re.subn(
|
new_content, n = re.subn(
|
||||||
@@ -97,7 +107,7 @@ if n == 0:
|
|||||||
with open(path, 'wb') as f:
|
with open(path, 'wb') as f:
|
||||||
f.write(new_content)
|
f.write(new_content)
|
||||||
PYEOF
|
PYEOF
|
||||||
echo "[rev.ini] ProcName line normalized with -vulkan"
|
echo "[rev.ini] ProcName line normalized with -vulkan, -console stripped"
|
||||||
else
|
else
|
||||||
echo "WARNING: [rev.ini] no ProcName= line found — check manually" >&2
|
echo "WARNING: [rev.ini] no ProcName= line found — check manually" >&2
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user