Harden player bats: location guard for 'cannot find path specified'
Field report: a remote player ran join.bat from the wrong place (inside
the zip, or the .bat separated from content\/build\) and got 'The system
cannot find the path specified' + dumps -- the relative 'cd %~dp0content'
failed cryptically.
Now each bat: cd to its own dir, verify build\Release\btl4.exe +
content\<egg> exist, else jump to :badpath and print a clear message
('this file must sit in the extracted folder next to content and build;
right-click the zip - Extract All and run it from there'). Verified: run
from a dir with no content/build -> the guidance prints, no dump.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
9690043e57
commit
0b83d71578
+21
-3
@@ -1,9 +1,12 @@
|
||||
@echo off
|
||||
rem BT411 -- join 107.202.218.169's game (internet). Your seat/mech
|
||||
rem is assigned automatically by the operator console.
|
||||
rem BT411 -- join 107.202.218.169's game (internet). Seat/mech assigned
|
||||
rem by the operator. Keep this file next to content\ + build\.
|
||||
cd /d %~dp0
|
||||
if not exist "build\Release\btl4.exe" goto badpath
|
||||
if not exist "content\OPERATOR.EGG" goto badpath
|
||||
set BT_RELAY=107.202.218.169:1500
|
||||
set BT_LOG=join.log
|
||||
cd /d %~dp0content
|
||||
cd content
|
||||
..\build\Release\btl4.exe -egg OPERATOR.EGG -net 1501
|
||||
echo.
|
||||
echo The game has exited. If you did NOT quit on purpose
|
||||
@@ -11,3 +14,18 @@ echo (crash, or it never connected), send the operator the
|
||||
echo file content\join.log so they can see what happened.
|
||||
echo Otherwise the session may not be up yet -- try again.
|
||||
pause
|
||||
exit /b
|
||||
:badpath
|
||||
echo.
|
||||
echo ==================================================
|
||||
echo ERROR: this file is not in the right place.
|
||||
echo.
|
||||
echo It must sit in the EXTRACTED game folder, next to
|
||||
echo the 'content' and 'build' folders.
|
||||
echo.
|
||||
echo Fix: right-click the .zip - Extract All, open the
|
||||
echo extracted folder, and run this file from THERE.
|
||||
echo (Do NOT run it from inside the zip.)
|
||||
echo ==================================================
|
||||
echo.
|
||||
pause
|
||||
|
||||
+20
-3
@@ -1,10 +1,12 @@
|
||||
@echo off
|
||||
rem BT411 -- join the game from the operator's OWN
|
||||
rem network (LAN) -- finds the console automatically.
|
||||
rem BT411 -- join the operator's LAN game (auto-discovers).
|
||||
rem Joining over the INTERNET? Use join.bat instead.
|
||||
cd /d %~dp0
|
||||
if not exist "build\Release\btl4.exe" goto badpath
|
||||
if not exist "content\OPERATOR.EGG" goto badpath
|
||||
set BT_RELAY=auto
|
||||
set BT_LOG=join.log
|
||||
cd /d %~dp0content
|
||||
cd content
|
||||
..\build\Release\btl4.exe -egg OPERATOR.EGG -net 1501
|
||||
echo.
|
||||
echo The game has exited. If you did NOT quit on purpose
|
||||
@@ -12,3 +14,18 @@ echo (crash, or it never connected), send the operator the
|
||||
echo file content\join.log so they can see what happened.
|
||||
echo Otherwise the session may not be up yet -- try again.
|
||||
pause
|
||||
exit /b
|
||||
:badpath
|
||||
echo.
|
||||
echo ==================================================
|
||||
echo ERROR: this file is not in the right place.
|
||||
echo.
|
||||
echo It must sit in the EXTRACTED game folder, next to
|
||||
echo the 'content' and 'build' folders.
|
||||
echo.
|
||||
echo Fix: right-click the .zip - Extract All, open the
|
||||
echo extracted folder, and run this file from THERE.
|
||||
echo (Do NOT run it from inside the zip.)
|
||||
echo ==================================================
|
||||
echo.
|
||||
pause
|
||||
|
||||
+23
-5
@@ -1,11 +1,29 @@
|
||||
@echo off
|
||||
rem BT411 -- single-player practice mission (no network,
|
||||
rem no operator needed). Edit the -egg name below to try
|
||||
rem other maps (ARENA1/ARENA2/DBASE/FOGDAY/...).
|
||||
rem BT411 -- single-player practice (no network, no operator).
|
||||
rem Edit the -egg below for other maps (ARENA2/DBASE/FOGDAY/...).
|
||||
cd /d %~dp0
|
||||
if not exist "build\Release\btl4.exe" goto badpath
|
||||
if not exist "content\OPERATOR.EGG" goto badpath
|
||||
set BT_START_INSIDE=1
|
||||
cd /d %~dp0content
|
||||
set BT_LOG=join.log
|
||||
cd content
|
||||
..\build\Release\btl4.exe -egg ARENA1.EGG
|
||||
echo.
|
||||
echo The game has exited. If it closed unexpectedly,
|
||||
echo send the operator the file content\btl4.log.
|
||||
echo send the operator content\join.log.
|
||||
pause
|
||||
exit /b
|
||||
:badpath
|
||||
echo.
|
||||
echo ==================================================
|
||||
echo ERROR: this file is not in the right place.
|
||||
echo.
|
||||
echo It must sit in the EXTRACTED game folder, next to
|
||||
echo the 'content' and 'build' folders.
|
||||
echo.
|
||||
echo Fix: right-click the .zip - Extract All, open the
|
||||
echo extracted folder, and run this file from THERE.
|
||||
echo (Do NOT run it from inside the zip.)
|
||||
echo ==================================================
|
||||
echo.
|
||||
pause
|
||||
|
||||
+59
-36
@@ -755,47 +755,70 @@ class Operator(QMainWindow):
|
||||
# first-come-first-served (no BT_SELF), so every player gets the SAME
|
||||
# file -- who flies which mech is whoever sits down first, exactly
|
||||
# like walking up to a pod.
|
||||
tail = ("echo.\n"
|
||||
"echo The game has exited. If you did NOT quit on purpose\n"
|
||||
"echo (crash, or it never connected), send the operator the\n"
|
||||
"echo file content\\join.log so they can see what happened.\n"
|
||||
"echo Otherwise the session may not be up yet -- try again.\n"
|
||||
"pause\n")
|
||||
# LOCATION GUARD (field report 2026-07-18: 'cannot find path specified'
|
||||
# + dumps): the bat MUST sit in the extracted folder next to content\
|
||||
# and build\. Running it from inside the zip (or after moving just the
|
||||
# .bat) broke the relative cd with a cryptic error. Check first and
|
||||
# give a clear message instead.
|
||||
def guarded(header, sets, run, tail):
|
||||
return ("@echo off\n" + header +
|
||||
"cd /d %~dp0\n"
|
||||
"if not exist \"build\\Release\\btl4.exe\" goto badpath\n"
|
||||
"if not exist \"content\\" + egg_name +
|
||||
"\" goto badpath\n" +
|
||||
sets +
|
||||
"cd content\n" + run + tail +
|
||||
"exit /b\n"
|
||||
":badpath\n"
|
||||
"echo.\n"
|
||||
"echo ==================================================\n"
|
||||
"echo ERROR: this file is not in the right place.\n"
|
||||
"echo.\n"
|
||||
"echo It must sit in the EXTRACTED game folder, next to\n"
|
||||
"echo the 'content' and 'build' folders.\n"
|
||||
"echo.\n"
|
||||
"echo Fix: right-click the .zip - Extract All, open the\n"
|
||||
"echo extracted folder, and run this file from THERE.\n"
|
||||
"echo (Do NOT run it from inside the zip.)\n"
|
||||
"echo ==================================================\n"
|
||||
"echo.\n"
|
||||
"pause\n")
|
||||
net_tail = ("echo.\n"
|
||||
"echo The game has exited. If you did NOT quit on purpose\n"
|
||||
"echo (crash, or it never connected), send the operator the\n"
|
||||
"echo file content\\join.log so they can see what "
|
||||
"happened.\n"
|
||||
"echo Otherwise the session may not be up yet -- try "
|
||||
"again.\n"
|
||||
"pause\n")
|
||||
with open(os.path.join(out_dir, "join.bat"), "w", newline="\r\n") as f:
|
||||
f.write("@echo off\n"
|
||||
"rem BT411 -- join %s's game (internet). Your seat/mech\n"
|
||||
"rem is assigned automatically by the operator console.\n"
|
||||
"set BT_RELAY=%s:%d\n"
|
||||
"set BT_LOG=join.log\n"
|
||||
"cd /d %%~dp0content\n"
|
||||
"..\\build\\Release\\btl4.exe -egg %s -net 1501\n"
|
||||
% (host, host, self.f_port.value(), egg_name) + tail)
|
||||
f.write(guarded(
|
||||
"rem BT411 -- join %s's game (internet). Seat/mech assigned\n"
|
||||
"rem by the operator. Keep this file next to content\\ + "
|
||||
"build\\.\n" % host,
|
||||
"set BT_RELAY=%s:%d\nset BT_LOG=join.log\n"
|
||||
% (host, self.f_port.value()),
|
||||
"..\\build\\Release\\btl4.exe -egg %s -net 1501\n" % egg_name,
|
||||
net_tail))
|
||||
with open(os.path.join(out_dir, "join_lan.bat"), "w",
|
||||
newline="\r\n") as f:
|
||||
f.write("@echo off\n"
|
||||
"rem BT411 -- join the game from the operator's OWN\n"
|
||||
"rem network (LAN) -- finds the console automatically.\n"
|
||||
"rem Joining over the INTERNET? Use join.bat instead.\n"
|
||||
"set BT_RELAY=auto\n"
|
||||
"set BT_LOG=join.log\n"
|
||||
"cd /d %%~dp0content\n"
|
||||
"..\\build\\Release\\btl4.exe -egg %s -net 1501\n"
|
||||
% egg_name + tail)
|
||||
# solo practice: no server involved -- the game self-launches a
|
||||
# single-player mission (no -net argument = no console wait)
|
||||
f.write(guarded(
|
||||
"rem BT411 -- join the operator's LAN game (auto-discovers).\n"
|
||||
"rem Joining over the INTERNET? Use join.bat instead.\n",
|
||||
"set BT_RELAY=auto\nset BT_LOG=join.log\n",
|
||||
"..\\build\\Release\\btl4.exe -egg %s -net 1501\n" % egg_name,
|
||||
net_tail))
|
||||
with open(os.path.join(out_dir, "play_solo.bat"), "w",
|
||||
newline="\r\n") as f:
|
||||
f.write("@echo off\n"
|
||||
"rem BT411 -- single-player practice mission (no network,\n"
|
||||
"rem no operator needed). Edit the -egg name below to try\n"
|
||||
"rem other maps (ARENA1/ARENA2/DBASE/FOGDAY/...).\n"
|
||||
"set BT_START_INSIDE=1\n"
|
||||
"cd /d %~dp0content\n"
|
||||
"..\\build\\Release\\btl4.exe -egg ARENA1.EGG\n"
|
||||
"echo.\n"
|
||||
"echo The game has exited. If it closed unexpectedly,\n"
|
||||
"echo send the operator the file content\\btl4.log.\n"
|
||||
"pause\n")
|
||||
f.write(guarded(
|
||||
"rem BT411 -- single-player practice (no network, no "
|
||||
"operator).\n"
|
||||
"rem Edit the -egg below for other maps "
|
||||
"(ARENA2/DBASE/FOGDAY/...).\n",
|
||||
"set BT_START_INSIDE=1\nset BT_LOG=join.log\n",
|
||||
"..\\build\\Release\\btl4.exe -egg ARENA1.EGG\n",
|
||||
"echo.\necho The game has exited. If it closed unexpectedly,\n"
|
||||
"echo send the operator content\\join.log.\npause\n"))
|
||||
self.log.appendPlainText(
|
||||
"exported join.bat + join_lan.bat + play_solo.bat to %s "
|
||||
"(public host: %s) -- join bats are universal; the relay "
|
||||
|
||||
Reference in New Issue
Block a user