READY light: pods report load-complete to the operator roster
The roster showed "registered" for a still-loading pod and a ready one alike -- with multi-minute contended loads the operator couldn't tell who they'd be waiting on. When the app ladder reaches WaitingForLaunch the pod sends one empty route -10 frame on its live relay game socket (BTRelayNotifyReady; socket mirrored at HELLO); the relay announces SEAT n READY (k/m loaded) and the console GUI lights the seat bright-green with a "N pod(s) LOADED+READY" banner. Verified LIVE by the operator: blue (seated) -> teal (registered) -> green (ready) in order, twice. Also resolved the load-speed mystery: loads are ~30s uncontended; the 1-2+ minute cases were assistant background test runs competing with the user's interactive sessions on the same machine (memory note added -- no game-spawning tests while the user is testing). 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
53c86fa1dd
commit
9bec4b2050
@@ -226,6 +226,7 @@ ROUTE_SEAT_REQUEST = -6 # client->relay: assign me a free roster seat
|
||||
ROUTE_SEAT_ASSIGN = -7 # relay->client: int32 hostID + NUL-terminated tag
|
||||
ROUTE_SEAT_FULL = -8 # relay->client: no free seats
|
||||
ROUTE_MATCHLOG = -9 # client->relay: matchlog upload (filename NUL + bytes)
|
||||
ROUTE_READY = -10 # client->relay: mission load complete (READY light)
|
||||
# the 18 certified mech tags (mirror of the FE kVehicles catalog)
|
||||
VEHICLE_TAGS = {"blkhawk", "loki", "bhk1", "madcat", "thor", "owens",
|
||||
"own1", "thr1", "lok1", "mad1", "avatar", "ava1",
|
||||
@@ -925,6 +926,15 @@ class Relay:
|
||||
if other is not conn:
|
||||
self._send_control(other, ROUTE_PEER_UP, host_id)
|
||||
return
|
||||
if route == ROUTE_READY:
|
||||
conn.ready = True
|
||||
ready_count = sum(1 for c in self.by_host.values()
|
||||
if getattr(c, "ready", False))
|
||||
i = conn.host_id - FIRST_GAME_HOST_ID
|
||||
tag = self.roster[i] if 0 <= i < len(self.roster) else "?"
|
||||
print(f"[relay] SEAT {conn.host_id} READY tag='{tag}' "
|
||||
f"({ready_count}/{len(self.by_host)} loaded)", flush=True)
|
||||
return
|
||||
if route == ROUTE_BCAST:
|
||||
env = struct.pack(ENV_FMT_TCP, conn.host_id, len(payload))
|
||||
for other in list(self.by_host.values()):
|
||||
|
||||
+14
-2
@@ -46,11 +46,12 @@ import eggmodel # noqa: E402
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
ST_SEATED = "seated"
|
||||
ST_READY = "ready"
|
||||
ST_IDLE, ST_EGG, ST_REGISTERED, ST_LAUNCHED = (
|
||||
"waiting", "egg sent", "registered", "LAUNCHED")
|
||||
ST_COLORS = {ST_IDLE: "#666666", ST_EGG: "#b58900",
|
||||
ST_REGISTERED: "#2aa198", ST_LAUNCHED: "#33cc55",
|
||||
ST_SEATED: "#268bd2"}
|
||||
ST_SEATED: "#268bd2", ST_READY: "#8be000"}
|
||||
|
||||
|
||||
class SessionMonitor:
|
||||
@@ -65,6 +66,7 @@ class SessionMonitor:
|
||||
RE_RELAY_SEAT = re.compile(
|
||||
r"SEAT (\d+) PRESENT tag='([^']*)' callsign='([^']*)' mech='([^']*)'")
|
||||
RE_RELAY_FREED = re.compile(r"SEAT (\d+) FREED tag='([^']*)'")
|
||||
RE_RELAY_READY = re.compile(r"SEAT (\d+) READY tag='([^']*)'")
|
||||
RE_MESH_EGG = re.compile(r"\[([^\]]+)\] egg sent")
|
||||
RE_MESH_RUN = re.compile(r"\[([^\]]+)\] RunMission #(\d+) sent")
|
||||
|
||||
@@ -112,10 +114,16 @@ class SessionMonitor:
|
||||
self.state[tag] = ST_IDLE
|
||||
self.seat_info.pop(tag, None)
|
||||
changed = True
|
||||
m = self.RE_RELAY_READY.search(line)
|
||||
if m:
|
||||
tag = m.group(2)
|
||||
if tag in self.state:
|
||||
self.state[tag] = ST_READY
|
||||
changed = True
|
||||
m = self.RE_RELAY_REG.search(line)
|
||||
if m:
|
||||
tag = self.host_tag(int(m.group(1)))
|
||||
if tag:
|
||||
if tag and self.state.get(tag) != ST_READY:
|
||||
self.state[tag] = ST_REGISTERED
|
||||
changed = True
|
||||
m = self.RE_RELAY_DOWN.search(line)
|
||||
@@ -713,11 +721,15 @@ class Operator(QMainWindow):
|
||||
parts.append('<span style="color:%s">⬤</span> %s <i>%s</i>'
|
||||
% (ST_COLORS[state], tag, state))
|
||||
seated = sum(1 for s in self.monitor.state.values() if s == ST_SEATED)
|
||||
ready_n = sum(1 for s in self.monitor.state.values() if s == ST_READY)
|
||||
if self.monitor.launched:
|
||||
head = "LAUNCHED — mission running"
|
||||
if (self.console_proc and not self.end_btn.isEnabled()
|
||||
and not getattr(self, "end_sent", False)):
|
||||
self.end_btn.setEnabled(True)
|
||||
elif ready_n:
|
||||
head = ("%d pod(s) LOADED+READY — LAUNCH starts them instantly"
|
||||
% ready_n)
|
||||
elif self.monitor.ready:
|
||||
head = "ALL PODS READY — press LAUNCH MISSION"
|
||||
elif seated:
|
||||
|
||||
Reference in New Issue
Block a user