Plugin API v94: renumber the web panel after upstream's v93

Upstream release 2026.11.8.1 took v93 for GetMonsterHealth. The web panel's four slots now follow
GetMonsterHealthFn in the engine table and the SDK's RynthCoreApiNative, and the web panel is v94:
PluginContractVersion.Current, RynthCoreSdkApiVersion, HasWebPanel (Version >= 94), the comments,
docs/WEB_PANEL.md, the changelog and PluginManifestTests (HasWebPanel version cases, slot names).
Still provisional: unmerged upstream branches also use 94.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel Wallace 2026-11-08 13:13:05 -08:00
commit 2225b90b2c
16 changed files with 72 additions and 70 deletions

View file

@ -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()
{

View file

@ -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<string, long> 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<string>() }), (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());