Snapshot for release 2026.10.29.3 (internal f81a090)

This commit is contained in:
Tom Bohar 2026-10-29 15:22:43 -04:00
commit aa8bf65897
27 changed files with 1821 additions and 61 deletions

View file

@ -15,6 +15,8 @@ internal static class ActivityInterfaceTests
r.Add("activity: each arbiter decision maps to its own bit", ArbiterBits);
r.Add("activity: corpse, salvage queue, server wait, crafting and AutoCram add their bits", ExtraBits);
r.Add("activity: the table answers only its own name and versions", QueryTable);
r.Add("activity: RynthAi's own unanswered action has its own bit (PacedAction), apart from the busy count", PacedBit);
r.Add("yield: the RynthAi.Yield table answers only its own name and versions; nothing held before login", YieldTable);
}
private static void ArbiterBits()
@ -70,4 +72,37 @@ internal static class ActivityInterfaceTests
ActivityInterface.Release();
}
}
private static void PacedBit()
{
RynthAiActivity f = ActivityInterface.Compose(BotActivity.Buffing, true, false, false, serverWait: true, false, false, pacedWait: true);
Check.Eq(f, RynthAiActivity.MacroRunning | RynthAiActivity.Buffing | RynthAiActivity.ServerAction | RynthAiActivity.PacedAction,
"a cast of RynthAi's out: waiting on the server, and its own action");
f = ActivityInterface.Compose(BotActivity.Idle, false, false, false, serverWait: true, false, false);
Check.Eq(f, RynthAiActivity.ServerAction, "only the busy count up (a leftover): no PacedAction");
Check.Eq((uint)RynthAiActivity.PacedAction, 1u << 9, "the next free bit, after AutoCram");
}
private static unsafe void YieldTable()
{
try
{
Check.True(YieldInterface.Query(RynthAiActivityApiV1.InterfaceName, 1) == IntPtr.Zero, "another interface's name");
Check.True(YieldInterface.Query(RynthAiYieldApiV1.InterfaceName, 0) == IntPtr.Zero, "version 0");
Check.True(YieldInterface.Query(RynthAiYieldApiV1.InterfaceName, 2) == IntPtr.Zero, "a newer version than RynthAi has");
IntPtr p = YieldInterface.Query(RynthAiYieldApiV1.InterfaceName, 1);
Check.True(p != IntPtr.Zero, "v1 answers");
var t = (RynthAiYieldApiV1*)p;
Check.Eq(t->Version, 1u, "table version");
Check.Eq(t->StructSize, (uint)sizeof(RynthAiYieldApiV1), "table size");
Check.True(t->HoldForPlayer != null && t->ReleaseHold != null, "functions filled in");
Check.True(YieldInterface.Query(RynthAiYieldApiV1.InterfaceName, 1) == p, "the same table on every call");
Check.Eq(t->HoldForPlayer(1500), 0, "no logged-in plugin: nothing held");
Check.Eq(t->ReleaseHold(), 1, "a release with nothing held is fine");
}
finally
{
YieldInterface.Release();
}
}
}