Files
BT411/game/glass/btl4console.hpp
T
CydandClaude Fable 5 c4ca87b808 Miniconsole: the front end + LocalConsole marshal -- self-launched missions (step 3)
NEW gated dir game/glass/: btl4fe (green-on-black GDI catalog menu -- map/
time/weather/length/mech/color/pilot/mode/port/peers; egg writer emitting the
FULL console egg shape, golden-tested vs MP.EGG: identical section sequence
at identical line offsets, the 4 static ordinal pages verbatim, GDI-rendered
128x32/64x16 pilot-name plasma bitmaps in MP.EGG framing) and btl4console
(the marshal: a worker-thread console CLIENT speaking the btconsole.py wire
protocol verbatim -- 1040-byte chunked egg, 20s settle, RunMission x2,
STAY CONNECTED, own the clock, StopMission at expiry; logs marshal.log).
The engine sees a real connected console and runs the 100% stock ladder --
NO engine hooks (less invasive than planned: the L4APP.H setters proved
unnecessary; launches go through real argv on relaunch).

WinMain (one gated block): zero-mission-arg glass launch -> menu -> relaunch
self with the mission argv (per-mission process relaunch; BT_FE_* env arms
the marshal); post-RunMissions BT_FE_LOOP tail returns to the menu.  Menu
relaunches CLEAR the BT_FE_* handoff (found live: the inherited env re-armed
a marshal instead of showing the menu).

Verified end-to-end (synthetic menu drive): menu -> frontend.egg -> relaunch
-> marshal feeds self over loopback -> stock console ladder -> mission RUNS
(58+ ticks) -> 60s clock -> StopMission -> clean menu return, no env leak.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 23:33:39 -05:00

43 lines
1.6 KiB
C++

#pragma once
//###########################################################################
//
// btl4console -- the in-process LocalConsole marshal (BT_GLASS only).
//
// The arcade operator console is just a TCP peer speaking a documented
// wire protocol (tools/btconsole.py, constants T2-verified via
// BT_NET_PROBE): connect to each pod's -net console port, stream the
// mission egg as 1040-byte chunked ReceiveEggFileMessage packets
// (NUL-separated lines), wait the settle, send RunMissionMessage twice,
// STAY CONNECTED, own the mission clock, and send StopMissionMessage at
// expiry. This marshal plays that console from a worker thread over
// loopback (and to remote pods when hosting) -- the engine sees a real
// connected console and runs the stock ladder; NO engine hooks.
//
// The thread touches no engine state. At mission end (+grace) it
// relaunches the front-end menu (per-mission process relaunch -- the
// reconstructed gBT* globals do not survive in-process re-init) and
// exits the process.
//
//###########################################################################
//
// Start the marshal: egg file path (text form; converted to the NUL wire
// image), comma-separated pod console addresses ("127.0.0.1:1501,..."),
// and the mission length driving the stop clock. Returns 0 on thread
// start.
//
int
BTLocalConsole_Start(
const char *egg_path,
const char *pod_list,
int mission_seconds);
//
// Relaunch this exe with the given command line (empty = the menu) and
// exit the current process. Shared by the marshal's mission-end path and
// WinMain's post-mission tail.
//
void
BTFE_RelaunchSelfAndExit(const char *arguments);