diff --git a/RP_L4/RPL4.CPP b/RP_L4/RPL4.CPP index 7fe3c33..95cc489 100644 --- a/RP_L4/RPL4.CPP +++ b/RP_L4/RPL4.CPP @@ -459,6 +459,31 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine int last_launch_mode = FELaunchSingle; + // + //------------------------------------------------------------------------- + // A hand-fed egg run stays unmarshaled - no console, so the race never + // ends - UNLESS it is given a length. RP412MISSIONSECONDS supplies one, + // and with it '-egg' can play a whole race through to the buzzer, the + // podium and the results. + // + // That is the difference between a shortcut that can only be watched and + // one that can be TESTED: everything after the chequered flag - the fade, + // the winners' circle, the teardown - was unreachable from the command + // line, so it could only ever be exercised by hand through the menu. + //------------------------------------------------------------------------- + // + if (!front_end_mode && L4Application::GetEggNotationFileName()) + { + const char *egg_seconds = getenv("RP412MISSIONSECONDS"); + if (egg_seconds != NULL && atoi(egg_seconds) > 0) + { + DEBUG_STREAM << "LocalConsole: marshalling the hand-fed egg run (" + << atoi(egg_seconds) << "s, RP412MISSIONSECONDS)\n" << std::flush; + L4Application::SetNetworkCommonFlatAddress(0); + RPL4LocalConsole_Install(atoi(egg_seconds)); + } + } + for (;;) { if (front_end_mode) diff --git a/pack-dist.ps1 b/pack-dist.ps1 index 8674eb0..c076990 100644 --- a/pack-dist.ps1 +++ b/pack-dist.ps1 @@ -62,7 +62,12 @@ Write-Host "Packing into $dist" # setting. This script rebuilds dist\ from scratch, which would throw exactly # those away - the one place the promise did not hold, and it is the folder we # do most of our own testing in. Carry them across. -Fresh to start over. -$keepFiles = @('environ.ini', 'bindings.txt', 'pilot.cfg', 'mfd_layout.cfg') +# frontend.egg is the menu's last selection, written on launch. It is not a +# setting, but it IS what lets '-egg frontend.egg' drop straight back into +# the track you were just testing - and a repack wiping it turns that into a +# zero-byte file and an abort on "no map in egg". +$keepFiles = @('environ.ini', 'bindings.txt', 'pilot.cfg', 'mfd_layout.cfg', + 'frontend.egg') $kept = @{} if (-not $Fresh) { foreach ($name in $keepFiles) {