Operator console: relay-mode local instances go through the JOIN menu
The Launch-local-instances path pinned BT_SELF, which claims a seat directly and SKIPS the seat request -- the join menu (and the callsign/ mech choice it carries) never ran, so a local test instance couldn't exercise the walk-up flow. Relay-mode local instances now launch zero-arg with BT_FE_JOIN=1: the JOIN-GAME menu opens, the relay assigns the seat, and the choice lands in the egg like any join.bat player. Each instance gets a distinct relaunch port via BT_FE_JOINPORT (btl4main JoinRelay case; default 1501) -- two -net listeners can't share a port on one box. Mesh-mode locals keep the direct path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
fcedc046cf
commit
95735db5ae
+8
-2
@@ -461,11 +461,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
// BT_FE_JOIN (join.bat): the callsign/mech request rides env
|
||||
// into the relaunched pod; L4NET's SEAT_REQUEST carries it to
|
||||
// the relay, which writes it into the session egg. Args = the
|
||||
// universal join contract (join.bat's own OPERATOR.EGG/1501).
|
||||
// universal join contract (OPERATOR.EGG + port 1501); the
|
||||
// operator console overrides the port per LOCAL instance via
|
||||
// BT_FE_JOINPORT (two instances on one box can't share -net).
|
||||
SetEnvironmentVariableA("BT_FE_EGG", NULL);
|
||||
SetEnvironmentVariableA("BT_CALLSIGN", fe_spec.joinCallsign);
|
||||
SetEnvironmentVariableA("BT_MECH", fe_spec.joinVehicle);
|
||||
strcpy(fe_arguments, "-egg OPERATOR.EGG -net 1501 -platform glass");
|
||||
{
|
||||
const char *join_port = getenv("BT_FE_JOINPORT");
|
||||
sprintf(fe_arguments, "-egg OPERATOR.EGG -net %d -platform glass",
|
||||
join_port != NULL ? atoi(join_port) : 1501);
|
||||
}
|
||||
break;
|
||||
#ifdef BT_STEAM
|
||||
case BTFeLaunchJoinSteam:
|
||||
|
||||
+16
-6
@@ -725,21 +725,31 @@ class Operator(QMainWindow):
|
||||
env.insert("BT_DEV_GAUGES", "1")
|
||||
if self.f_inside.isChecked():
|
||||
env.insert("BT_START_INSIDE", "1")
|
||||
args = ["-egg", os.path.basename(self.egg_path)
|
||||
if os.path.dirname(self.egg_path) == CONTENT
|
||||
else self.egg_path]
|
||||
if relay:
|
||||
# WALK-UP FLOW (2026-07-22): a relay-mode local instance goes
|
||||
# through the JOIN-GAME menu exactly like a join.bat player --
|
||||
# callsign + mech picked in the menu, seat ASSIGNED by the
|
||||
# relay (BT_SELF pinning is gone: it skipped the seat request
|
||||
# that carries the choice). Zero-arg launch = the menu; it
|
||||
# relaunches itself with -egg OPERATOR.EGG -net <BT_FE_JOINPORT>
|
||||
# (distinct per instance -- two -net listeners can't share a
|
||||
# port on one box).
|
||||
env.insert("BT_RELAY", "127.0.0.1:%d" % self.f_port.value())
|
||||
env.insert("BT_SELF", tag)
|
||||
net_port = 1501
|
||||
env.insert("BT_FE_JOIN", "1")
|
||||
env.insert("BT_FE_JOINPORT", str(1501 + 100 * r))
|
||||
args = []
|
||||
else:
|
||||
host, _, port = tag.rpartition(":")
|
||||
net_port = int(port) - 1
|
||||
args += ["-net", str(net_port)]
|
||||
env.insert("BT_LOG", "operator_%d.log" % (r + 1))
|
||||
proc = QProcess(self)
|
||||
proc.setWorkingDirectory(CONTENT)
|
||||
proc.setProcessEnvironment(env)
|
||||
proc.start(exe, ["-egg", os.path.basename(self.egg_path)
|
||||
if os.path.dirname(self.egg_path) == CONTENT
|
||||
else self.egg_path,
|
||||
"-net", str(net_port)])
|
||||
proc.start(exe, args)
|
||||
self.game_procs.append(proc)
|
||||
launched += 1
|
||||
self.log.appendPlainText("launched %d local instance(s)" % launched)
|
||||
|
||||
Reference in New Issue
Block a user