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:
arcattack
2026-07-22 19:57:03 -05:00
co-authored by Claude Opus 4.8
parent 53c86fa1dd
commit 9bec4b2050
5 changed files with 89 additions and 3 deletions
+5
View File
@@ -1416,6 +1416,11 @@ void
Tell("Sent ready message to ourselves\n");
}
{
// tell the operator this pod finished loading (READY light)
extern void BTRelayNotifyReady(void);
BTRelayNotifyReady();
}
{
// relay launches that arrived MID-LOAD fire now (they could
// not enter the queue then -- see L4APP.cpp pend counter)
+49 -1
View File
@@ -159,8 +159,10 @@ enum
RELAY_ROUTE_SEAT_REQUEST= -6, // pod->relay: assign me a free seat
RELAY_ROUTE_SEAT_ASSIGN = -7, // relay->pod: int32 hostID + NUL tag
RELAY_ROUTE_SEAT_FULL = -8, // relay->pod: roster full
RELAY_ROUTE_MATCHLOG = -9 // pod->relay: matchlog upload
RELAY_ROUTE_MATCHLOG = -9, // pod->relay: matchlog upload
// (payload: filename NUL + file bytes)
RELAY_ROUTE_READY = -10 // pod->relay: mission load complete
// (operator's READY light; empty payload)
};
#define RELAY_HELLO_MAGIC 0x31525442 // 'BTR1' little-endian
// LAN auto-discovery (BT_RELAY=auto): probe broadcast on this UDP port; the
@@ -180,6 +182,7 @@ struct RelayUdpEnvelope
unsigned int sequence;
};
void BTRelayRememberGameAddress(const SOCKADDR_IN &game_address); // fwd (defined below)
void BTRelayRememberGameSocket(SOCKET game_socket); // fwd (defined below)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// BTRelayWaitStatus -- progress text into the join.bat window during the
@@ -593,6 +596,50 @@ void BTRelayRememberGameAddress(const SOCKADDR_IN &game_address)
s_relayGameAddrCached = 1;
}
//
// READY LIGHT (2026-07-22): the operator's roster shows "registered" for a
// still-loading pod and a ready one alike -- with 1-2 minute loads the
// operator can't tell who they'd be waiting on. When the app ladder reaches
// WaitingForLaunch (APP.cpp CheckLoadMessageHandler), the pod sends one
// empty route -10 frame on its live relay game socket; the relay announces
// SEAT n READY and the console GUI lights the seat green. Relay mode only;
// silent no-op otherwise.
//
static SOCKET s_relayGameSocketForReady = INVALID_SOCKET;
void BTRelayRememberGameSocket(SOCKET game_socket)
{
s_relayGameSocketForReady = game_socket;
}
void BTRelayNotifyReady(void)
{
static int s_ready_sent = 0;
if (s_ready_sent || s_relayGameSocketForReady == INVALID_SOCKET)
return;
s_ready_sent = 1;
RelayTcpEnvelope envelope;
envelope.route = RELAY_ROUTE_READY;
envelope.length = 0;
const char *data = (const char *)&envelope;
int done = 0, want = (int)sizeof(envelope);
unsigned long deadline = GetTickCount() + 2000UL;
while (done < want && GetTickCount() < deadline)
{
int sent = send(s_relayGameSocketForReady, data + done, want - done, 0);
if (sent > 0)
{
done += sent;
continue;
}
if (WSAGetLastError() != WSAEWOULDBLOCK)
break;
Sleep(10);
}
DEBUG_STREAM << "[launch] READY " << (done == want ? "sent" : "send FAILED")
<< " to the relay" << std::endl << std::flush;
}
void BTRelayUploadMatchLog(void)
{
extern const char *BTMatchLogPath();
@@ -2072,6 +2119,7 @@ void L4NetworkManager::ConnectRelayGame(HostID local_host_ID)
Fail("relay HELLO transmit failed\n");
}
relayLocalHostID = local_host_ID;
BTRelayRememberGameSocket(relayGameSocket); // READY-light notifier
DEBUG_STREAM << "[relay] game connection up, HELLO sent (hostID "
<< (int)local_host_ID << ")\n" << std::flush;