Files
BT411/game/glass/btl4lobby.hpp
T
CydandClaude Fable 5 f703bb1d56 Steam: the lobby + IDENTITY-TOKEN roster -- internet MP code-complete (step 4c)
NEW gated (BT_STEAM) game/glass/btl4lobby: an ISteamMatchmaking room replacing
the arcade Site-Management screen -- host creates (lobby data btl4=1), members
join by filter, pilots publish name/mech/color, the host ENTER mints the
roster and signals GO.

THE FAKEIP LESSON (live-verified, prior-art assumption DISPROVEN): a fresh
process gets a DIFFERENT FakeIP, so menu-time fake addresses go stale by
mission time -- the first cycle timed out connecting to its own stale address.
Redesign: roster addresses are opaque ipv4-shaped TOKENS (169.254.77.N with
ports 1501/1502) minted by the host at GO, mapped to Steam IDENTITIES;
connections ride ConnectP2P(identity, channel) with console=0/game=1 virtual
ports; the map reaches mission processes via env (BT_FE_MYFAKE +
BT_FE_STEAMMAP); the GetMyAddress seam feeds the pod its own token for roster
self-match; CheckSocket reports peers by token.  L4STEAMNET reworked (no
FakeIP allocation at all); the marshal gained the Steam-wire branch.

Verified single-machine (ON/ON, live Steam): menu -> HOST STEAM LOBBY ->
room -> GO -> token map minted -> egg roster carries the token -> mission
process up with 1 roster token incl. self -> pod self-matches -> stock
console ladder -> mission RUNS (46 ticks).  Remaining: the live 2-account
cross-machine session (docs/STEAM_TEST.md).

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

62 lines
2.2 KiB
C++

#pragma once
//###########################################################################
//
// btl4lobby -- the Steam lobby (BT_STEAM only): an ISteamMatchmaking room
// replacing the arcade Site-Management screen for internet MP testing.
//
// The MENU process runs the lobby (the Steam transport is installed there
// first, so each member's FakeIP is known): members publish their fake
// address/ports + pilot identity as lobby member data; the host's room
// screen lists members and its ENTER writes the GO signal; everyone then
// relaunches into the mission -- the host with the marshal armed against
// the members' fake CONSOLE addresses, members as plain -net pods with
// BT_STEAM_NET=1 waiting to be fed over the Steam wire.
//
// Known limitation (documented): the lobby object does not survive the
// per-mission process relaunch -- after a mission everyone re-joins from
// the menu. FakeIP stability across the immediate relaunch is assumed
// (Valve persists assignments per app+account); the live 2-account test
// is the step's exit criterion (docs/STEAM_TEST.md).
//
//###########################################################################
struct BTLobbyMember
{
char name[32];
char fakeAddress[48]; // the minted roster TOKEN ip
int consolePort; // token console port (1501)
int gamePort; // token game port (1502)
char vehicle[16];
char color[16];
int isSelf;
unsigned long long steamID;
};
struct BTLobbyRoster
{
int memberCount;
BTLobbyMember members[8];
};
//
// Host: create the lobby, run the room screen, on ENTER write GO and fill
// the roster (self first). Returns 0 = launch, nonzero = cancelled.
//
int
BTLobby_HostAndRoom(
const char *pilot_name, const char *vehicle, const char *color,
BTLobbyRoster *roster_out,
char *my_token_out, int my_token_capacity,
char *steam_map_out, int steam_map_capacity);
//
// Member: find + join a lobby, run the room screen, return when the host
// signals GO. Returns 0 = launch, nonzero = cancelled / none found.
//
int
BTLobby_JoinAndWait(
const char *pilot_name, const char *vehicle, const char *color,
char *my_token_out, int my_token_capacity,
char *steam_map_out, int steam_map_capacity);