diff --git a/Changelog/2026-11-07-web-panel.md b/Changelog/2026-11-07-web-panel.md index 3a19762..8f1ba86 100644 --- a/Changelog/2026-11-07-web-panel.md +++ b/Changelog/2026-11-07-web-panel.md @@ -1,7 +1,8 @@ -# In-game web panel: plugin API v93 +# In-game web panel: plugin API v94 -Branch `up/web-panel`, from upstream `main` 418d80b. Not deployed. The API number 93 is provisional -(upstream may take 93 first; it renumbers on merge). CoreCLR engine only. +Branch `pr/web-panel`, from upstream `main` c68204f (release 2026.11.8.1). Not deployed. The API number 94 +follows upstream's v93 (GetMonsterHealth) and is provisional (unmerged upstream branches also use 94; whichever +merges second renumbers). CoreCLR engine only. ## What changed @@ -18,7 +19,7 @@ Branch `up/web-panel`, from upstream `main` 418d80b. Not deployed. The API numbe - `/rc webpanel [status|close]`: a redacted one-line report, and a close. - `engine.json` `"WebPanel": false`: kill switch. `OpenWebPanel` then answers `Unavailable`. - `RynthCore.PluginSdk.targets` already raised a shared-SDK release build's `RynthPluginMinEngineApi` below 88 to the - SDK's API; that is now 93 for every such plugin. Plugins that must run on older cores declare 88 or higher. + SDK's API; that is now 94 for every such plugin. Plugins that must run on older cores declare 88 or higher. - `tools\WebPanelHarness`: an offline 32-bit harness for the host (see the doc). - Docs: `docs/WEB_PANEL.md` is the plugin contract. diff --git a/docs/WEB_PANEL.md b/docs/WEB_PANEL.md index 9df09e4..ed1634d 100644 --- a/docs/WEB_PANEL.md +++ b/docs/WEB_PANEL.md @@ -1,12 +1,12 @@ -# In-game web panel (plugin API v93) +# In-game web panel (plugin API v94) A plugin can show a web page in a panel over the Asheron's Call window. The page runs in WebView2. The engine owns the window, the navigation allowlist, focus and the lifetime; the plugin passes a URL, an allowlist and a profile key, then polls for state. This file is the contract plugin authors build against. -The API number 93 is provisional: upstream may take 93 first, in which case it renumbers on merge -(`PluginContractVersion.cs`). Write `HasWebPanel` checks, not `Version >= 93` checks. That keeps a plugin working -across a renumber only for shared-SDK release builds. A NativeAOT plugin build compiles the `Version >= 93` test +The API number 94 is provisional: unmerged upstream branches also use 94, and whichever merges second +renumbers (`PluginContractVersion.cs`). Write `HasWebPanel` checks, not `Version >= 94` checks. That keeps a plugin working +across a renumber only for shared-SDK release builds. A NativeAOT plugin build compiles the `Version >= 94` test in, so a plugin built against the provisional SDK must not be distributed, and must be rebuilt after a renumber. ## Calls @@ -17,7 +17,7 @@ to call from any thread (AC's main thread, the plugin pump, an ImGui draw). Neve | Call | Does | |---|---| -| `bool HasWebPanel` | True only on an engine at API 93 or newer that fills all four function slots. Check it before any other call. | +| `bool HasWebPanel` | True only on an engine at API 94 or newer that fills all four function slots. Check it before any other call. | | `int OpenWebPanel(WebPanelOptions)` | Opens the panel, or replaces the open one. Returns a handle > 0, or a negative `WebPanelResult`. | | `int NavigateWebPanel(int handle, string url)` | Points the open panel at a URL. `1` queued. | | `int CloseWebPanel(int handle)` | Closes the panel. `1` queued, `0` already closed. | @@ -198,7 +198,7 @@ the plugin to keep working on a core without the web panel, with ShellExecute as 1. **Declare `RynthPluginMinEngineApi` at the plugin's true minimum.** In release builds (`-p:RynthPluginSharedSdk=true`, as `Publish-Update.ps1` and `Build-Installer.ps1` pass), a declared minimum - *below 88* is raised to the API of the SDK the plugin was built with (93 now), and the launcher then holds the + *below 88* is raised to the API of the SDK the plugin was built with (94 now), and the launcher then holds the plugin back from older cores, which kills the fallback (`RynthCore.PluginSdk.targets`: `RynthCoreManagedPluginApi` is 88). There is no separate opt-out property: declaring a minimum of **88 or higher** is the opt-out, and a declared 88 or higher is used as it is. Declare the lowest API your plugin really needs at load, and make @@ -249,7 +249,7 @@ Poll the state from a second helper written the same way (`GetWebPanelState` and `RynthCoreAPI` gains four function pointers at the end of the table, in this order, all `cdecl`: `int WebPanelOpen(WebPanelOpenNative*)`, `int WebPanelNavigate(int handle, byte* url)`, `int WebPanelClose(int handle)`, `int WebPanelGetState(int handle, WebPanelStateNative*)`. -Test `Version >= 93` before reading them: an older engine's table is shorter. +Test `Version >= 94` before reading them: an older engine's table is shorter. `WebPanelOpenNative` (pack 4, 48 bytes on x86): `uint Size`, `uint Flags`, `byte* Url`, `byte* Allowlist` (`\n`-separated), `byte* ProfileKey` (may be null), `byte* Title` (may be null), `int WidthPercent`, `int HeightPercent`, diff --git a/src/RynthCore.Engine/Plugins/EngineSettings.cs b/src/RynthCore.Engine/Plugins/EngineSettings.cs index 4044725..f0d9f60 100644 --- a/src/RynthCore.Engine/Plugins/EngineSettings.cs +++ b/src/RynthCore.Engine/Plugins/EngineSettings.cs @@ -70,7 +70,7 @@ internal static class EngineSettings private static Compatibility.AutoIdMode _autoIdMode = Compatibility.AutoIdPolicy.DefaultMode; // "TransitionGate": default true. False = queued game actions are never held for a death / portal. private static bool _transitionGate = true; - // "WebPanel": default true. False = the v93 web panel calls answer Unavailable (plugins open the system browser). + // "WebPanel": default true. False = the v94 web panel calls answer Unavailable (plugins open the system browser). private static bool _webPanel = true; private static bool _loaded; @@ -716,7 +716,7 @@ internal static class EngineSettings } } - /// "WebPanel" in engine.json (default true): the v93 web panel (WebPanel\WebPanelHost.cs, a + /// "WebPanel" in engine.json (default true): the v94 web panel (WebPanel\WebPanelHost.cs, a /// WebView2 window over the game for DreamWeave's market and tools; CoreCLR engine only). False is the /// kill switch: WebPanelOpen answers Unavailable and plugins open the page in the system browser /// instead. A panel already open stays until it is closed. diff --git a/src/RynthCore.Engine/Plugins/PluginContract.cs b/src/RynthCore.Engine/Plugins/PluginContract.cs index 184e460..bb69de1 100644 --- a/src/RynthCore.Engine/Plugins/PluginContract.cs +++ b/src/RynthCore.Engine/Plugins/PluginContract.cs @@ -1070,24 +1070,24 @@ 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) ── + // ── v94: 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. + /// v94: int WebPanelOpen(WebPanelOpenNative* open): opens (or replaces) the web panel. /// Returns a handle > 0, or BadArgs / UrlNotAllowed / NoGameWindow / Unavailable / ShuttingDown - /// (WebPanelCode). Requires API v93+ (provisional number). + /// (WebPanelCode). Requires API v94+ (provisional number). public IntPtr WebPanelOpenFn; - /// v93: int WebPanelNavigate(int handle, byte* url): 1 queued; -2 off the allowlist + /// v94: int WebPanelNavigate(int handle, byte* url): 1 queued; -2 off the allowlist /// (opened in the system browser when it is browser-safe); -6 stale handle. public IntPtr WebPanelNavigateFn; - /// v93: int WebPanelClose(int handle): 1 queued, 0 already closed, -6 stale handle. + /// v94: int WebPanelClose(int handle): 1 queued, 0 already closed, -6 stale handle. public IntPtr WebPanelCloseFn; - /// v93: int WebPanelGetState(int handle, WebPanelStateNative* state): the WebPanelStatusCode + /// v94: int WebPanelGetState(int handle, WebPanelStateNative* state): the WebPanelStatusCode /// (a handle that is not the live one reads 6 Superseded), -1 bad args. public IntPtr WebPanelGetStateFn; } -/// v93 WebPanelOpen argument (Pack 4; 48 bytes on x86). Mirrors RynthCore.PluginSdk/WebPanelTypes.cs. +/// v94 WebPanelOpen argument (Pack 4; 48 bytes on x86). Mirrors RynthCore.PluginSdk/WebPanelTypes.cs. [StructLayout(LayoutKind.Sequential, Pack = 4)] internal unsafe struct WebPanelOpenNative { @@ -1109,7 +1109,7 @@ internal unsafe struct WebPanelOpenNative public fixed uint Reserved[4]; } -/// v93 WebPanelGetState result (Pack 4; 48 bytes). Mirrors RynthCore.PluginSdk/WebPanelTypes.cs. +/// v94 WebPanelGetState result (Pack 4; 48 bytes). Mirrors RynthCore.PluginSdk/WebPanelTypes.cs. [StructLayout(LayoutKind.Sequential, Pack = 4)] internal unsafe struct WebPanelStateNative { @@ -1126,14 +1126,14 @@ internal unsafe struct WebPanelStateNative public fixed uint Reserved[5]; } -/// v93 return codes of the web panel calls. Append only. +/// v94 return codes of the web panel calls. Append only. internal enum WebPanelCode { Queued = 1, AlreadyClosed = 0, BadArgs = -1, UrlNotAllowed = -2, NoGameWindow = -3, Unavailable = -4, ShuttingDown = -5, StaleHandle = -6, RuntimeMissing = -7, CreateFailed = -8, ProcessFailed = -9, } -/// v93 WebPanelStateNative.Status values. Append only. +/// v94 WebPanelStateNative.Status values. Append only. internal enum WebPanelStatusCode { None = 0, Starting = 1, Loading = 2, Ready = 3, Closed = 4, Failed = 5, Superseded = 6, diff --git a/src/RynthCore.Engine/Plugins/PluginContractVersion.cs b/src/RynthCore.Engine/Plugins/PluginContractVersion.cs index 774d6ba..e89f2d8 100644 --- a/src/RynthCore.Engine/Plugins/PluginContractVersion.cs +++ b/src/RynthCore.Engine/Plugins/PluginContractVersion.cs @@ -47,8 +47,9 @@ internal static class PluginContractVersion // any thread (feature/hud-health-for-plugins, 2026-11-07). Note: feature/reload-state, // feature/engine-events and the branches built on them (unmerged) also use 93 and 94; whichever // merges second renumbers. - // v93: WebPanelOpen, WebPanelNavigate, WebPanelClose and WebPanelGetState: a WebView2 web panel over the - // game window (WebPanel\WebPanelApi.cs; DreamWeave's in-game market and tools). The number is - // PROVISIONAL: upstream may take 93 first, in which case this renumbers on merge. - public const uint Current = 93; + // v94: WebPanelOpen, WebPanelNavigate, WebPanelClose and WebPanelGetState: a WebView2 web panel over the + // game window (WebPanel\WebPanelApi.cs; DreamWeave's in-game market and tools), appended after v93's + // GetMonsterHealth (was v93 on up/web-panel; renumbered after upstream's v93). The number is + // PROVISIONAL: the unmerged branches named under v93 also use 94; whichever merges second renumbers. + public const uint Current = 94; } diff --git a/src/RynthCore.Engine/Plugins/PluginManager.cs b/src/RynthCore.Engine/Plugins/PluginManager.cs index e12b819..9bd837d 100644 --- a/src/RynthCore.Engine/Plugins/PluginManager.cs +++ b/src/RynthCore.Engine/Plugins/PluginManager.cs @@ -305,10 +305,10 @@ internal static partial class PluginManager private static GetAmbientLightCallbackDelegate? _getAmbientLightCallback; // v91 private static GetMonsterHealthCallbackDelegate? _getMonsterHealthCallback; // v93 #if ENGINE_CORECLR - private static WebPanelOpenCallbackDelegate? _webPanelOpenCallback; // v93 - private static WebPanelNavigateCallbackDelegate? _webPanelNavigateCallback; // v93 - private static WebPanelCloseCallbackDelegate? _webPanelCloseCallback; // v93 - private static WebPanelGetStateCallbackDelegate? _webPanelGetStateCallback; // v93 + private static WebPanelOpenCallbackDelegate? _webPanelOpenCallback; // v94 + private static WebPanelNavigateCallbackDelegate? _webPanelNavigateCallback; // v94 + private static WebPanelCloseCallbackDelegate? _webPanelCloseCallback; // v94 + private static WebPanelGetStateCallbackDelegate? _webPanelGetStateCallback; // v94 #endif private static ForceResetBusyCountCallbackDelegate? _forceResetBusyCountCallback; private static GetObjectSpellIdsCallbackDelegate? _getObjectSpellIdsCallback; @@ -3261,7 +3261,7 @@ internal static partial class PluginManager unsafe { _getAmbientLightCallback ??= AmbientLight.Get; } unsafe { _getMonsterHealthCallback ??= GetMonsterHealthAction; } // v93 #if ENGINE_CORECLR - // v93: the AOT engine leaves these slots zero, so HasWebPanel is false there. + // v94: the AOT engine leaves these slots zero, so HasWebPanel is false there. unsafe { _webPanelOpenCallback ??= WebPanel.WebPanelApi.Open; } unsafe { _webPanelNavigateCallback ??= WebPanel.WebPanelApi.Navigate; } _webPanelCloseCallback ??= WebPanel.WebPanelApi.Close; diff --git a/src/RynthCore.Engine/RynthCore.Engine.csproj b/src/RynthCore.Engine/RynthCore.Engine.csproj index a9dfca5..71a4a3a 100644 --- a/src/RynthCore.Engine/RynthCore.Engine.csproj +++ b/src/RynthCore.Engine/RynthCore.Engine.csproj @@ -49,7 +49,7 @@ diff --git a/src/RynthCore.Engine/WebPanel/WebPanelApi.cs b/src/RynthCore.Engine/WebPanel/WebPanelApi.cs index 7147313..d9cae83 100644 --- a/src/RynthCore.Engine/WebPanel/WebPanelApi.cs +++ b/src/RynthCore.Engine/WebPanel/WebPanelApi.cs @@ -4,7 +4,7 @@ namespace RynthCore.Engine.WebPanel; #if ENGINE_CORECLR /// -/// The engine side of the v93 web panel calls (PluginContract.cs WebPanelOpenFn..WebPanelGetStateFn): reads +/// The engine side of the v94 web panel calls (PluginContract.cs WebPanelOpenFn..WebPanelGetStateFn): reads /// the native arguments (every string copied before the call returns) and hands them to the one /// WebPanelHost. No call here blocks its caller (AC's main thread, the plugin pump and ImGui draws all call /// these). engine.json "WebPanel": false makes Open answer Unavailable (plugins fall back to the browser). @@ -128,7 +128,7 @@ internal static unsafe class WebPanelApi } } #else -/// The NativeAOT engine has no web panel: PluginManager leaves the v93 slots zero (HasWebPanel false). +/// The NativeAOT engine has no web panel: PluginManager leaves the v94 slots zero (HasWebPanel false). internal static unsafe class WebPanelApi { internal static int Open(WebPanelOpenNative* open) => (int)WebPanelCode.Unavailable; diff --git a/src/RynthCore.Engine/WebPanel/WebPanelApiRules.cs b/src/RynthCore.Engine/WebPanel/WebPanelApiRules.cs index e2d1dd5..db98fca 100644 --- a/src/RynthCore.Engine/WebPanel/WebPanelApiRules.cs +++ b/src/RynthCore.Engine/WebPanel/WebPanelApiRules.cs @@ -6,7 +6,7 @@ namespace RynthCore.Engine.WebPanel; internal readonly record struct WebPanelSnapshot(int Handle, int Status, uint Flags, int Error, int LastHttpStatus, uint NavigationCount); /// -/// The pure decisions of the v93 ABI glue (WebPanelApi.cs), kept apart so tools\WebPanelTests can check them +/// The pure decisions of the v94 ABI glue (WebPanelApi.cs), kept apart so tools\WebPanelTests can check them /// without the engine: refusals, the GetState argument check, and writing the result struct. /// internal static unsafe class WebPanelApiRules diff --git a/src/RynthCore.Engine/WebPanel/WebPanelNativeArgs.cs b/src/RynthCore.Engine/WebPanel/WebPanelNativeArgs.cs index a2efc38..e319d28 100644 --- a/src/RynthCore.Engine/WebPanel/WebPanelNativeArgs.cs +++ b/src/RynthCore.Engine/WebPanel/WebPanelNativeArgs.cs @@ -8,7 +8,7 @@ namespace RynthCore.Engine.WebPanel; internal sealed record WebPanelRequest(string Url, string[] Allowlist, string ProfileFolder, string Title, int WidthPercent, int HeightPercent, uint Flags); /// -/// Reads the v93 WebPanelOpen argument. The SDK passes pointers into stack or pooled buffers that are gone +/// Reads the v94 WebPanelOpen argument. The SDK passes pointers into stack or pooled buffers that are gone /// the moment the call returns, so every string is copied here, synchronously, before anything is queued. /// Pure: no Win32, no WebView2. /// diff --git a/src/RynthCore.PluginSdk/RynthCoreApiNative.cs b/src/RynthCore.PluginSdk/RynthCoreApiNative.cs index fc6031d..6d713ad 100644 --- a/src/RynthCore.PluginSdk/RynthCoreApiNative.cs +++ b/src/RynthCore.PluginSdk/RynthCoreApiNative.cs @@ -204,7 +204,7 @@ public struct RynthCoreApiNative public IntPtr GetAmbientLightFn; // int GetAmbientLight(uint* client, uint* applied) -> 1 hook live, 0 not // v93: the monster plates' last server health reading per object public IntPtr GetMonsterHealthFn; // int GetMonsterHealth(uint id, float* ratio, uint* ageMs) -> 1 reading, 0 none - // v93: a WebView2 web panel over the game window (APPEND-AT-END (ABI); number provisional) + // v94: a WebView2 web panel over the game window (APPEND-AT-END (ABI); number provisional) public IntPtr WebPanelOpenFn; // int WebPanelOpen(WebPanelOpenNative*) -> handle > 0, or BadArgs/UrlNotAllowed/NoGameWindow/Unavailable/ShuttingDown public IntPtr WebPanelNavigateFn; // int WebPanelNavigate(int handle, byte* url) -> 1 queued; -2 off-list; -6 stale public IntPtr WebPanelCloseFn; // int WebPanelClose(int handle) -> 1 queued, 0 already closed, -6 stale diff --git a/src/RynthCore.PluginSdk/RynthCoreHost.cs b/src/RynthCore.PluginSdk/RynthCoreHost.cs index 223bf4d..5e5da89 100644 --- a/src/RynthCore.PluginSdk/RynthCoreHost.cs +++ b/src/RynthCore.PluginSdk/RynthCoreHost.cs @@ -1877,17 +1877,17 @@ public readonly unsafe struct RynthCoreHost return true; } - // ── v93: a web panel over the game window (number provisional) ─────────── + // ── v94: a web panel over the game window (number provisional) ─────────── /// - /// v93: , , and - /// . True only on an engine at API 93 or newer that fills all four. + /// v94: , , and + /// . True only on an engine at API 94 or newer that fills all four. /// - public bool HasWebPanel => _api.Version >= 93 && _api.WebPanelOpenFn != IntPtr.Zero && _api.WebPanelNavigateFn != IntPtr.Zero + public bool HasWebPanel => _api.Version >= 94 && _api.WebPanelOpenFn != IntPtr.Zero && _api.WebPanelNavigateFn != IntPtr.Zero && _api.WebPanelCloseFn != IntPtr.Zero && _api.WebPanelGetStateFn != IntPtr.Zero; /// - /// v93: opens the web panel over the game window (a second call replaces the first). Returns a handle + /// v94: opens the web panel over the game window (a second call replaces the first). Returns a handle /// > 0, or a (BadArgs for an empty URL or allowlist, more than 16 /// entries or a newline inside one; Unavailable on an older engine). Never blocks; the panel loads /// after this returns - poll . Any thread. @@ -1941,7 +1941,7 @@ public readonly unsafe struct RynthCoreHost } /// - /// v93: points the panel at . 1 queued; -2 + /// v94: points the panel at . 1 queued; -2 /// (UrlNotAllowed) when it is off the allowlist (the engine opens it in the system browser when that is /// safe); -6 (StaleHandle) when the handle is not the live panel. Never blocks. Any thread. /// @@ -1965,7 +1965,7 @@ public readonly unsafe struct RynthCoreHost } } - /// v93: closes the panel . 1 queued, 0 already closed, -6 stale handle. Never blocks. Any thread. + /// v94: closes the panel . 1 queued, 0 already closed, -6 stale handle. Never blocks. Any thread. public int CloseWebPanel(int handle) { if (!HasWebPanel) return (int)WebPanelResult.Unavailable; @@ -1973,7 +1973,7 @@ public readonly unsafe struct RynthCoreHost } /// - /// v93: where the panel is. A handle that is not the live panel reads + /// v94: where the panel is. A handle that is not the live panel reads /// Superseded. None (and a default ) on an older engine or bad arguments. /// Any thread. /// diff --git a/src/RynthCore.PluginSdk/WebPanelTypes.cs b/src/RynthCore.PluginSdk/WebPanelTypes.cs index b05d4e0..3c8117c 100644 --- a/src/RynthCore.PluginSdk/WebPanelTypes.cs +++ b/src/RynthCore.PluginSdk/WebPanelTypes.cs @@ -4,11 +4,11 @@ using System.Runtime.InteropServices; namespace RynthCore.PluginSdk; -// v93: a WebView2 web panel over the game window. The native structs mirror +// v94: a WebView2 web panel over the game window. The native structs mirror // RynthCore.Engine/Plugins/PluginContract.cs field for field (tools\PluginManifestTests checks sizes and // offsets). The API number is provisional. -/// v93 WebPanelOpen argument (Pack 4; 48 bytes on x86). Mirrors the engine's WebPanelOpenNative. +/// v94 WebPanelOpen argument (Pack 4; 48 bytes on x86). Mirrors the engine's WebPanelOpenNative. [StructLayout(LayoutKind.Sequential, Pack = 4)] public unsafe struct WebPanelOpenNative { @@ -30,7 +30,7 @@ public unsafe struct WebPanelOpenNative public fixed uint Reserved[4]; } -/// v93 WebPanelGetState result (Pack 4; 48 bytes). Mirrors the engine's WebPanelStateNative. +/// v94 WebPanelGetState result (Pack 4; 48 bytes). Mirrors the engine's WebPanelStateNative. [StructLayout(LayoutKind.Sequential, Pack = 4)] public unsafe struct WebPanelStateNative { diff --git a/src/RynthCore.PluginSdk/build/RynthCore.PluginSdk.targets b/src/RynthCore.PluginSdk/build/RynthCore.PluginSdk.targets index ecae5c1..5abe769 100644 --- a/src/RynthCore.PluginSdk/build/RynthCore.PluginSdk.targets +++ b/src/RynthCore.PluginSdk/build/RynthCore.PluginSdk.targets @@ -36,7 +36,7 @@ - 93 + 94 88 <_RynthPluginManifestOn Condition="'$(RynthPluginMinEngineApi)' != '' and '$(RynthPluginManifest)' != 'false'">true diff --git a/tools/EngineSettingsTests/Program.cs b/tools/EngineSettingsTests/Program.cs index 5a14d08..78e80a6 100644 --- a/tools/EngineSettingsTests/Program.cs +++ b/tools/EngineSettingsTests/Program.cs @@ -627,7 +627,7 @@ namespace EngineSettingsTests } } - // engine.json WebPanel (2026-11-07, the v93 web panel kill switch): default on, only a hand-set false is + // engine.json WebPanel (2026-11-07, the v94 web panel kill switch): default on, only a hand-set false is // written, other saves keep it, a value that is not a boolean is ignored. private static void WebPanelDefaultOnAndSaved() { diff --git a/tools/PluginManifestTests/Program.cs b/tools/PluginManifestTests/Program.cs index 77a581a..83dc114 100644 --- a/tools/PluginManifestTests/Program.cs +++ b/tools/PluginManifestTests/Program.cs @@ -593,7 +593,7 @@ internal static class Program "targets: the manifest and the runtime attribute both use the derived minimum"); } - // v93: the web panel's four slots are appended right after GetMonsterHealthFn, in order, on both sides. + // v94: the web panel's four slots are appended right after GetMonsterHealthFn, in order, on both sides. private static void WebPanelFieldsAppended() { string[] slots = { "WebPanelOpenFn", "WebPanelNavigateFn", "WebPanelCloseFn", "WebPanelGetStateFn" }; @@ -621,7 +621,7 @@ internal static class Program Eq((int)Marshal.OffsetOf(sdk, f), (int)Marshal.OffsetOf(engine, f), engine.Name + "." + f + " offset"); } - // v93: the SDK's WebPanelOpenNative/WebPanelStateNative are the engine's, byte for byte. + // v94: the SDK's WebPanelOpenNative/WebPanelStateNative are the engine's, byte for byte. private static void WebPanelStructsMatch() { int p = IntPtr.Size; @@ -641,7 +641,7 @@ internal static class Program Console.WriteLine($" (WebPanelStructsMatch ran with IntPtr.Size={IntPtr.Size})"); } - // v93: every code value agrees between the engine's enums and the SDK's. + // v94: every code value agrees between the engine's enums and the SDK's. private static void WebPanelCodesMatch() { Dictionary Vals(Type t) => Enum.GetNames(t).ToDictionary(n => n, n => Convert.ToInt64(Enum.Parse(t, n))); @@ -662,27 +662,27 @@ internal static class Program Eq((uint)RynthCore.PluginSdk.WebPanelFlags.PageKeepsEscape, 2u, "open flag PageKeepsEscape"); } - // v93: HasWebPanel needs Version >= 93 AND all four slots (an old engine's table is shorter and the + // v94: HasWebPanel needs Version >= 94 AND all four slots (an old engine's table is shorter and the // runtime copies the full new-size struct, so slots past its end are garbage, not zero). private static void HasWebPanel_FalseOnOldOrPartialTable() { IntPtr x = (IntPtr)0xDEAD; RynthCoreHost Host(uint version, IntPtr a, IntPtr b, IntPtr c, IntPtr d) => new RynthCoreHost(new RynthCoreApiNative { Version = version, WebPanelOpenFn = a, WebPanelNavigateFn = b, WebPanelCloseFn = c, WebPanelGetStateFn = d }); - Check(!Host(92, x, x, x, x).HasWebPanel, "Version 92 with garbage slots: false"); - Check(!Host(93, IntPtr.Zero, x, x, x).HasWebPanel, "Open zero: false"); - Check(!Host(93, x, IntPtr.Zero, x, x).HasWebPanel, "Navigate zero: false"); - Check(!Host(93, x, x, IntPtr.Zero, x).HasWebPanel, "Close zero: false"); - Check(!Host(93, x, x, x, IntPtr.Zero).HasWebPanel, "GetState zero: false"); - Check(Host(93, x, x, x, x).HasWebPanel, "Version 93, all four: true"); - var old = Host(92, x, x, x, x); + Check(!Host(93, x, x, x, x).HasWebPanel, "Version 93 with garbage slots: false"); + Check(!Host(94, IntPtr.Zero, x, x, x).HasWebPanel, "Open zero: false"); + Check(!Host(94, x, IntPtr.Zero, x, x).HasWebPanel, "Navigate zero: false"); + Check(!Host(94, x, x, IntPtr.Zero, x).HasWebPanel, "Close zero: false"); + Check(!Host(94, x, x, x, IntPtr.Zero).HasWebPanel, "GetState zero: false"); + Check(Host(94, x, x, x, x).HasWebPanel, "Version 94, all four: true"); + var old = Host(93, x, x, x, x); Eq(old.OpenWebPanel(new WebPanelOptions { Url = "https://a.example/", Allowlist = new[] { "a.example" } }), (int)WebPanelResult.Unavailable, "Open without the API: Unavailable"); Eq(old.NavigateWebPanel(1, "https://a.example/"), (int)WebPanelResult.Unavailable, "Navigate without the API: Unavailable"); Eq(old.CloseWebPanel(1), (int)WebPanelResult.Unavailable, "Close without the API: Unavailable"); Eq(old.GetWebPanelState(1, out var st), WebPanelStatus.None, "GetState without the API: None"); Eq(st.Handle, 0, "GetState without the API: default state"); // Bad arguments are refused before the engine is called (the slots hold garbage, so a call would crash). - var live = Host(93, x, x, x, x); + var live = Host(94, x, x, x, x); Eq(live.OpenWebPanel(new WebPanelOptions { Url = "", Allowlist = new[] { "a" } }), (int)WebPanelResult.BadArgs, "empty URL: BadArgs"); Eq(live.OpenWebPanel(new WebPanelOptions { Url = "https://a/", Allowlist = Array.Empty() }), (int)WebPanelResult.BadArgs, "empty allowlist: BadArgs"); Eq(live.OpenWebPanel(new WebPanelOptions { Url = "https://a/", Allowlist = new[] { "a\nb" } }), (int)WebPanelResult.BadArgs, "newline in an entry: BadArgs"); @@ -703,7 +703,7 @@ internal static class Program Eq(RynthCore.PluginSdk.TrainingInfoFlags.Busy, RynthCore.Engine.Plugins.TrainingInfoFlags.Busy, "info flag bits"); Eq(RynthCore.PluginSdk.TrainingEntryFlags.Trainable, RynthCore.Engine.Plugins.TrainingEntryFlags.Trainable, "entry flag bits"); // The three v79 slots follow v78's, then v80's two and v81's GetMergeStackResultFn (v82-v91 follow: - // eleven slots to v89, then v90's thirteen, v91's two, v93's one and the web panel's four). + // eleven slots to v89, then v90's thirteen, v91's two, v93's one and v94's four). var names = typeof(RynthCore.Engine.Plugins.RynthCoreAPI).GetFields().Select(f => f.Name).SkipLast(31).TakeLast(6).ToArray(); Check(names.SequenceEqual(new[] { "GetTrainingInfoFn", "RaiseFn", "TrainSkillFn", "GetContainerOrderFn", "PutItemInContainerFn", "GetMergeStackResultFn" }), "v79, v80 then v81 slots last: " + string.Join(",", names)); @@ -718,12 +718,12 @@ internal static class Program { var all = typeof(RynthCore.Engine.Plugins.RynthCoreAPI).GetFields().Select(f => f.Name).ToArray(); var sdkAll = typeof(RynthCore.PluginSdk.RynthCoreApiNative).GetFields().Select(f => f.Name).ToArray(); - // v93: the web panel's four slots end the table; the checks after these are on the table before them. - string[] v93 = { "WebPanelOpenFn", "WebPanelNavigateFn", "WebPanelCloseFn", "WebPanelGetStateFn" }; - Check(all.TakeLast(v93.Length).SequenceEqual(v93), "v93 slots last: " + string.Join(",", all.TakeLast(v93.Length))); - Check(sdkAll.TakeLast(v93.Length).SequenceEqual(v93), "SDK v93 slots last: " + string.Join(",", sdkAll.TakeLast(v93.Length))); - all = all.SkipLast(v93.Length).ToArray(); - sdkAll = sdkAll.SkipLast(v93.Length).ToArray(); + // v94: the web panel's four slots end the table; the checks after these are on the table before them. + string[] v94 = { "WebPanelOpenFn", "WebPanelNavigateFn", "WebPanelCloseFn", "WebPanelGetStateFn" }; + Check(all.TakeLast(v94.Length).SequenceEqual(v94), "v94 slots last: " + string.Join(",", all.TakeLast(v94.Length))); + Check(sdkAll.TakeLast(v94.Length).SequenceEqual(v94), "SDK v94 slots last: " + string.Join(",", sdkAll.TakeLast(v94.Length))); + all = all.SkipLast(v94.Length).ToArray(); + sdkAll = sdkAll.SkipLast(v94.Length).ToArray(); // v93: the monster plates' health readings end the table (2026-11-07), right after v91's two. Check(all.Last() == "GetMonsterHealthFn", "v93 slot last: " + all.Last()); Check(sdkAll.Last() == "GetMonsterHealthFn", "SDK v93 slot last: " + sdkAll.Last());