Snapshot for release 2026.10.21.1 (internal 6556f92)

This commit is contained in:
Tom Bohar 2026-10-21 09:35:06 -04:00
commit 5defb009a6
27 changed files with 756 additions and 523 deletions

View file

@ -591,11 +591,11 @@ internal static class Program
Eq((int)Marshal.OffsetOf<RynthCore.PluginSdk.TrainingEntryNative>(f.Name), (int)Marshal.OffsetOf<RynthCore.Engine.Plugins.TrainingEntryNative>(f.Name), "TrainingEntryNative." + f.Name + " offset");
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-v85 follow).
var names = typeof(RynthCore.Engine.Plugins.RynthCoreAPI).GetFields().Select(f => f.Name).SkipLast(8).TakeLast(6).ToArray();
// The three v79 slots follow v78's, then v80's two and v81's GetMergeStackResultFn (v82-v89 follow).
var names = typeof(RynthCore.Engine.Plugins.RynthCoreAPI).GetFields().Select(f => f.Name).SkipLast(11).TakeLast(6).ToArray();
Check(names.SequenceEqual(new[] { "GetTrainingInfoFn", "RaiseFn", "TrainSkillFn", "GetContainerOrderFn", "PutItemInContainerFn", "GetMergeStackResultFn" }),
"v79, v80 then v81 slots last: " + string.Join(",", names));
var sdkNames = typeof(RynthCore.PluginSdk.RynthCoreApiNative).GetFields().Select(f => f.Name).SkipLast(8).TakeLast(6).ToArray();
var sdkNames = typeof(RynthCore.PluginSdk.RynthCoreApiNative).GetFields().Select(f => f.Name).SkipLast(11).TakeLast(6).ToArray();
Check(sdkNames.SequenceEqual(names), "SDK v79, v80 and v81 slots in the same order");
}
@ -607,19 +607,21 @@ internal static class Program
var names = typeof(RynthCore.Engine.Plugins.RynthCoreAPI).GetFields().Select(f => f.Name).ToArray();
var sdkNames = typeof(RynthCore.PluginSdk.RynthCoreApiNative).GetFields().Select(f => f.Name).ToArray();
// v81's GetMergeStackResultFn follows v80's two slots.
Check(names.SkipLast(9).TakeLast(2).SequenceEqual(new[] { "GetContainerOrderFn", "PutItemInContainerFn" }), "v80 slots before v81's to v85's: " + string.Join(",", names.SkipLast(9).TakeLast(2)));
Check(sdkNames.SkipLast(9).TakeLast(2).SequenceEqual(names.SkipLast(9).TakeLast(2)), "SDK v80 slots in the same order");
Check(names.SkipLast(7).Last() == "SalvageDirectFn", "v82 slot before v83's");
Check(names.SkipLast(12).TakeLast(2).SequenceEqual(new[] { "GetContainerOrderFn", "PutItemInContainerFn" }), "v80 slots before v81's to v85's: " + string.Join(",", names.SkipLast(12).TakeLast(2)));
Check(sdkNames.SkipLast(12).TakeLast(2).SequenceEqual(names.SkipLast(12).TakeLast(2)), "SDK v80 slots in the same order");
Check(names.SkipLast(10).Last() == "SalvageDirectFn", "v82 slot before v83's");
// v83: GetObjectServerAge and RemoveClientObject (ghost creatures), then v84's slot.
Check(names.SkipLast(5).TakeLast(2).SequenceEqual(new[] { "GetObjectServerAgeFn", "RemoveClientObjectFn" }), "v83 slots before v84's: " + string.Join(",", names.SkipLast(5).TakeLast(2)));
Check(names.SkipLast(8).TakeLast(2).SequenceEqual(new[] { "GetObjectServerAgeFn", "RemoveClientObjectFn" }), "v83 slots before v84's: " + string.Join(",", names.SkipLast(8).TakeLast(2)));
// v84: GetObjectProperties (every property of an object, /ub propertydump), then v85's two.
Check(names.SkipLast(4).Last() == "GetObjectPropertiesFn", "v84 slot before v85's: " + names.SkipLast(4).Last());
Check(names.SkipLast(7).Last() == "GetObjectPropertiesFn", "v84 slot before v85's: " + names.SkipLast(7).Last());
// v85: ArmConfirmation and GetLastConfirmation (the server's yes/no prompts), then v86's slot.
Check(names.SkipLast(2).TakeLast(2).SequenceEqual(new[] { "ArmConfirmationFn", "GetLastConfirmationFn" }), "v85 slots before v86's: " + string.Join(",", names.SkipLast(2).TakeLast(2)));
Check(names.SkipLast(5).TakeLast(2).SequenceEqual(new[] { "ArmConfirmationFn", "GetLastConfirmationFn" }), "v85 slots before v86's: " + string.Join(",", names.SkipLast(5).TakeLast(2)));
// v86: GetServerStateJson (which server this is, for every plugin), then v87's slot.
Check(names.SkipLast(1).Last() == "GetServerStateJsonFn", "v86 slot before v87's: " + names.SkipLast(1).Last());
// v87: GetWieldedItems ends the table (what the player wields, from the server's messages).
Check(names.Last() == "GetWieldedItemsFn", "v87 slot last: " + names.Last());
Check(names.SkipLast(4).Last() == "GetServerStateJsonFn", "v86 slot before v87's: " + names.SkipLast(4).Last());
// v87: GetWieldedItems (what the player wields, from the server's messages), then v89's three.
Check(names.SkipLast(3).Last() == "GetWieldedItemsFn", "v87 slot before v89's: " + names.SkipLast(3).Last());
// v89: plugin windows (the engine's look, panels by key) end the table.
Check(names.TakeLast(3).SequenceEqual(new[] { "GetUiColorFn", "GetUiFontFn", "SetPanelOpenFn" }), "v89 slots last: " + string.Join(",", names.TakeLast(3)));
Check(typeof(RynthCore.PluginSdk.RynthCoreApiNative).GetFields().Select(f => f.Name).SequenceEqual(typeof(RynthCore.Engine.Plugins.RynthCoreAPI).GetFields().Select(f => f.Name)), "SDK table has the engine's slots in the same order");
Eq(Marshal.SizeOf<RynthCore.PluginSdk.RynthCoreApiNative>(), Marshal.SizeOf<RynthCore.Engine.Plugins.RynthCoreAPI>(), "SDK table size = engine table size");
Eq((int)Marshal.OffsetOf<RynthCore.PluginSdk.RynthCoreApiNative>("PutItemInContainerFn"),
@ -644,6 +646,11 @@ internal static class Program
(int)Marshal.OffsetOf<RynthCore.Engine.Plugins.RynthCoreAPI>("GetServerStateJsonFn"), "GetServerStateJsonFn offset");
Eq((int)Marshal.OffsetOf<RynthCore.PluginSdk.RynthCoreApiNative>("GetWieldedItemsFn"),
(int)Marshal.OffsetOf<RynthCore.Engine.Plugins.RynthCoreAPI>("GetWieldedItemsFn"), "GetWieldedItemsFn offset");
foreach (string slot in new[] { "GetUiColorFn", "GetUiFontFn", "SetPanelOpenFn" })
Eq((int)Marshal.OffsetOf<RynthCore.PluginSdk.RynthCoreApiNative>(slot),
(int)Marshal.OffsetOf<RynthCore.Engine.Plugins.RynthCoreAPI>(slot), slot + " offset");
Eq((int)Marshal.OffsetOf<RynthCore.Engine.Plugins.RynthCoreAPI>("GetUiColorFn"),
(int)Marshal.OffsetOf<RynthCore.Engine.Plugins.RynthCoreAPI>("GetWieldedItemsFn") + IntPtr.Size, "GetUiColorFn right after GetWieldedItemsFn");
}
private sealed class ProbePlugin : RynthCore.PluginCore.RynthPluginBase { }