From 2841df63be62b232cd33f5dbf0f8fa0376840805 Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Sat, 7 Nov 2026 14:34:35 -0800 Subject: [PATCH] Web panel ABI: x86 struct assertions, restore v93 divider encoding WebPanelStructsMatch now asserts 48 bytes / Reserved at 32 on x86 for engine and SDK types when run 32-bit. PluginContract.cs v93 divider was double-encoded (cp1252 read of UTF-8); restored to box-drawing chars. Co-Authored-By: Claude Opus 5.5 --- src/RynthCore.Engine/Plugins/PluginContract.cs | 2 +- tools/PluginManifestTests/Program.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/RynthCore.Engine/Plugins/PluginContract.cs b/src/RynthCore.Engine/Plugins/PluginContract.cs index 1e2d842..184e460 100644 --- a/src/RynthCore.Engine/Plugins/PluginContract.cs +++ b/src/RynthCore.Engine/Plugins/PluginContract.cs @@ -1070,7 +1070,7 @@ internal struct RynthCoreAPI /// Read-only, any thread, no game calls. Requires API v93+. public IntPtr GetMonsterHealthFn; - //── v93: a WebView2 web panel over the game window (WebPanel\WebPanelApi.cs) ── + // ── v93: a WebView2 web panel over the game window (WebPanel\WebPanelApi.cs) ── // No call blocks its caller (AC's main thread, the plugin pump and ImGui draws all call these). /// v93: int WebPanelOpen(WebPanelOpenNative* open): opens (or replaces) the web panel. diff --git a/tools/PluginManifestTests/Program.cs b/tools/PluginManifestTests/Program.cs index c083089..77a581a 100644 --- a/tools/PluginManifestTests/Program.cs +++ b/tools/PluginManifestTests/Program.cs @@ -628,6 +628,17 @@ internal static class Program StructMirror(typeof(RynthCore.Engine.Plugins.WebPanelOpenNative), typeof(RynthCore.PluginSdk.WebPanelOpenNative), 8 + 4 * p + 8 + 16); StructMirror(typeof(RynthCore.Engine.Plugins.WebPanelStateNative), typeof(RynthCore.PluginSdk.WebPanelStateNative), 48); Eq((int)Marshal.OffsetOf("Reserved"), 8 + 4 * p + 8, "engine WebPanelOpenNative.Reserved offset (32 on x86)"); + // The 32-bit AC client's contract: 48 bytes, Reserved at 32 (only checked when this run is x86). + if (IntPtr.Size == 4) + { + Eq(Marshal.SizeOf(), 48, "x86 engine WebPanelOpenNative size"); + Eq(Marshal.SizeOf(), 48, "x86 SDK WebPanelOpenNative size"); + Eq((int)Marshal.OffsetOf("Reserved"), 32, "x86 engine WebPanelOpenNative.Reserved offset"); + Eq((int)Marshal.OffsetOf("Reserved"), 32, "x86 SDK WebPanelOpenNative.Reserved offset"); + Eq(Marshal.SizeOf(), 48, "x86 engine WebPanelStateNative size"); + Eq(Marshal.SizeOf(), 48, "x86 SDK WebPanelStateNative size"); + } + Console.WriteLine($" (WebPanelStructsMatch ran with IntPtr.Size={IntPtr.Size})"); } // v93: every code value agrees between the engine's enums and the SDK's.