From 3de30a14d71c21d4cd419731f079d2a3a2951d7c Mon Sep 17 00:00:00 2001 From: Cyd Date: Tue, 11 Aug 2026 15:21:00 -0500 Subject: [PATCH] The cockpit is decided before it is built Playback was laying out a pod's cockpit over a camera's recording - five instrument panes and the map back in the middle - and it already knew better. StartConnecting works the answer out from the local host's type and sets it, but StartConnecting runs after the mission is created and the cockpit is built before that. The log said so in order: the egg read at line 9, SVGA16 fitting the cockpit at line 20, and the Live Cam line arriving at 25. The answer was right and five lines late. The egg carries it, so read it where the egg is already open: the first entry in [pilots] is the station that owned the race, and its own section gives the hostType. That is early enough, and StartConnecting still confirms the same fact from the host table afterwards. SVGA16: secondary displays ... map 100% SVGA16: map on the bottom left (L4MAPPOS) where it had been radar, centred, on L4RADARPOS. That is the loop closed: a Live Cam records a race, and the recording replays with the camera's own cockpit over it. Co-Authored-By: Claude Opus 5 (1M context) --- MUNGA_L4/L4SPLR.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/MUNGA_L4/L4SPLR.cpp b/MUNGA_L4/L4SPLR.cpp index 5f0bdd2..0a17fc4 100644 --- a/MUNGA_L4/L4SPLR.cpp +++ b/MUNGA_L4/L4SPLR.cpp @@ -285,6 +285,46 @@ L4PlaybackNetworkManager::L4PlaybackNetworkManager(): networkEggNotationFile = new NotationFile(egg_name); Register_Object(networkEggNotationFile); + // + // Decide now whether this is a camera station, not later. + // + // StartConnecting already works this out from the local host's type and + // sets it - but StartConnecting runs after the mission is created, and + // the cockpit is built before that. The log says so plainly: the egg is + // read here, SVGA16 fits the cockpit eleven lines later, and the Live + // Cam line arrives five lines after THAT. So a camera's recording came + // back with a pod's cockpit over it - five instrument panes and the map + // in the middle - because the answer arrived after the panes had been + // made. + // + // The egg has it: the first entry in [pilots] is the station that + // owned the race, and its own section carries the hostType. Reading it + // here is early enough, and it is the same fact StartConnecting will + // confirm from the host table afterwards. + // + const char *owner_address; + + if (networkEggNotationFile->GetEntry("pilots", "pilot", &owner_address)) + { + int owner_host_type = 0; + + if (networkEggNotationFile->GetEntry( + owner_address, "hostType", &owner_host_type)) + { + Logical owner_is_camera = + (owner_host_type == (int) CameraShipHostType); + + Application::SetCameraStation(owner_is_camera); + DEBUG_STREAM << "Playback: the owning station '" << owner_address + << "' recorded as hostType " << owner_host_type + << (owner_is_camera + ? " - a Live Cam, so no instrument panes and the map" + " landscape in the corner" + : " - a pod, so the full cockpit") + << "\n" << std::flush; + } + } + // // The handler is NetworkManager's, and it ends in CreateMission, which // is what calls StartConnecting below to read the host table back out