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