WebPanelHost (CoreCLR engine only): one unowned WS_POPUP over the game client area on its own STA thread and GetMessage loop, lifted from the 2026-11-07 spike's popup-free path. Open/Navigate/Close/GetState never block: they validate, update the caller-visible state under a lock, queue work and post WM_APP+1 to the host window. WebView2Loader.dll is loaded by full path from the shim's Runtime folder; the runtime probe on the panel thread decides RuntimeMissing, any later creation failure is CreateFailed. Navigation guard (NavigationStarting incl. redirects, NewWindowRequested, LaunchingExternalUriScheme): off-list http/https goes to the system browser, anything else is dropped; logs carry only Redact()ed URLs or hosts. Escape via AcceleratorKeyPressed unless PageKeepsEscape. Visibility by the PID rule on a 50 ms timer plus a foreground WinEvent; raises only when below the game; layout remembered in layout.json. Shutdown unhooks, closes the controller, destroys the window and unregisters the class before the collectible context unloads. WebPanelNativeArgs copies every string out of the caller's (stack or pooled) buffers before anything is queued. WebPanelApi is the ABI glue (AOT keeps the Unavailable stub). engine.json "WebPanel" (default true) is the kill switch. EngineLifecycle shuts the panel down after EndSceneHook.Uninstall. The WebView2 package's WinForms/WPF references are dropped before reference resolution. Deviations from the brief: IWebPanelEnvironment gains BrowserExecutableFolderForTests (the harness forces a creation failure with it) and is excluded from the AOT build with the host; Show only takes the foreground when it is already in this process (or none). tools\WebPanelHarness (x86 exe) + tools\WebPanelHarness.Payload: fake game thread, fake 16 ms pump, collectible context mirroring EngineLoadContext, local virtual hosts, posted input only. 17 ok, 0 FAIL, 4 UNVERIFIED offline (Escape via posted input never raises AcceleratorKeyPressed; visibility needs the foreground): owner in-game checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
3 KiB
XML
52 lines
3 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<!--
|
|
Offline harness for the web panel host (src\RynthCore.Engine\WebPanel\WebPanelHost.cs): a 32-bit
|
|
stand-in for acclient plus the engine. A fake game thread owns a top-level window and runs a
|
|
PeekMessage loop; a fake 16 ms pump polls the panel state from another thread; the host (built into
|
|
tools\WebPanelHarness.Payload) loads into a collectible AssemblyLoadContext that mirrors the shim's
|
|
EngineLoadContext, and must unload after Shutdown. Pages come from local folders through WebView2
|
|
virtual host mappings (https://panel.test/, https://other.test/): no network. Input is posted to
|
|
specific windows; never SendInput (live game clients share this desktop).
|
|
|
|
Needs a desktop, the Evergreen WebView2 runtime and the x86 .NET 10 runtime; it opens windows.
|
|
The folder name has no "Test" in it on purpose: scripts\Run-AllTests.ps1 does not run it.
|
|
Run (foreground): dotnet run -c Release (WEBPANEL_HARNESS_FOREGROUND=1 to opt in, see below)
|
|
The host's own Show calls SetForegroundWindow (pinned behaviour); with the opt-in the harness also asks for
|
|
it for the fake game, so the foreground-dependent checks (Escape hand-back, same-process visibility) can run.
|
|
Windows refuses either request while the user is active in another program: those checks then say UNVERIFIED.
|
|
Each check prints "ok <name>", "FAIL <name>: ..." or "UNVERIFIED <name>: ..." (could not be shown
|
|
offline; an owner in-game check). Exit 0 = every check ok, 1 = a FAIL, 2 = no FAIL but UNVERIFIED.
|
|
-->
|
|
<PropertyGroup>
|
|
<OutputType>Exe</OutputType>
|
|
<TargetFramework>net10.0-windows</TargetFramework>
|
|
<PlatformTarget>x86</PlatformTarget>
|
|
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
|
|
<SelfContained>false</SelfContained>
|
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
<Nullable>enable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<InvariantGlobalization>true</InvariantGlobalization>
|
|
<RootNamespace>WebPanelHarness</RootNamespace>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- Built first, never referenced: the payload must only ever load into the collectible context. -->
|
|
<ProjectReference Include="..\WebPanelHarness.Payload\WebPanelHarness.Payload.csproj" ReferenceOutputAssembly="false" Private="false" />
|
|
</ItemGroup>
|
|
|
|
<Target Name="CopyPayload" AfterTargets="Build">
|
|
<MSBuild Projects="..\WebPanelHarness.Payload\WebPanelHarness.Payload.csproj" Targets="GetTargetPath" Properties="Configuration=$(Configuration)">
|
|
<Output TaskParameter="TargetOutputs" ItemName="_PayloadTarget" />
|
|
</MSBuild>
|
|
<PropertyGroup>
|
|
<_PayloadDir>@(_PayloadTarget->'%(RootDir)%(Directory)')</_PayloadDir>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<_PayloadFiles Include="$(_PayloadDir)**\*.*" />
|
|
</ItemGroup>
|
|
<Copy SourceFiles="@(_PayloadFiles)" DestinationFiles="@(_PayloadFiles->'$(OutDir)payload\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
|
|
</Target>
|
|
|
|
</Project>
|