RPL4LOBBY implements the multiplayer front door on ISteamMatchmaking. The setup menu grows HOST STEAM RACE / JOIN STEAM RACE buttons when the Steam wire is live; hosting creates a tagged public lobby, joining finds one. Every member publishes FakeIP + fake ports + persona + loadout as member data; the room screen lists members (host marked) and gives the owner a launch button. Launching writes a nonced go-roster into lobby data. Each pod registers every peer with the Steam transport (two-port peer table: engine console/game ports map to Steam fake ports on connect) and enters the race: the owner through the hosted-race path - it builds the multi-pilot egg from real personas and loadouts and its console marshals everyone - and members as network pods that boot straight into WaitingForEgg for the owner to feed over the wire. The lobby outlives races: members loop back through WinMain into the room (no local console needed - MissionCompleted is waived for member races), and the owner returns to the room after its results screen. Leaving the lobby clears the hosted-race priming. Verified on this box: menu buttons appear under RP412STEAM=1, hosting creates a lobby on the Steam backend, the room runs and leaves back to the menu; single-player cycling and the LAN hosted race both still pass. Full three-account mesh test is next, on real hardware. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
49 lines
1.7 KiB
C
49 lines
1.7 KiB
C
#pragma once
|
|
|
|
#include "..\munga\style.h"
|
|
|
|
//########################################################################
|
|
//########################### RPL4 Steam Lobby ###########################
|
|
//########################################################################
|
|
//
|
|
// The multiplayer front door (docs/RP412-FRONTEND-DESIGN.md section 3):
|
|
// an ISteamMatchmaking lobby stands in for the arcade's Site Management
|
|
// screen. Every member publishes its FakeIP + fake ports + persona +
|
|
// loadout as lobby member data; the owner is the console. Launching
|
|
// writes a "go" roster into lobby data - each pod registers every
|
|
// peer with the Steam transport and enters the race, the owner
|
|
// through the hosted-race path (it builds the egg and marshals), the
|
|
// members as network pods waiting for the owner's console connection.
|
|
//
|
|
// The lobby OBJECT outlives races - that is the point of the single
|
|
// binary. After a race everyone lands back in the room for the next
|
|
// launch.
|
|
//
|
|
// Compiled to stubs without RP412_STEAM.
|
|
//
|
|
enum RPL4LobbyOutcome
|
|
{
|
|
LobbyRoomLeft = 0, // player left the lobby - back to the menu
|
|
LobbyRoomClosed, // window went away - quit
|
|
LobbyLaunchHost, // owner launched: hosted-race path is primed
|
|
LobbyLaunchMember // owner launched: enter the race as a pod
|
|
};
|
|
|
|
// True when the Steam transport is up (lobby UI is offered).
|
|
Logical
|
|
RPL4Lobby_Available();
|
|
|
|
// True while we sit in a lobby (races return to the room).
|
|
Logical
|
|
RPL4Lobby_InRoom();
|
|
|
|
// Create a lobby / find-and-join one, then run the room screen.
|
|
int
|
|
RPL4Lobby_Host(HINSTANCE instance, HWND main_window);
|
|
int
|
|
RPL4Lobby_Join(HINSTANCE instance, HWND main_window);
|
|
|
|
// Re-enter the room of the lobby we are already in (post-race).
|
|
int
|
|
RPL4Lobby_Room(HINSTANCE instance, HWND main_window);
|