Files
RP412/RP_L4/RPL4CONSOLE.h
T
CydandClaude Fable 5 18c6f05cf1 Members get the score sheet: owner publishes results through the lobby
Round seven was the first complete Steam race: three machines, five
minutes, wall deaths respawning, the console ending the race on time,
and rematches launched from the same lobby. The one gap the run showed:
only the owner saw scores - members went straight back to the room.

The owner now publishes its console results (host, score, name, keyed
by the race nonce) into lobby data right after teardown; members pull
the sheet (waiting up to 8s for it to land), inject it into the local
results intake, and the same RACE RESULTS screen shows on every
machine before the room.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 00:34:34 -05:00

66 lines
2.6 KiB
C

#pragma once
#include "..\munga\style.h"
//########################################################################
//########################## RPL4 Local Console ##########################
//########################################################################
//
// The single-player marshal. Hand-fed eggs are a developer shortcut: a
// mission only ends on a console command, so without one the timer hits
// 00:00 and just counts up forever. This is the in-process console for
// front-end-launched games - it watches the mission, dispatches the
// same StopMissionMessage TeslaConsole sent when the selected length
// expires, and when the pod returns to WaitingForEgg it brings the race
// setup back up and feeds the next egg (or quits if the player closes
// the menu).
//
// Installs itself as the application manager's per-frame hook.
//
void
RPL4LocalConsole_Install(int mission_seconds);
// True when the last mission ended under the console's control (timer
// stop or pilot exit). WinMain's single-binary race loop then cycles
// back to the setup screen for the next race in the same process.
Logical
RPL4LocalConsole_MissionCompleted();
// Network race: the owner pod meshes like any pod (network mode, egg
// fed locally) while this console marshals the REMOTE pods over the
// NetTransport wire with the arcade protocol - egg chunks + ACK,
// state polling, RunMission when everyone stages, StopMission at
// expiry, EndMission score intake. remote_pod_list is a comma list of
// console channels ("ip[:port]", default CONSOLE_NET_PORT);
// pilot_names is a comma list in [pilots] order for the results
// screen. Connects synchronously (retry, like the arcade console
// redialing a booting pod); False when a pod cannot be reached.
Logical
RPL4LocalConsole_InstallNetworkRace(
int mission_seconds,
const char *egg_path,
const char *remote_pod_list,
const char *pilot_names
);
// The last completed mission's final scores (what each pod reported at
// mission end). Valid until the next mission starts running.
int
RPL4LocalConsole_ResultCount();
Logical
RPL4LocalConsole_GetResult(int index, int *host_ID, int *score);
// Pilot name for a host ID ([pilots] order; host 2 = first pilot).
// NULL when unknown - the results screen falls back to pod numbers.
const char *
RPL4LocalConsole_GetResultName(int host_ID);
// Lobby members do not marshal races - the owner publishes the score
// sheet through lobby data and it is injected here so the same results
// screen shows on every machine.
void
RPL4LocalConsole_ClearResults();
void
RPL4LocalConsole_InjectResult(int host_ID, int score, const char *name);