Unreachable-server UX: message boxes + bat guidance instead of a 'crash'
Field report (first internet-join attempt): both join bats 'hard crash' on the remote machine. Root cause was procedural -- the host session was not running -- but the failure PRESENTATION was the bug: Release Fail() is a bare abort(), so a dead relay = silent process death + instantly-closing console window. - L4NET: the two player-facing dead-ends (LAN discovery no-answer, seat request unreachable/full) now show a MessageBox saying what happened and what to do before exiting (verified live against a dead relay: 'BattleTech -- can't join the game' appears). - join bats: echo + pause after exit so the window stays readable; join_lan.bat header now says it is LAN-only (the remote user ran both -- join_lan can never work over the internet). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
d173f088a6
commit
dfd1894fb9
@@ -354,6 +354,17 @@ L4NetworkManager::L4NetworkManager():
|
||||
//
|
||||
if (!RelayDiscover(&relayConsoleAddress))
|
||||
{
|
||||
// Release Fail() is a bare abort() -- without this box a
|
||||
// player just sees a "crash" (field report 2026-07-18)
|
||||
MessageBoxA(NULL,
|
||||
"No game server answered on this network.\n\n"
|
||||
"join_lan.bat only works on the SAME network as the\n"
|
||||
"operator's machine. Joining over the internet?\n"
|
||||
"Use join.bat instead.\n\n"
|
||||
"On the operator's own network: make sure the\n"
|
||||
"operator has pressed Start Session, then try again.",
|
||||
"BattleTech -- can't find the game server",
|
||||
MB_OK | MB_ICONERROR);
|
||||
Fail("BT_RELAY=auto: no relay answered on this LAN\n");
|
||||
}
|
||||
}
|
||||
@@ -402,6 +413,18 @@ L4NetworkManager::L4NetworkManager():
|
||||
{
|
||||
if (!RelayRequestSeat())
|
||||
{
|
||||
char seat_error[256];
|
||||
sprintf(seat_error,
|
||||
"Could not join the game at %s:%d.\n\n"
|
||||
"Either the operator has not started the session\n"
|
||||
"yet, the game is full, or the server is not\n"
|
||||
"reachable from here.\n\n"
|
||||
"Check with the operator and run join.bat again.",
|
||||
inet_ntoa(relayConsoleAddress.sin_addr),
|
||||
(int)ntohs(relayConsoleAddress.sin_port));
|
||||
MessageBoxA(NULL, seat_error,
|
||||
"BattleTech -- can't join the game",
|
||||
MB_OK | MB_ICONERROR);
|
||||
Fail("relay seat request failed (roster full or relay "
|
||||
"unreachable)\n");
|
||||
}
|
||||
|
||||
@@ -4,3 +4,8 @@ rem is assigned automatically by the operator console.
|
||||
set BT_RELAY=107.202.218.169:1500
|
||||
cd /d %~dp0content
|
||||
..\build\Release\btl4.exe -egg OPERATOR.EGG -net 1501
|
||||
echo.
|
||||
echo The game has exited. If you did NOT quit on purpose,
|
||||
echo the session may not be running yet or the server was
|
||||
echo unreachable -- check with the operator and try again.
|
||||
pause
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
@echo off
|
||||
rem BT411 -- join the LAN game. Finds the operator
|
||||
rem console AND your seat automatically.
|
||||
rem BT411 -- join the game from the operator's OWN
|
||||
rem network (LAN) -- finds the console automatically.
|
||||
rem Joining over the INTERNET? Use join.bat instead.
|
||||
set BT_RELAY=auto
|
||||
cd /d %~dp0content
|
||||
..\build\Release\btl4.exe -egg OPERATOR.EGG -net 1501
|
||||
echo.
|
||||
echo The game has exited. If you did NOT quit on purpose,
|
||||
echo the session may not be running yet or the server was
|
||||
echo unreachable -- check with the operator and try again.
|
||||
pause
|
||||
|
||||
+10
-4
@@ -706,6 +706,11 @@ 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 the session may not be running yet or the server was\n"
|
||||
"echo unreachable -- check with the operator and 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"
|
||||
@@ -713,16 +718,17 @@ class Operator(QMainWindow):
|
||||
"set BT_RELAY=%s:%d\n"
|
||||
"cd /d %%~dp0content\n"
|
||||
"..\\build\\Release\\btl4.exe -egg %s -net 1501\n"
|
||||
% (host, host, self.f_port.value(), egg_name))
|
||||
% (host, host, self.f_port.value(), egg_name) + 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 LAN game. Finds the operator\n"
|
||||
"rem console AND your seat automatically.\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"
|
||||
"cd /d %%~dp0content\n"
|
||||
"..\\build\\Release\\btl4.exe -egg %s -net 1501\n"
|
||||
% egg_name)
|
||||
% egg_name + tail)
|
||||
self.log.appendPlainText(
|
||||
"exported join.bat + join_lan.bat to %s (public host: %s) -- "
|
||||
"one file for everyone; the relay assigns seats"
|
||||
|
||||
Reference in New Issue
Block a user