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>
80 lines
2.5 KiB
C
80 lines
2.5 KiB
C
#pragma once
|
|
|
|
#include "..\munga\style.h"
|
|
|
|
//########################################################################
|
|
//############################ RPL4 Front End ############################
|
|
//########################################################################
|
|
//
|
|
// The in-game race setup: shown when the game starts with no egg, no
|
|
// network, and no mission-review mode. Presents the Death Race catalog
|
|
// (track / vehicle / color / badge / time / weather / length + pilot
|
|
// name), builds the mission egg locally - the same NotationFile text
|
|
// TeslaConsole generated, including the pre-rendered plasma name
|
|
// bitmaps - and hands its path back for the standard egg-load path.
|
|
//
|
|
// Returns True with egg_path_out filled when the player launches;
|
|
// False if they close the window instead.
|
|
//
|
|
Logical
|
|
RPL4FrontEnd_Run(
|
|
HINSTANCE instance,
|
|
HWND main_window,
|
|
char *egg_path_out,
|
|
int egg_path_size
|
|
);
|
|
|
|
// The race length (seconds; 0 = endless) selected at the last
|
|
// successful launch - the local console marshals the mission with it.
|
|
int
|
|
RPL4FrontEnd_LastMissionSeconds();
|
|
|
|
// [pilots]-order pilot names of the last launched race (owner first),
|
|
// comma separated - labels for the network console's results intake.
|
|
const char *
|
|
RPL4FrontEnd_LastPilotNames();
|
|
|
|
// How the last Run() ended: a plain race, hosting a network race (the
|
|
// console marshals the other pods), or entering one as a member pod
|
|
// (the lobby owner's console marshals us; no local egg, no console).
|
|
enum FELaunchMode
|
|
{
|
|
FELaunchSingle = 0,
|
|
FELaunchHost,
|
|
FELaunchMember
|
|
};
|
|
int
|
|
RPL4FrontEnd_LastLaunchMode();
|
|
|
|
// The player's persisted loadout (lobby member data). Buffers: 24/16/24.
|
|
void
|
|
RPL4FrontEnd_GetLoadout(char *vehicle, char *color, char *badge);
|
|
|
|
// Hosted-race pilots fed by the Steam lobby: overrides the
|
|
// RP412HOSTPODS parsing with real personas and loadouts. owner_address
|
|
// is this pod's mesh IP (the FakeIP); count 0 clears the override.
|
|
struct FEHostedPilot
|
|
{
|
|
char address[64]; // mesh (game port) address for [pilots]
|
|
char name[32];
|
|
char vehicle[24];
|
|
char color[16];
|
|
char badge[24];
|
|
};
|
|
void
|
|
RPL4FrontEnd_SetHostedPilots(
|
|
const char *owner_address,
|
|
const FEHostedPilot *pilots,
|
|
int count
|
|
);
|
|
|
|
// The between-races results screen: shows the last mission's final
|
|
// scores (from the local console) with a CONTINUE button. Returns
|
|
// immediately when there are no results (first boot). False only if
|
|
// the player closed the window instead of continuing.
|
|
Logical
|
|
RPL4FrontEnd_ShowResults(
|
|
HINSTANCE instance,
|
|
HWND main_window
|
|
);
|