"Race" is Red Planet's term (it's a racing game) and rode in with the
RPL4LOBBY port. In BattleTech the gameplay unit is a MISSION. Sweep it out
of the front-end / lobby / marshal code + the roadmap and steamification
digest: rename the public API BTLobby_Push/PullRaceResults ->
Push/PullMissionResults, the internal PrimeHostedRace -> PrimeHostedMission,
the deferred marshal InstallNetworkRace -> InstallNetworkMission, and the
user-facing strings ("STEAM MISSION LOBBY", "L A U N C H M I S S I O N",
"HOST/JOIN STEAM MISSION"). Comments follow. No behavior change; both gates
(default + BT412_STEAM) still build + link clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
100 lines
4.3 KiB
C++
100 lines
4.3 KiB
C++
//===========================================================================//
|
|
// btl4fe.hpp -- BT412 in-game front end: local mission-egg builder.
|
|
//
|
|
// Replaces the external operator console for solo / host play: a mission is
|
|
// configured from an in-process catalog and the mission egg is built LOCALLY
|
|
// (the exact NotationFile the console used to stream), then fed through the
|
|
// standard -egg load path (L4Application::SetEggNotationFileName).
|
|
//
|
|
// This is the Workstream B foundation (docs/BT412-ROADMAP.md Phase 5); the
|
|
// interactive on-screen menu, the LocalConsole marshal, and the results
|
|
// screen build on top of this egg builder.
|
|
//===========================================================================//
|
|
#ifndef BTL4FE_HPP
|
|
#define BTL4FE_HPP
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// Catalogs (the console's RPConfig.xml equivalent for BattleTech).
|
|
//---------------------------------------------------------------------------//
|
|
extern const char *const kBTMaps[]; // NULL-terminated
|
|
extern const char *const kBTMechs[]; // NULL-terminated (base + variants)
|
|
extern const char *const kBTColors[]; // NULL-terminated
|
|
extern int BTCatalogCount(const char *const *list);
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// One participant's loadout.
|
|
//---------------------------------------------------------------------------//
|
|
struct BTFePilot
|
|
{
|
|
char address[32]; // "ip[:port]" -- the mesh roster key
|
|
char name[24]; // pilot name (also the plasma name bitmap)
|
|
char vehicle[16]; // mech, e.g. "bhk1"
|
|
char color[16]; // "White" / "Red" / ...
|
|
char badge[8]; // e.g. "VGL"
|
|
char patch[16]; // e.g. "Yellow"
|
|
char dropzone[8]; // "one" ...
|
|
int bitmapindex; // 1..N (which ordinal/name slot)
|
|
int advancedDamage; // 0/1
|
|
int loadzones; // 0/1
|
|
};
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// A whole mission before it becomes an egg.
|
|
//---------------------------------------------------------------------------//
|
|
struct BTFeMission
|
|
{
|
|
char map[16]; // e.g. "cavern"
|
|
char scenario[16]; // "freeforall"
|
|
char timeOfDay[8]; // "day" / "night"
|
|
char weather[16]; // "clear" ...
|
|
int temperature; // e.g. 27
|
|
int lengthSeconds; // mission time limit
|
|
int pilotCount;
|
|
BTFePilot pilots[8];
|
|
};
|
|
|
|
// Fill a mission with sensible solo defaults (map=grass, one local pilot).
|
|
void BTFeMission_Default(BTFeMission *mission);
|
|
|
|
// Write the mission as an egg NotationFile to `path`. Returns True on success.
|
|
// Emits [mission] / [ordinals]+4 rank bitmaps / [pilots] / per-pilot sections /
|
|
// [largebitmap]+[smallbitmap] (GDI-rendered pilot names) / role models -- the
|
|
// exact structure the console streamed (verified against content/MP.EGG).
|
|
int BTFeMission_WriteEgg(const BTFeMission *mission, const char *path);
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// Front-end mode: no -egg, no -net on the command line. Build a solo egg
|
|
// from the default loadout and point the engine at it. Returns True if it
|
|
// took over (an egg was built + set), False to fall through to the old path.
|
|
//---------------------------------------------------------------------------//
|
|
int BTFrontEnd_Run();
|
|
|
|
// The mission length (seconds; 0 = endless) the player chose on the last
|
|
// LAUNCH -- WinMain arms the LocalConsole marshal with it.
|
|
int BTFrontEnd_LastMissionSeconds();
|
|
|
|
// Show the post-mission scoreboard (marshal snapshot) until dismissed.
|
|
void BTFrontEnd_ShowResults();
|
|
|
|
//---------------------------------------------------------------------------//
|
|
// Steam lobby glue (used by btl4lobby): the local pilot's loadout the lobby
|
|
// publishes as member data, and the hosted-pilot override the lobby feeds so
|
|
// the owner's egg carries every member as a pilot.
|
|
//---------------------------------------------------------------------------//
|
|
struct FEHostedPilot
|
|
{
|
|
char address[64]; // mesh (game-port) address for [pilots]
|
|
char name[32];
|
|
char vehicle[24];
|
|
char color[16];
|
|
char badge[24];
|
|
};
|
|
void BTFrontEnd_GetLoadout(char *vehicle, char *color, char *badge);
|
|
void BTFrontEnd_SetHostedPilots(const char *owner_address,
|
|
const FEHostedPilot *pilots, int count);
|
|
|
|
// The last LAUNCH's mode: 0 single-player, 1 lobby host, 2 lobby member.
|
|
int BTFrontEnd_LastLaunchMode();
|
|
|
|
#endif // BTL4FE_HPP
|