Snapshot for release 2026.10.13.2 (internal 6cd69e2)

This commit is contained in:
Tom Bohar 2026-10-13 15:07:08 -04:00
commit 56b9f6c813
94 changed files with 5793 additions and 1637 deletions

View file

@ -0,0 +1,455 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using RynthCore.Plugin.RynthILT.Hub;
using RynthCore.PluginSdk;
using RynthCore.RynthAiHostTests.Fakes;
using RynthCore.RynthAiTests.Harness;
namespace RynthILT.Tests;
// Server Features gate + the infinite-attribute raiser (2026-10-06; RynthAi's ILT Hub, in RynthILT
// since 2026-10-13). The gate decides from RynthILT's server list (world-name patterns) and the
// character's "Treat this world as ILT" whether the ILT features ask the server at all; the raiser reads "/xp all" costs and spends unassigned XP with "/attr <abbr> 1"
// on the ticked stats, in the chosen order, never below the reserve.
internal static class AttributeRaiserTests
{
private const uint Player = 0x50000C01;
public static void Register(Runner r)
{
r.Add("server features: name patterns (exact, wildcards, case)", Patterns);
r.Add("server features: list parsing and the override", ListAndOverride);
r.Add("attr raiser: pick by mode (priority, round robin, cheapest)", PickModes);
r.Add("attr raiser: pick respects ticks, reserve and unknown costs", PickLimits);
r.Add("attr raiser: order repair and stat names from server lines", OrderAndNames);
r.Add("attr raiser: a run reads costs, raises in order, stops when nothing is affordable", FullRun);
r.Add("attr raiser: off when the world is not in the Server Features list", GatedOff);
r.Add("attr raiser: safety (stale costs, another stat's reply, gate off mid-run, held off)", Safety);
r.Add("attr raiser: by-hand +1 / +10 priced like UB, refused when unaffordable, costs read on tab open", ByHandPriced);
r.Add("aug planner: /aug pulled on tab open, totals, reset targets, copy texts", AugPlanner);
r.Add("aug costs: UB's ILT model (tier starts at its S level) in closed form", AugCostModel);
r.Add("aug costs: per-server multipliers and rules, saved and reset", AugCostSettings);
}
/// <summary>UB Augs.cs GetCumulativeCost difference, level by level (the reference the closed form must match).</summary>
private static decimal UbLoop(IltAugCostRow r, double[] m, int cur, int tgt)
{
decimal step = r.Base * (decimal)r.LinearPercent / 100m, total = 0;
for (int i = cur + 1; i <= tgt; i++)
{
decimal b = r.Base + (i - 1) * step;
double mult = i < r.S1 ? m[0] : i < r.S2 ? m[1] : i < r.S3 ? m[2] : i < r.S4 ? m[3] : m[4];
total += b * (decimal)mult;
}
return total;
}
private static void AugCostModel()
{
var rows = IltAugCosts.DefaultRows().ToDictionary(x => x.Key);
var m = IltAugCosts.DefaultMultipliers;
var creature = rows["creature"];
Check.Eq(IltAugCosts.LumCost(creature, m, 2748, 2749), 750_000m + 2748 * 975_000m, "level 2749 (S1 - 1) is the last x1 level");
Check.Eq(IltAugCosts.LumCost(creature, m, 2749, 2750), (750_000m + 2749 * 975_000m) * 4, "level 2750 (S1) is the first x4 level");
Check.Eq(rows["specialization"].S2, 2500, "Specialization uses UB's 1750/2500/3000/3750");
Check.Eq(rows["summon"].S1, 1750, "Summon uses UB's 1750/2500/3000/3750");
Check.Eq(creature.Cap, 0, "no target cap by default (UB has none)");
foreach (var (key, cur, tgt) in new[] { ("creature", 0, 6000), ("item", 1200, 3600), ("specialization", 1700, 3800),
("duration", 999, 1001), ("summon", 3749, 3751), ("life", 10, 10) })
Check.Eq(IltAugCosts.LumCost(rows[key], m, cur, tgt), UbLoop(rows[key], m, cur, tgt), $"{key} {cur}->{tgt} matches UB's loop");
var odd = new double[] { 1.5, 2, 3.25, 10, 0 };
Check.Eq(IltAugCosts.LumCost(rows["war"], odd, 1500, 4000), UbLoop(rows["war"], odd, 1500, 4000), "custom multipliers match the loop");
Check.Eq(IltAugCosts.LumCost(creature, m, 50, 40), 0m, "a target below current costs nothing");
Check.True(IltAugCosts.LumCost(creature, m, 0, IltAugCosts.NoCapLimit) > 0, "the largest uncapped target is priced without overflow");
}
private static void AugCostSettings()
{
string file = IltAugCosts.FilePath;
if (File.Exists(file)) File.Delete(file);
var settings = new IltSettings();
var hub = NewHub("InfiniteLeaftide", settings, "aug-costs", out _);
var prog = hub.Progression;
prog.ApplyAugLines(new List<string> { "War: 1700" });
hub.State.Character.AugTargets["war"] = 1800;
string Snapshot()
{
var sb = new System.Text.StringBuilder();
prog.AppendSnapshotJson(sb);
return "{" + sb + "}";
}
System.Text.Json.JsonElement Aug(string json) => System.Text.Json.JsonDocument.Parse(json).RootElement.GetProperty("aug");
var before = Aug(Snapshot());
Check.False(before.GetProperty("cfg").GetProperty("custom").GetBoolean(), "a world starts on the defaults");
Check.Eq(before.GetProperty("cfg").GetProperty("mults").GetArrayLength(), 5, "five tier multipliers in the snapshot");
string lumBefore = before.GetProperty("totLum").GetString() ?? "";
prog.HandleRemote(new[] { "augmult", "1", "2" });
var after = Aug(Snapshot());
Check.True(after.GetProperty("cfg").GetProperty("custom").GetBoolean(), "an edit gives the world its own rules");
Check.Eq(after.GetProperty("cfg").GetProperty("mults")[1].GetDouble(), 2.0, "multiplier saved");
Check.True((after.GetProperty("totLum").GetString() ?? "") != lumBefore, "the plan re-prices with the new multiplier");
prog.HandleRemote(new[] { "augcfg", "war", "s1", "1800" });
prog.HandleRemote(new[] { "augcfg", "war", "base", "1m" });
prog.HandleRemote(new[] { "augcfg", "war", "s2", "100" });
var war = prog.AugCosts.For("InfiniteLeaftide").Augs.First(x => x.Key == "war");
Check.Eq(war.S1, 1800, "S1 edited");
Check.Eq(war.Base, 1_000_000L, "base accepts k/m/b suffixes");
Check.Eq(war.S2, 1800, "S2 can't go below S1");
Check.Eq(prog.AugCosts.For("Aelrynth").Multipliers[1], 4.0, "another world keeps the defaults");
var reloaded = new IltAugCosts();
Check.Eq(reloaded.For("infiniteleaftide").Multipliers[1], 2.0, "rules are saved per world (name ignores case)");
prog.HandleRemote(new[] { "augcfgreset" });
Check.False(prog.AugCosts.IsCustom("InfiniteLeaftide"), "reset drops the world's rules");
Check.Eq(new IltAugCosts().For("InfiniteLeaftide").Multipliers[1], 4.0, "and the reset is saved");
}
private static void ByHandPriced()
{
Check.Eq(IltAttributeRaiser.ProjectCost(1_000, 1), 1_000L, "one level costs the reported cost");
// 1000 * (1.077^10 - 1) / 0.077 = 14,281.7 (UB's EstimateMultiLevelCost).
Check.Eq(IltAttributeRaiser.ProjectCost(1_000, 10), 14_281L, "ten levels grow 7.7% each");
Check.Eq(IltAttributeRaiser.ProjectCost(0, 10), 0L, "unknown cost projects nothing");
Check.Eq(IltAttributeRaiser.ProjectCost(long.MaxValue / 2, 10), long.MaxValue, "saturates instead of overflowing");
var settings = new IltSettings();
var hub = NewHub("InfiniteLeaftide", settings, "attr-byhand", out _);
var raiser = hub.Progression.Attributes;
FakeHost.Quads[(Player, IltInventory.QuadAvailableXp)] = 5_000;
// Levels already known (as after the login probe), so the tab doesn't queue /aug ahead of /xp all.
hub.Progression.ApplyAugLines(new List<string> { "Creature: 1" });
// Opening the tab (a snapshot poll) reads the costs once per login.
var sb = new System.Text.StringBuilder();
hub.Progression.AppendSnapshotJson(sb);
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/xp all")), "the first snapshot reads the costs");
Reply(hub, "[XP] Your XP cost for next 1 Coordination level is: 1,000",
"[XP] Your XP cost for next 1 Strength level is: 4,000");
TickUntil(hub, () => false, 400);
int reads = FakeHost.ChatCommands.Count(x => x == "/xp all");
hub.Progression.AppendSnapshotJson(new System.Text.StringBuilder());
TickUntil(hub, () => false, 400);
Check.Eq(FakeHost.ChatCommands.Count(x => x == "/xp all"), reads, "later snapshots don't read again");
sb.Clear();
raiser.AppendJson(sb);
string json = sb.ToString();
System.Text.Json.JsonDocument.Parse("{" + json + "}").Dispose();
Check.True(json.Contains("\"key\":\"coo\"") && json.Contains("\"afford1\":true") && json.Contains("\"cost10\":\"~14.3K\""),
$"Coordination: +1 affordable, +10 projected (got {json})");
Check.True(json.Contains("\"updated\":\"") && !json.Contains("\"updated\":\"-\""), "the last-updated time is set");
// +10 Coordination (~14.3K of 5K) is refused; +1 Strength (4K of 5K) goes out.
raiser.RaiseManual("coo", 10);
var status = new System.Text.StringBuilder();
raiser.AppendJson(status);
Check.True(status.ToString().Contains("Not enough unassigned XP"), "an unaffordable +10 is refused with the reason");
raiser.RaiseManual("str", 1);
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/attr str 1")), "an affordable +1 is sent");
Check.False(FakeHost.ChatCommands.Contains("/attr coo 10"), "the refused +10 was never sent");
}
private static void AugPlanner()
{
var settings = new IltSettings();
var hub = NewHub("InfiniteLeaftide", settings, "aug-planner", out _);
var prog = hub.Progression;
prog.AppendSnapshotJson(new System.Text.StringBuilder());
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/aug")), "opening the tab pulls /aug once");
prog.ApplyAugLines(new List<string> { "Creature: 100", "Specialize: 2", "Summon: 0" });
prog.HandleRemote(new[] { "augtarget", "creature", "110" });
var sb = new System.Text.StringBuilder();
prog.AppendSnapshotJson(sb);
string json = sb.ToString();
using (var doc = System.Text.Json.JsonDocument.Parse("{" + json + "}"))
{
var aug = doc.RootElement.GetProperty("aug");
Check.Eq(aug.GetProperty("totCur").GetInt64(), 102L, "totals: current");
Check.Eq(aug.GetProperty("totTgt").GetInt64(), 112L, "totals: target");
Check.Eq(aug.GetProperty("totInc").GetInt64(), 10L, "totals: increase");
Check.Eq(aug.GetProperty("totCoins").GetInt64(), 30L, "Creature costs 3 coins a level");
var creature = aug.GetProperty("rows").EnumerateArray().First(x => x.GetProperty("key").GetString() == "creature");
Check.Eq(creature.GetProperty("inc").GetInt32(), 10, "row: increase");
string discord = aug.GetProperty("copyDiscord").GetString() ?? "";
Check.True(discord.StartsWith("```", StringComparison.Ordinal) && discord.Contains("TOTALS:") && discord.Contains("Creature"),
"Discord copy is a code-block table with totals");
Check.True(discord.All(ch => ch < 128), "copy text is ASCII (the engine reads the snapshot as ANSI)");
string ingame = aug.GetProperty("copyIngame").GetString() ?? "";
Check.True(ingame.Contains("Crit: 100") && ingame.Contains("Spec: 2") && !ingame.Contains("Sum:"),
$"in-game copy lists current levels with short names (got '{ingame}')");
}
prog.HandleRemote(new[] { "augreset" });
Check.Eq(hub.State.Character.AugTargets["creature"], 100, "reset targets: back to current");
Check.Eq(hub.State.Character.AugTargets["summon"], 0, "reset targets: unloaded augs go to 0");
Check.Eq(FakeHost.ChatCommands.Count(x => x == "/aug"), 1, "levels loaded: no second automatic /aug");
}
private static void Patterns()
{
Check.True(ServerFeatureGate.Matches("InfiniteLeaftide", "InfiniteLeaftide"), "exact");
Check.True(ServerFeatureGate.Matches("infiniteleaftide", "InfiniteLeaftide"), "exact ignores case");
Check.False(ServerFeatureGate.Matches("InfiniteLeaftide2", "InfiniteLeaftide"), "exact means the whole name");
Check.True(ServerFeatureGate.Matches("Leaftide Test", "*Leaftide*"), "contains");
Check.True(ServerFeatureGate.Matches("MyLeaftide", "*tide"), "ends with");
Check.True(ServerFeatureGate.Matches("Leaftide-PTR", "Leaf*"), "starts with");
Check.True(ServerFeatureGate.Matches("Aelrynth Infinite", "Ael*Inf*"), "two wildcards");
Check.False(ServerFeatureGate.Matches("Aelrynth", "*Leaftide*"), "no match");
Check.False(ServerFeatureGate.Matches("ab", "a*bb"), "the end part must fit after the start");
Check.True(ServerFeatureGate.NameMatches("Aelrynth", new[] { "", "InfiniteLeaftide", "aelrynth" }, out string m) && m == "aelrynth",
"NameMatches reports the pattern that matched");
Check.False(ServerFeatureGate.NameMatches("", ServerFeatureGate.DefaultServerNames, out _), "an unknown world never matches");
}
private static void ListAndOverride()
{
var list = ServerFeatureGate.ParseList(" InfiniteLeaftide , *Leaftide*;Aelrynth,,aelrynth ");
Check.Eq(string.Join("|", list), "InfiniteLeaftide|*Leaftide*|Aelrynth", "trimmed, split on , and ;, de-duplicated ignoring case");
Check.Eq(ServerFeatureGate.FormatList(list), "InfiniteLeaftide, *Leaftide*, Aelrynth", "formatted back for the text box");
var s = new IltSettings();
Check.True(s.ServerNames.Contains("InfiniteLeaftide"), "fresh settings start with the defaults");
Check.True(ServerFeatureGate.IsEnabled("InfiniteLeaftide", s, forceOn: false), "the default list covers InfiniteLeaftide");
Check.False(ServerFeatureGate.IsEnabled("Aelrynth", s, forceOn: false), "another world is off by default");
Check.True(ServerFeatureGate.IsEnabled("Aelrynth", s, forceOn: true), "the character's override turns it on anywhere");
s.ServerNames = new List<string> { "Aelrynth" };
Check.True(ServerFeatureGate.IsEnabled("aelrynth", s, forceOn: false), "a world added to the list is on");
Check.False(ServerFeatureGate.IsEnabled("InfiniteLeaftide", s, forceOn: false), "a world removed from the list is off");
Check.True(ServerFeatureGate.IsEnabled("InfiniteLeaftide", null, forceOn: false), "no settings yet: the defaults apply");
s.ServerNames = new List<string>();
Check.True(ServerFeatureGate.IsEnabled("InfiniteLeaftide", s, forceOn: false), "an emptied list falls back to the defaults");
}
private static readonly string[] Order = { "coo", "qui", "str", "end", "foc", "sel", "hea", "sta", "man" };
private static void PickModes()
{
var cost = new Dictionary<string, long> { ["coo"] = 500, ["qui"] = 300, ["str"] = 100 };
var ticked = new HashSet<string> { "coo", "qui", "str" };
int rr = 0;
Check.Eq(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Priority, Order, ticked, cost, 1000, ref rr), "coo",
"priority: the first affordable stat in the order");
Check.Eq(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Priority, Order, ticked, cost, 400, ref rr), "qui",
"priority: skips a stat it can't afford");
Check.Eq(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Cheapest, Order, ticked, cost, 1000, ref rr), "str",
"cheapest: the lowest next-level cost");
var tie = new Dictionary<string, long> { ["coo"] = 100, ["str"] = 100 };
Check.Eq(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Cheapest, Order, ticked, tie, 1000, ref rr), "coo",
"cheapest: a tie goes to the higher-priority stat");
rr = 0;
var picks = new List<string?>();
for (int i = 0; i < 4; i++) picks.Add(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.RoundRobin, Order, ticked, cost, 1000, ref rr));
Check.Eq(string.Join(",", picks), "coo,qui,str,coo", "round robin: one each in order, then around again");
rr = 0;
Check.Eq(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.RoundRobin, Order, ticked, cost, 400, ref rr), "qui",
"round robin: an unaffordable stat is passed over");
Check.Eq(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.RoundRobin, Order, ticked, cost, 400, ref rr), "str",
"round robin: carries on from the last pick");
}
private static void PickLimits()
{
var cost = new Dictionary<string, long> { ["coo"] = 500, ["qui"] = 300 };
int rr = 0;
Check.Null(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Priority, Order, new HashSet<string>(), cost, 10_000, ref rr),
"nothing ticked: nothing raised");
Check.Eq(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Priority, Order, new HashSet<string> { "qui" }, cost, 10_000, ref rr), "qui",
"an unticked stat is never spent on, even at the top of the order");
Check.Null(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Priority, Order, new HashSet<string> { "coo", "qui" }, cost, 0, ref rr),
"no budget (XP at or below the reserve): nothing raised");
Check.Null(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Priority, Order, new HashSet<string> { "str" }, cost, 10_000, ref rr),
"a stat whose cost wasn't read is not raised blind");
var zero = new Dictionary<string, long> { ["coo"] = 0 };
Check.Null(IltAttributeRaiser.Pick(IltAttributeRaiser.Mode.Cheapest, Order, new HashSet<string> { "coo" }, zero, 10_000, ref rr),
"a zero cost (unparsed) is not raised");
}
private static void OrderAndNames()
{
var repaired = IltAttributeRaiser.RepairOrder(new List<string> { "sel", "bogus", "Self", "Strength", "hea" });
Check.Eq(string.Join(",", repaired), "sel,str,hea,coo,qui,end,foc,sta,man",
"saved order kept, duplicates/junk dropped, missing stats appended in the default order");
Check.Eq(IltAttributeRaiser.RepairOrder(null).Count, 9, "a missing order becomes the default");
Check.Eq(string.Join(",", IltAttributeRaiser.RepairSelection(new List<string> { "Coordination", "coo", "x" })), "coo",
"selection: names map to abbreviations, duplicates and junk dropped");
Check.Eq(IltAttributeRaiser.Find("MaxHealth")?.Abbr, "hea", "cost line 'MaxHealth'");
Check.Eq(IltAttributeRaiser.Find("Maximum Stamina")?.Abbr, "sta", "'Maximum Stamina'");
Check.Eq(IltAttributeRaiser.Find("Self")?.Abbr, "sel", "Self");
Check.Eq(IltAttributeRaiser.Find("qui")?.Abbr, "qui", "abbreviation");
Check.Null(IltAttributeRaiser.Find("Luck"), "unknown names are rejected");
var cost = IltParse.XpCost.Match("[XP] Your XP cost for next 1 Coordination level is: 12,345,678");
Check.True(cost.Success && cost.Groups[1].Value == "Coordination" && IltParse.ParseLeadingLong(cost.Groups[2].Value) == 12_345_678,
"the /xp all cost line parses");
var raised = IltParse.AttrRaised.Match("[ATTR] Quickness attribute raised by 1, costing 9,876!");
Check.True(raised.Success && raised.Groups[1].Value == "Quickness" && raised.Groups[2].Value == "1"
&& IltParse.ParseLeadingLong(raised.Groups[3].Value) == 9876, "the /attr success line parses");
}
// ── The loop on the fake host ─────────────────────────────────────────────
private static IltHubController NewHub(string world, IltSettings settings, string folder, out RynthCoreHost host)
{
FakeHost.Reset();
FakeHost.WorldName = world;
host = FakeHost.Create(Player);
string dir = Path.Combine(Program.TempRoot, folder);
Directory.CreateDirectory(dir);
// No RynthAi here (the fake host has no GetPluginInterface): RynthILT runs on its own.
return new IltHubController(host, dir, settings, new RynthAiClient(host));
}
/// <summary>Ticks the hub until <paramref name="done"/> or the timeout (the chat queue spaces sends by real time).</summary>
private static bool TickUntil(IltHubController hub, Func<bool> done, int timeoutMs = 6000)
{
var until = DateTime.UtcNow.AddMilliseconds(timeoutMs);
while (DateTime.UtcNow < until)
{
hub.Tick();
if (done()) return true;
Thread.Sleep(25);
}
return false;
}
private static void Reply(IltHubController hub, params string[] lines)
{
foreach (string l in lines) hub.OnChat(l);
}
private static void FullRun()
{
var settings = new IltSettings();
var hub = NewHub("InfiniteLeaftide", settings, "attr-run", out _);
var c = hub.State.Character;
c.AttrRaiseStats = new List<string> { "coo", "qui" };
c.AttrRaiseMode = (int)IltAttributeRaiser.Mode.Priority;
c.AttrKeepXp = 200;
FakeHost.Quads[(Player, IltInventory.QuadAvailableXp)] = 2_500;
var raiser = hub.Progression.Attributes;
Check.Null(raiser.Blocker(), "an ILT world with /xp not reported off: the raiser can run");
raiser.Start(auto: false);
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/xp all")), "a run starts by reading the costs");
Reply(hub, "[XP] Your XP cost for next 1 Strength level is: 50",
"[XP] Your XP cost for next 1 Coordination level is: 1,000",
"[XP] Your XP cost for next 1 Quickness level is: 1,200");
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/attr coo 1")),
"priority: Coordination first (Strength is cheaper but not ticked)");
FakeHost.Quads[(Player, IltInventory.QuadAvailableXp)] = 1_500;
Reply(hub, "[ATTR] Coordination attribute raised by 1, costing 1,000!");
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Count(x => x == "/xp all") >= 2), "costs are read again after each raise");
Reply(hub, "[XP] Your XP cost for next 1 Coordination level is: 2,000",
"[XP] Your XP cost for next 1 Quickness level is: 1,200");
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/attr qui 1")),
"Coordination now costs more than the spendable 1,300: Quickness next");
FakeHost.Quads[(Player, IltInventory.QuadAvailableXp)] = 300;
Reply(hub, "[ATTR] Quickness attribute raised by 1, costing 1,200!");
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Count(x => x == "/xp all") >= 3), "third cost read");
Reply(hub, "[XP] Your XP cost for next 1 Coordination level is: 2,000",
"[XP] Your XP cost for next 1 Quickness level is: 1,500");
Check.True(TickUntil(hub, () => !raiser.Running), "nothing affordable above the reserve: the run ends");
Check.Eq(FakeHost.ChatCommands.Count(x => x.StartsWith("/attr", StringComparison.Ordinal)), 2, "exactly two raises sent");
string summary = FakeHost.Chat.LastOrDefault(x => x.Contains("Attribute raise")) ?? "";
Check.True(summary.Contains("Coordination +1") && summary.Contains("Quickness +1") && summary.Contains("2.2K"),
$"the run reports what it raised and spent (got '{summary}')");
var sb = new System.Text.StringBuilder();
raiser.AppendJson(sb);
string json = sb.ToString();
Check.True(json.StartsWith("\"attr\":{\"off\":false", StringComparison.Ordinal), "the Progression snapshot carries the raiser");
Check.True(json.Contains("\"key\":\"coo\"") && json.Contains("\"cost\":\"2.0K\""), "rows carry the last read costs");
System.Text.Json.JsonDocument.Parse("{" + json + "}").Dispose(); // throws if the JSON is malformed
// Panel commands: order, ticks, mode, reserve, a manual +10.
raiser.HandleRemote("attrmove", new[] { "attrmove", "qui", "up" });
Check.Eq(c.AttrOrder[0], "qui", "attrmove up");
raiser.HandleRemote("attron", new[] { "attron", "str", "on" });
Check.True(c.AttrRaiseStats.Contains("str"), "attron");
raiser.HandleRemote("attrmode", new[] { "attrmode", "2" });
Check.Eq(c.AttrRaiseMode, 2, "attrmode");
raiser.HandleRemote("attrkeep", new[] { "attrkeep", "1.5b" });
Check.Eq(c.AttrKeepXp, 1_500_000_000L, "attrkeep takes k/m/b suffixes");
raiser.HandleRemote("attrraise", new[] { "attrraise", "foc", "10" });
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/attr foc 10")), "a manual +10 sends /attr foc 10");
}
private static void Safety()
{
var settings = new IltSettings();
var hub = NewHub("InfiniteLeaftide", settings, "attr-safety", out _);
var c = hub.State.Character;
var raiser = hub.Progression.Attributes;
c.AttrRaiseStats = new List<string> { "coo", "qui" };
FakeHost.Quads[(Player, IltInventory.QuadAvailableXp)] = 10_000;
// A cost seen earlier (passively, here by a hand-typed /xp all) is not trusted by a run:
// only the costs in the run's own read count.
Reply(hub, "[XP] Your XP cost for next 1 Coordination level is: 100");
raiser.Start(auto: false);
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/xp all")), "run reads costs");
Reply(hub, "[XP] Your XP cost for next 1 Quickness level is: 500"); // Coordination missing this time
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Any(x => x.StartsWith("/attr", StringComparison.Ordinal))), "a raise is sent");
Check.Eq(FakeHost.ChatCommands.First(x => x.StartsWith("/attr", StringComparison.Ordinal)), "/attr qui 1",
"Coordination's older cost is not used when this read left it out");
// A reply about another stat (some other /attr sender) is not taken as our success.
Reply(hub, "[ATTR] Strength attribute raised by 1, costing 50!");
Check.True(TickUntil(hub, () => !raiser.Running), "a reply about another stat ends the run");
Check.Eq(FakeHost.ChatCommands.Count(x => x.StartsWith("/attr", StringComparison.Ordinal)), 1, "and nothing more is raised");
Check.False(FakeHost.Chat.Any(x => x.Contains("Attribute raise")), "and no raise is reported");
// The world leaves Server Features mid-run: the next step stops.
FakeHost.ChatCommands.Clear();
raiser.Start(auto: false);
Check.True(TickUntil(hub, () => FakeHost.ChatCommands.Contains("/xp all")), "second run reads costs");
settings.ServerNames = new List<string> { "SomewhereElse" };
Reply(hub, "[XP] Your XP cost for next 1 Coordination level is: 100");
Check.True(TickUntil(hub, () => !raiser.Running), "the run stops once the world is off");
Check.False(FakeHost.ChatCommands.Any(x => x.StartsWith("/attr", StringComparison.Ordinal)), "no raise after the gate closed");
settings.ServerNames = new List<string>(ServerFeatureGate.DefaultServerNames);
// Another XP spender running: neither Raise now nor +N starts.
bool spending = true;
raiser.HoldOff = () => spending;
FakeHost.ChatCommands.Clear();
raiser.Start(auto: false);
raiser.RaiseManual("coo", 1);
TickUntil(hub, () => false, 600);
Check.False(raiser.Running, "held off: Raise now doesn't start");
Check.False(FakeHost.ChatCommands.Any(), "held off: nothing is sent");
}
private static void GatedOff()
{
var settings = new IltSettings();
var hub = NewHub("Aelrynth", settings, "attr-gated", out _);
var raiser = hub.Progression.Attributes;
hub.State.Character.AttrRaiseStats = new List<string> { "coo" };
Check.NotNull(raiser.Blocker(), "a world not in the list: blocked");
raiser.Start(auto: false);
TickUntil(hub, () => false, 600);
Check.False(FakeHost.ChatCommands.Any(), "nothing is sent off a feature world");
settings.ServerNames.Add("Aelrynth");
Check.Null(raiser.Blocker(), "adding the world to the server list unblocks it");
settings.ServerNames.Remove("Aelrynth");
hub.State.ForceLeaftideFeatures = true;
Check.Null(raiser.Blocker(), "so does the character's override");
}
}

View file

@ -0,0 +1,66 @@
using RynthCore.Plugin.RynthILT.Hub;
using RynthCore.RynthAiTests.Harness;
namespace RynthILT.Tests;
// Banking tab (IltBankCommands): the deposit / withdraw commands match ACECustom's /bank handler
// (upstream 2026-10-11), and only the bank's own reply lines count as a deposit / withdraw result.
internal static class BankCommandTests
{
public static void Register(Runner r)
{
r.Add("bank: deposit commands (everything, one kind, luminance tokens)", Deposits);
r.Add("bank: withdraw commands, trade notes by denomination and count", Withdrawals);
r.Add("bank: withdraw input is checked before anything is sent", WithdrawRefusals);
r.Add("bank: reply lines are recognised, balance and chat lines are not", Replies);
}
private static int DepositIndex(string args) =>
System.Array.FindIndex(IltBankCommands.Deposits, d => d.Args == args);
private static int WithdrawIndex(string code) =>
System.Array.FindIndex(IltBankCommands.Withdrawals, w => w.Code == code);
private static void Deposits()
{
Check.Eq(IltBankCommands.Deposit(0), "/b d", "Everything is a plain deposit");
Check.Eq(IltBankCommands.Deposit(DepositIndex("p")), "/b d p", "pyreals");
Check.Eq(IltBankCommands.Deposit(DepositIndex("pc")), "/b d pc", "prestige coins");
Check.Eq(IltBankCommands.Deposit(DepositIndex("lum")), "/b lum", "luminance tokens use /b lum");
Check.Eq(IltBankCommands.Deposit(-1), "", "unknown index sends nothing");
Check.Eq(IltBankCommands.Deposit(IltBankCommands.Deposits.Length), "", "past the end sends nothing");
}
private static void Withdrawals()
{
Check.Eq(IltBankCommands.Withdraw(WithdrawIndex("p"), 1_500_000, 0, out _), "/b w p 1500000", "pyreals");
Check.Eq(IltBankCommands.Withdraw(WithdrawIndex("pc"), 3, 0, out _), "/b w pc 3", "prestige coins");
int mmd = System.Array.FindIndex(IltBankCommands.NoteDenominations, n => n.Code == "mmd");
Check.Eq(IltBankCommands.Withdraw(WithdrawIndex("n"), 5, mmd, out _), "/b w n mmd 5", "five 250K notes");
}
private static void WithdrawRefusals()
{
Check.Eq(IltBankCommands.Withdraw(WithdrawIndex("p"), 0, 0, out string e1), "", "zero refused");
Check.True(e1.Length > 0, "zero says why");
Check.Eq(IltBankCommands.Withdraw(-1, 10, 0, out _), "", "no currency refused");
Check.Eq(IltBankCommands.Withdraw(WithdrawIndex("n"), 10, 99, out _), "", "bad denomination refused");
Check.Eq(IltBankCommands.Withdraw(WithdrawIndex("n"), IltBankCommands.MaxNoteCount + 1, 0, out string e2), "",
"more notes than the server allows refused");
Check.True(e2.Contains("50,000"), "says the limit");
}
private static void Replies()
{
Check.True(IltBankCommands.IsActionReply("Deposited 12,345 pyreals"), "deposit");
Check.True(IltBankCommands.IsActionReply("No pyreal peas found to deposit"), "nothing to deposit");
Check.True(IltBankCommands.IsActionReply("Withdrew 2 prestige coins"), "withdraw");
Check.True(IltBankCommands.IsActionReply("Starting Banked Lum: 5B (5,000,000,000)"), "token deposit start");
Check.True(IltBankCommands.IsActionReply("[Withdraw] This command may only be run once every 5 seconds."), "throttled");
Check.True(IltBankCommands.IsActionReply("You don't have enough luminance banked. Need 10 but only have 5."), "short");
Check.False(IltBankCommands.IsActionReply("[BANK] Pyreals: 1,000"), "a balance line is not an action reply");
Check.False(IltBankCommands.IsActionReply("No one is near."), "other 'No ...' lines are not");
Check.False(IltBankCommands.IsActionReply("Bob tells you, \"Deposited 5 pyreals\""), "a tell is not");
Check.False(IltBankCommands.IsActionReply(""), "empty");
}
}

View file

@ -0,0 +1,450 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using RynthCore.Loot;
using RynthCore.Plugin.RynthILT;
using RynthCore.Plugin.RynthILT.Hub;
using RynthCore.Plugin.Shared;
using RynthCore.RynthAiTests.Harness;
namespace RynthILT.Tests;
// The ILT Hub's move out of RynthAi into RynthILT (2026-10-13): the saved data carried over from
// RynthAi's folders (copied, never moved), the RynthILT.Hub interface table RynthAi's Mini Remote
// reads, which "/ra" verbs RynthILT takes from RynthAi, and the host-backed object view that
// replaced RynthAi's WorldObjectCache.
internal static class MoveTests
{
public static void Register(Runner r)
{
r.Add("move: a character's RynthAi ILT Hub files are copied, the RynthAi copies left alone", MigratesCharacter);
r.Add("move: migration never overwrites RynthILT's files and runs once", MigrationIdempotent);
r.Add("move: the pre-per-server ACEmulator folder is found too", MigratesFromAceEmulatorFolder);
r.Add("move: shared Hub profiles and aug costs are copied once", MigratesShared);
r.Add("move: a migration copy that fails is reported (log + chat) and the shared ones retried", MigrationFailuresReported);
r.Add("move: a failed Hub save is reported once and retried", StoreSaveFailureReported);
r.Add("move: an unfinished copy blocks the character's Hub writes until the retry copies the original", PendingMigrationNeverShadowed);
r.Add("move: an old ilt-hub.json loads into RynthILT's state (ILT parts kept)", LegacyStateLoads);
r.Add("move: RynthAi's \"/ra\" verbs RynthILT takes (and the ones it leaves)", VerbRouting);
r.Add("move: item classes from the client's item type (the gear tools' checks)", Classification);
r.Add("move: the interface structs have the agreed layout", InterfaceLayout);
r.Add("move: server-list status lines", DescribeLines);
r.Add("move: off ILT nothing is sent, no tab or section shows; on ILT the login probe runs", DormantOffIlt);
// Last: Release() switches the table off for the rest of the process.
r.Add("move: the RynthILT.Hub table: query, functions, release", HubTable);
}
private static string Root(string name)
{
string dir = Path.Combine(Program.TempRoot, "move-" + name);
if (Directory.Exists(dir)) Directory.Delete(dir, recursive: true);
Directory.CreateDirectory(dir);
IltMigration.LegacyProfilesBase = Path.Combine(dir, "RynthAi", "SettingsProfiles");
IltMigration.LegacySharedRoot = Path.Combine(dir, "RynthAi");
return dir;
}
private const string LegacyHubJson = """
{
"SchemaVersion": 1,
"ForceLeaftideFeatures": false,
"UbSidecarsImported": true,
"Bank": { "Pyreals": 1234567, "Luminance": 89, "EnlightenedCoins": 42, "AutoRefreshSeconds": 300 },
"Pet": { "HealingEnabled": true, "HealPetName": "Healing Buddy", "PetLog": ["Fire Banshee"], "ShinyLog": [] },
"Character": {
"QuestFilter": "temple", "QbFilter": "wait", "QuestFavorites": ["foo"],
"AttrOrder": ["qui","coo","str","end","foc","sel","hea","sta","man"], "AttrRaiseStats": ["qui"],
"AugTargets": { "war": 1800 }
},
"Gear": { "AutoClap": true, "LastUsdPath": "C:\\vt\\x.usd", "LastEquipProfile": "Melee" },
"Guardian": { "AutoHandIn": true, "TurnInCounts": { "Strength": 3 } }
}
""";
private static string MakeLegacyChar(string world, string charName, bool withProfile = true)
{
string dir = Path.Combine(IltMigration.LegacyProfilesBase, IltMigration.RynthAiSafeName(world), IltMigration.RynthAiSafeName(charName));
Directory.CreateDirectory(Path.Combine(dir, "ilt-hub-profiles"));
File.WriteAllText(Path.Combine(dir, "ilt-hub.json"), LegacyHubJson);
File.WriteAllText(Path.Combine(dir, "ilt-hub-transactions.json"), "[{\"Type\":\"Received\",\"Currency\":\"Pyreals\",\"Amount\":5}]");
File.WriteAllText(Path.Combine(dir, "ilt-hub-profiles", "farm.json"), "{\"SchemaVersion\":1}");
if (withProfile)
{
File.WriteAllText(Path.Combine(dir, "active_profile.txt"), "Melee");
File.WriteAllText(Path.Combine(dir, "Melee.json"),
"{\"MetaDebug\":false,\"FeatureServerNames\":[\"InfiniteLeaftide\",\"*Leaftide*\",\"MyShard\"],\"ForceServerFeatures\":true}");
File.WriteAllText(Path.Combine(dir, "Default.json"), "{\"FeatureServerNames\":[\"Unused\"]}");
}
return dir;
}
private static void MigratesCharacter()
{
string root = Root("char");
string legacy = MakeLegacyChar("Infinite Leaftide", "Sir Tester");
string before = File.ReadAllText(Path.Combine(legacy, "ilt-hub.json"));
var settings = new IltSettings();
string dest = Path.Combine(root, "RynthILT", "Infinite Leaftide", "Sir Tester");
var done = IltMigration.MigrateCharacter(dest, "Infinite Leaftide", "Sir Tester", settings, out bool force);
Check.True(File.Exists(Path.Combine(dest, IltHubStore.StateFile)), "ilt-hub.json -> hub.json");
Check.Eq(File.ReadAllText(Path.Combine(dest, IltHubStore.StateFile)), before, "copied byte for byte");
Check.True(File.Exists(Path.Combine(dest, IltHubStore.TransactionsFile)), "transactions copied");
Check.True(File.Exists(Path.Combine(dest, IltHubStore.ProfilesFolder, "farm.json")), "per-character Hub profiles copied");
Check.True(File.Exists(Path.Combine(legacy, "ilt-hub.json")) && File.Exists(Path.Combine(legacy, "ilt-hub-transactions.json")),
"RynthAi's files are still there (copy, not move)");
Check.True(settings.ServerNames.Contains("MyShard"), "the active profile's server names are added");
Check.False(settings.ServerNames.Contains("Unused"), "only the ACTIVE profile is read");
Check.Eq(settings.ServerNames.Count(n => n.Equals("InfiniteLeaftide", StringComparison.OrdinalIgnoreCase)), 1, "no duplicates");
Check.True(force, "\"Force enable\" carries over as Treat this world as ILT");
Check.True(done.Count >= 4, "the log line lists what was carried over: " + string.Join(", ", done));
}
private static void MigrationIdempotent()
{
string root = Root("idem");
string legacy = MakeLegacyChar("InfiniteLeaftide", "Again", withProfile: false);
string dest = Path.Combine(root, "RynthILT", "InfiniteLeaftide", "Again");
Directory.CreateDirectory(dest);
File.WriteAllText(Path.Combine(dest, IltHubStore.TransactionsFile), "[]"); // RynthILT already has one
var settings = new IltSettings();
IltMigration.MigrateCharacter(dest, "InfiniteLeaftide", "Again", settings, out bool force);
Check.Eq(File.ReadAllText(Path.Combine(dest, IltHubStore.TransactionsFile)), "[]", "an existing RynthILT file is never overwritten");
Check.True(File.Exists(Path.Combine(dest, IltHubStore.StateFile)), "the missing hub.json is still copied");
Check.False(force, "no profile, no override");
File.WriteAllText(Path.Combine(legacy, "ilt-hub.json"), "{\"Bank\":{\"Pyreals\":1}}");
var second = IltMigration.MigrateCharacter(dest, "InfiniteLeaftide", "Again", settings, out _);
Check.Eq(second.Count, 0, "once hub.json exists the character is never migrated again");
Check.False(File.ReadAllText(Path.Combine(dest, IltHubStore.StateFile)).Contains("\"Pyreals\":1}"), "later RynthAi edits don't overwrite RynthILT's state");
var none = IltMigration.MigrateCharacter(Path.Combine(root, "RynthILT", "X", "Nobody"), "X", "Nobody", settings, out _);
Check.Eq(none.Count, 0, "a character RynthAi never saw: nothing to do");
Check.False(Directory.Exists(Path.Combine(root, "RynthILT", "X", "Nobody")), "and no folder is made for it");
}
private static void MigratesFromAceEmulatorFolder()
{
string root = Root("ace");
MakeLegacyChar("ACEmulator", "Old Timer", withProfile: false);
var settings = new IltSettings();
string dest = Path.Combine(root, "RynthILT", "InfiniteLeaftide", "Old Timer");
Check.NotNull(IltMigration.FindLegacyCharFolder("InfiniteLeaftide", "Old Timer"), "the world folder is missing, ACEmulator\\<char> is used");
IltMigration.MigrateCharacter(dest, "InfiniteLeaftide", "Old Timer", settings, out _);
Check.True(File.Exists(Path.Combine(dest, IltHubStore.StateFile)), "copied from the ACEmulator folder");
Check.Eq(IltMigration.RynthAiSafeName("Sir O'Neil-Smith"), "Sir_O'Neil-Smith", "RynthAi's folder names keep ' and - only");
}
private static void MigratesShared()
{
string root = Root("shared");
Directory.CreateDirectory(Path.Combine(IltMigration.LegacySharedRoot, "IltHubProfiles"));
File.WriteAllText(Path.Combine(IltMigration.LegacySharedRoot, "IltHubProfiles", "team.json"), "{}");
File.WriteAllText(Path.Combine(IltMigration.LegacySharedRoot, "ilt-aug-costs.json"), "{\"x\":1}");
var settings = new IltSettings();
string dest = Path.Combine(root, "RynthILT");
var done = IltMigration.MigrateShared(settings, dest);
Check.True(File.Exists(Path.Combine(dest, "Profiles", "team.json")), "shared profiles copied");
Check.True(File.Exists(Path.Combine(dest, "ilt-aug-costs.json")), "aug costs copied");
Check.True(settings.SharedFilesMigrated, "marked done in the settings");
Check.Eq(done.Count, 2, "both reported");
File.Delete(Path.Combine(dest, "ilt-aug-costs.json"));
Check.Eq(IltMigration.MigrateShared(settings, dest).Count, 0, "once only");
Check.False(File.Exists(Path.Combine(dest, "ilt-aug-costs.json")), "a file deleted afterwards isn't brought back");
}
// A copy that fails (here: the RynthAi file held open by another program) is never silent: it
// is logged and queued for chat with the reason, the rest still copies, and the shared files
// aren't marked done so the next login tries again.
private static void MigrationFailuresReported()
{
string root = Root("fail");
DataWriteGuard.Reset();
string legacy = MakeLegacyChar("InfiniteLeaftide", "Locked Out");
string dest = Path.Combine(root, "RynthILT", "InfiniteLeaftide", "Locked Out");
var settings = new IltSettings();
List<string> done;
using (new FileStream(Path.Combine(legacy, "ilt-hub-transactions.json"), FileMode.Open, FileAccess.Read, FileShare.None))
done = IltMigration.MigrateCharacter(dest, "InfiniteLeaftide", "Locked Out", settings, out _);
Check.True(File.Exists(Path.Combine(dest, IltHubStore.StateFile)), "the other files are still copied");
Check.False(File.Exists(Path.Combine(dest, IltHubStore.TransactionsFile)), "the held file isn't");
Check.True(done.Any(l => l.Contains("NOT copied") && l.Contains(legacy)), "the log line says so and where the originals are: " + string.Join(", ", done));
Check.Eq(DataWriteGuard.PendingCount, 1, "one chat line queued (shown on ILT)");
var lines = new List<string>();
DataWriteGuard.DrainChat(lines.Add);
Check.True(lines.Count == 1 && lines[0].StartsWith("[RynthILT]", StringComparison.Ordinal)
&& lines[0].Contains("ilt-hub-transactions.json") && lines[0].Contains("another program"),
"it names the file and the reason: " + string.Join(" | ", lines));
DataWriteGuard.Reset();
Directory.CreateDirectory(Path.Combine(IltMigration.LegacySharedRoot, "IltHubProfiles"));
File.WriteAllText(Path.Combine(IltMigration.LegacySharedRoot, "IltHubProfiles", "team.json"), "{}");
string aug = Path.Combine(IltMigration.LegacySharedRoot, "ilt-aug-costs.json");
File.WriteAllText(aug, "{\"x\":1}");
string sharedDest = Path.Combine(root, "RynthILT");
using (new FileStream(aug, FileMode.Open, FileAccess.Read, FileShare.None))
done = IltMigration.MigrateShared(settings, sharedDest);
Check.False(settings.SharedFilesMigrated, "a failed shared copy isn't marked done");
Check.True(done.Any(l => l.Contains("NOT copied")), "and is reported: " + string.Join(", ", done));
Check.True(DataWriteGuard.PendingCount >= 1, "in chat too");
done = IltMigration.MigrateShared(settings, sharedDest);
Check.True(File.Exists(Path.Combine(sharedDest, "ilt-aug-costs.json")), "the next login copies it");
Check.True(settings.SharedFilesMigrated, "then it is marked done");
Check.Eq(done.Count, 1, "only the missing file is copied the second time: " + string.Join(", ", done));
DataWriteGuard.Reset();
}
// A character whose ilt-hub.json couldn't be copied (held open by another program): the Hub
// runs from the RynthAi original read-only (or the defaults), writes no hub.json, bank log or
// per-character profile there, the pending mark survives a restart, and the next attempt copies
// the original byte for byte - never shadowed by a fresh file.
private static void PendingMigrationNeverShadowed()
{
string root = Root("pending");
DataWriteGuard.Reset();
string legacy = MakeLegacyChar("InfiniteLeaftide", "Held Open");
string legacyHub = Path.Combine(legacy, "ilt-hub.json");
string dest = Path.Combine(root, "RynthILT", "InfiniteLeaftide", "Held Open");
string hubJson = Path.Combine(dest, IltHubStore.StateFile);
var settings = new IltSettings();
// Held open by another program: neither copied nor readable.
using (var held = new FileStream(legacyHub, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
{
var done = IltMigration.MigrateCharacter(dest, "InfiniteLeaftide", "Held Open", settings, out _);
Check.False(File.Exists(hubJson), "the held ilt-hub.json isn't copied");
Check.True(IltMigration.IsPending(settings, dest), "the character is marked pending");
Check.True(done.Any(l => l.Contains("NOT copied")), "and the log says so: " + string.Join(", ", done));
var store = new IltHubStore(default, dest)
{
WritesBlocked = () => IltMigration.IsPending(settings, dest),
LegacyFolder = legacy,
};
IltHubState state = store.LoadState();
Check.Eq(state.Bank.Pyreals, 0L, "unreadable: the Hub runs from the defaults");
state.Bank.Pyreals = 1;
store.SaveStateIfDirty(state);
Check.False(File.Exists(hubJson), "no hub.json is written while the copy is unfinished");
Check.False(store.SaveProfile(state, "mine", shared: false, out string why), "nor a per-character profile");
Check.True(why.Contains("RynthAi"), "with the reason: " + why);
Check.True(store.SaveProfile(state, "team-" + Guid.NewGuid().ToString("N"), shared: true, out _), "shared profiles still save");
// A second login while still held: still pending, still nothing written.
IltMigration.MigrateCharacter(dest, "InfiniteLeaftide", "Held Open", settings, out _);
Check.True(IltMigration.IsPending(settings, dest) && !File.Exists(hubJson), "still pending, still no hub.json");
}
// Readable again but not yet retried: a Hub started now reads the original, still writes nothing.
var readOnly = new IltHubStore(default, dest)
{
WritesBlocked = () => IltMigration.IsPending(settings, dest),
LegacyFolder = legacy,
};
IltHubState fromLegacy = readOnly.LoadState();
Check.Eq(fromLegacy.Bank.Pyreals, 1234567L, "the Hub runs from the RynthAi original, read only");
fromLegacy.Bank.Pyreals = 2;
readOnly.SaveStateIfDirty(fromLegacy);
Check.False(File.Exists(hubJson), "and still writes no hub.json");
// The mark is in settings.json, so a client restart still knows the copy is unfinished.
IltSettingsStore.Save(settings);
IltSettings reloaded = IltSettingsStore.Load();
Check.True(IltMigration.IsPending(reloaded, dest), "pending survives a restart");
var finished = IltMigration.MigrateCharacter(dest, "InfiniteLeaftide", "Held Open", reloaded, out bool force);
Check.True(File.Exists(hubJson), "the next attempt copies it");
Check.Eq(File.ReadAllText(hubJson), File.ReadAllText(legacyHub), "byte for byte: the original, not a fresh file");
Check.False(IltMigration.IsPending(reloaded, dest), "no longer pending");
Check.True(force, "the profile's Force enable still carries over on the retry");
Check.True(finished.Any(l => l.Contains("complete")), "the log says it finished: " + string.Join(", ", finished));
var after = new IltHubStore(default, dest) { WritesBlocked = () => IltMigration.IsPending(reloaded, dest) };
IltHubState loaded = after.LoadState();
Check.Eq(loaded.Bank.Pyreals, 1234567L, "the restarted Hub loads the copied file");
loaded.Bank.Pyreals = 7;
after.SaveStateIfDirty(loaded);
Check.True(File.ReadAllText(hubJson).Contains("\"Pyreals\": 7"), "and saves normally from then on");
File.Delete(Path.Combine(IltSettingsStore.Folder, IltSettingsStore.FileName));
DataWriteGuard.Reset();
}
// RynthILT's own saves report a failure (DataWriteGuard) and try again on the next save.
private static void StoreSaveFailureReported()
{
string root = Root("storefail");
DataWriteGuard.Reset();
string blocker = Path.Combine(root, "NotAFolder");
File.WriteAllText(blocker, "a file where the character folder should be");
var store = new IltHubStore(default, blocker);
var state = new IltHubState();
store.SaveStateIfDirty(state);
Check.Eq(DataWriteGuard.PendingCount, 1, "the failed Hub save is queued for chat");
store.SaveStateIfDirty(state);
Check.Eq(DataWriteGuard.PendingCount, 1, "once per folder, not every retry");
File.Delete(blocker);
store.SaveStateIfDirty(state);
Check.True(File.Exists(Path.Combine(blocker, IltHubStore.StateFile)), "the next save retries and works");
DataWriteGuard.Reset();
}
private static void LegacyStateLoads()
{
string root = Root("state");
string dir = Path.Combine(root, "char");
Directory.CreateDirectory(dir);
File.WriteAllText(Path.Combine(dir, IltHubStore.StateFile), LegacyHubJson);
var store = new IltHubStore(default, dir);
var s = store.LoadState();
Check.Eq(s.Bank.Pyreals, 1234567L, "bank balances");
Check.Eq(s.Bank.AutoRefreshSeconds, 300, "bank settings");
Check.Eq(s.Pet.PetLog.FirstOrDefault(), "Fire Banshee", "the /pets log (an ILT part of the Pet section)");
Check.Eq(s.Character.QbFilter, "wait", "the /qb filter");
Check.Eq(s.Character.AttrOrder.FirstOrDefault(), "qui", "the attribute raiser's order");
Check.Eq(s.Character.AugTargets["war"], 1800, "aug targets");
Check.True(s.Gear.AutoClap && s.Gear.LastEquipProfile == "Melee", "gear settings");
Check.True(s.Guardian.AutoHandIn && s.Guardian.TurnInCounts["Strength"] == 3, "guardian settings");
Check.True(s.UbSidecarsImported, "the UB import isn't redone");
store.SaveStateIfDirty(s);
string saved = File.ReadAllText(Path.Combine(dir, IltHubStore.StateFile));
Check.False(saved.Contains("HealPetName"), "the Pets tab's settings (RynthAi's now) aren't written back here");
Check.False(saved.Contains("QuestFavorites"), "nor the Quests tab's");
}
private static void VerbRouting()
{
static bool Takes(string line) => RynthILTPlugin.IsIltVerb(line.Split(' ', StringSplitOptions.RemoveEmptyEntries));
Check.True(Takes("hub bank"), "hub bank");
Check.True(Takes("hub attr run"), "hub attr run");
Check.True(Takes("hub refresh"), "hub refresh");
Check.True(Takes("hub help"), "hub help (RynthILT prints the whole list)");
Check.True(Takes("hub open banking show"), "hub open <ILT tab>");
Check.True(Takes("hub open guardian"), "hub open guardian (the engine panel)");
Check.True(Takes("hub open bounties"), "hub open bounties");
Check.False(Takes("hub open pets"), "hub open pets is RynthAi's");
Check.False(Takes("hub open quests hide"), "hub open quests is RynthAi's");
Check.True(Takes("hub tab gear"), "hub tab <ILT tab>");
Check.False(Takes("hub tab quests"), "hub tab quests is RynthAi's");
Check.False(Takes("hub tab remote"), "the Remote tab is RynthAi's");
Check.False(Takes("hub"), "bare /ra hub toggles RynthAi's Mini Remote");
Check.True(Takes("guardian handin"), "guardian");
Check.True(Takes("bounty show") && Takes("bounties") && Takes("bountys"), "bounty, bounties, bountys");
Check.True(Takes("rates reset"), "rates reset (the Mini Remote's Reset XP)");
Check.False(Takes("quests refresh"), "/ra quests is RynthAi's");
Check.False(Takes("pets show"), "/ra pets is RynthAi's");
Check.False(Takes("start"), "anything else is RynthAi's");
// The VTank hotkey verbs (RynthAi 2026-10-13, RynthAiPlugin.VTankHotkeys.cs) stay RynthAi's.
foreach (string vt in new[] { "vtkeys", "targetlock", "recharge", "lootthis", "meleelow", "navprio", "lootprio", "navlootprio", "setmetastate Default", "testitem", "propertydump" })
Check.False(Takes(vt), $"{vt} is RynthAi's (VTank hotkeys)");
}
private static void Classification()
{
Check.Eq(IltObjects.ClassifyByItemType(0x00000800), AcObjectClass.Gem, "gem (aetheria)");
Check.Eq(IltObjects.ClassifyByItemType(0x00000001), AcObjectClass.MeleeWeapon, "melee weapon");
Check.Eq(IltObjects.ClassifyByItemType(0x00000100), AcObjectClass.MissileWeapon, "missile weapon");
Check.Eq(IltObjects.ClassifyByItemType(0x00008000), AcObjectClass.WandStaffOrb, "caster");
Check.Eq(IltObjects.ClassifyByItemType(0x40000000), AcObjectClass.Salvage, "salvage (white quartz)");
Check.Eq(IltObjects.ClassifyByItemType(0x00001000), AcObjectClass.SpellComponent, "spell component");
Check.Eq(IltObjects.ClassifyByItemType(0x00000200), AcObjectClass.Container, "pack");
Check.Eq(IltObjects.ClassifyByItemType(0x00000010), AcObjectClass.Monster, "creature");
Check.Eq(IltObjects.ClassifyByItemType(0x00000002 | 0x00000004), AcObjectClass.Armor, "armor wins over clothing");
Check.Eq(IltObjects.ClassifyByItemType(0), AcObjectClass.Unknown, "no type yet");
}
private static unsafe void InterfaceLayout()
{
Check.Eq(sizeof(IltTabV1), 24 + 32 + 4 + 4 + 4, "IltTabV1: id, label, width, height, flags");
Check.Eq((int)Marshal.OffsetOf<IltTabV1>(nameof(IltTabV1.Flags)), 64, "IltTabV1.Flags offset");
Check.Eq(sizeof(RynthIltHubApiV1), 8 + 9 * IntPtr.Size, "RynthIltHubApiV1: header + 9 functions");
Check.Eq(sizeof(RynthAiHubApiV1), 8 + 10 * IntPtr.Size, "RynthAiHubApiV1: header + 10 functions");
Check.Eq(sizeof(QuestFlagV1), 24, "QuestFlagV1");
Check.Eq(sizeof(QuestStatusV1), 16, "QuestStatusV1");
Check.Eq(RynthIltHubApiV1.InterfaceName, "RynthILT.Hub", "interface name");
Check.Eq(RynthAiHubApiV1.InterfaceName, "RynthAi.Hub", "RynthAi's interface name");
}
private static void DescribeLines()
{
var s = new IltSettings();
Check.True(ServerFeatureGate.Describe("InfiniteLeaftide", s, false).Contains("ON - matches 'InfiniteLeaftide'"), "on by name");
Check.True(ServerFeatureGate.Describe("Aelrynth", s, true).Contains("Treat this world as ILT"), "on by the override");
Check.True(ServerFeatureGate.Describe("Aelrynth", s, false).Contains("OFF"), "off");
Check.True(ServerFeatureGate.Describe("", s, false).Contains("not logged in"), "before login");
}
private static IltHubController NewHub(string world, string folder)
{
RynthCore.RynthAiHostTests.Fakes.FakeHost.Reset();
RynthCore.RynthAiHostTests.Fakes.FakeHost.WorldName = world;
var host = RynthCore.RynthAiHostTests.Fakes.FakeHost.Create(0x50000F01);
string dir = Path.Combine(Program.TempRoot, "move-" + folder);
Directory.CreateDirectory(dir);
return new IltHubController(host, dir, new IltSettings(), new RynthAiClient(host));
}
private static void TickFor(IltHubController hub, int ms)
{
var until = DateTime.UtcNow.AddMilliseconds(ms);
while (DateTime.UtcNow < until) { hub.Tick(); System.Threading.Thread.Sleep(50); }
}
private static void DormantOffIlt()
{
var off = NewHub("Aeshnidae", "dormant");
off.OnLoginComplete("Tester", forceFromMigration: false);
foreach (string line in new[] { "Your Pet Log:", "[BANK] Pyreals: 5", "Guardian of Strength tells you, \"x\"" }) off.OnChat(line);
TickFor(off, 6800); // past the 6 s login delay
Check.Eq(RynthCore.RynthAiHostTests.Fakes.FakeHost.ChatCommands.Count, 0, "off ILT: no probe, no command at all");
Check.False(off.Options.IsIltLikeWorld, "not an ILT world");
foreach (var s in IltSections.Tabs) Check.False(off.TabShown(s), $"no {IltSections.Label(s)} tab");
Check.False(off.RenderSection(RynthIltHub.SectionRemoteBank) || off.RenderSection(RynthIltHub.SectionQuestBonus)
|| off.RenderSection(RynthIltHub.SectionPetLogs) || off.RenderSection(RynthIltHub.SectionRemoteGuardian)
|| off.RenderSection(RynthIltHub.SectionServerMenu), "no ILT section draws (checked before any ImGui call)");
Check.True(off.BuildProgressionJson().StartsWith("{\"available\":false"), "Progression: not available");
off.OnLogout();
var on = NewHub("InfiniteLeaftide", "awake");
on.OnLoginComplete("Tester", forceFromMigration: false);
TickFor(on, 6800);
Check.True(on.Options.IsIltLikeWorld, "InfiniteLeaftide is ILT");
Check.True(RynthCore.RynthAiHostTests.Fakes.FakeHost.ChatCommands.Count > 0, "on ILT the login probe asks the server");
Check.True(on.TabShown(IltSection.Character), "and the Character tab shows");
on.OnLogout();
var forced = NewHub("Aeshnidae", "forced");
forced.OnLoginComplete("Tester", forceFromMigration: true);
Check.True(forced.Options.IsIltLikeWorld, "a migrated \"Force enable\" makes the world ILT for this character");
forced.OnLogout();
}
private static unsafe void HubTable()
{
Check.Eq(HubInterface.Query("RynthAi.Hub", 1), IntPtr.Zero, "another interface's name: not ours");
Check.Eq(HubInterface.Query(RynthIltHubApiV1.InterfaceName, 2), IntPtr.Zero, "a newer version than we have: none");
var t = (RynthIltHubApiV1*)HubInterface.Query(RynthIltHubApiV1.InterfaceName, 1);
Check.True(t != null, "v1 is served");
Check.Eq(t->Version, 1u, "Version 1");
Check.Eq(t->StructSize, (uint)sizeof(RynthIltHubApiV1), "StructSize");
Check.True(t->IsIltWorld != null && t->GetFeature != null && t->GetRates != null && t->GetForceIlt != null && t->SetForceIlt != null
&& t->GetTabs != null && t->RenderTab != null && t->RenderSection != null && t->Command != null, "every function is filled in");
Check.Eq((IntPtr)t, HubInterface.Query(RynthIltHubApiV1.InterfaceName, 1), "the same table each time");
// No plugin instance here (not logged in): every function answers "nothing".
Check.Eq(t->IsIltWorld(), 0, "not ILT before login");
byte* key = stackalloc byte[] { (byte)'b', (byte)'a', (byte)'n', (byte)'k', 0 };
Check.Eq(t->GetFeature(key), -1, "feature unknown before login");
Check.Eq(t->GetTabs(null, 0), 0, "no tabs before login");
Check.Eq(t->Command(key), 0, "no command taken before login");
HubInterface.Release();
Check.Eq(t->Version, 0u, "Release zeroes Version (callers re-query)");
Check.Eq(HubInterface.Query(RynthIltHubApiV1.InterfaceName, 1), IntPtr.Zero, "and nothing is served after shutdown");
Check.Eq(t->IsIltWorld(), 0, "the old table stays callable and answers nothing");
}
}

View file

@ -5,8 +5,9 @@ using RynthCore.RynthAiTests.Harness;
namespace RynthILT.Tests;
// Offline tests for the RynthILT plugin: the ACECustom bounty tracker (parsing, merging, the
// quiet /bounty list read loop on a fake clock, persistence, the bridge JSON). Each test prints
// PASS / FAIL.
// quiet /bounty list read loop on a fake clock, persistence, the bridge JSON) and the ILT Hub
// (attribute raiser, aug costs, bank commands, sigil chain, and the move out of RynthAi: data
// migration, the RynthILT.Hub table, verb routing, the object view). Each test prints PASS / FAIL.
//
// Run: dotnet run -c Release (all tests)
// dotnet run -c Release -- window (tests whose name contains "window")
@ -20,9 +21,23 @@ internal static class Program
if (Directory.Exists(TempRoot)) Directory.Delete(TempRoot, recursive: true);
Directory.CreateDirectory(TempRoot);
// SAFETY: every file the ILT Hub would write under %APPDATA%\RynthCore\RynthILT or read from
// the RynthAi folder points at the scratch folder before any test runs.
RynthCore.Plugin.RynthILT.Hub.IltAugCosts.FilePath = Path.Combine(TempRoot, "ilt-aug-costs.json");
RynthCore.Plugin.RynthILT.Hub.IltHubStore.SharedRoot = Path.Combine(TempRoot, "RynthILT");
RynthCore.Plugin.RynthILT.Hub.IltSettingsStore.Folder = Path.Combine(TempRoot, "RynthILT");
RynthCore.Plugin.RynthILT.Hub.IltMigration.LegacyProfilesBase = Path.Combine(TempRoot, "RynthAi", "SettingsProfiles");
RynthCore.Plugin.RynthILT.Hub.IltMigration.LegacySharedRoot = Path.Combine(TempRoot, "RynthAi");
RynthCore.Plugin.RynthILT.RynthLog.Init(default, Path.Combine(TempRoot, "Logs"));
RynthCore.Plugin.Shared.DataWriteGuard.PluginName = "RynthILT"; // as RynthILTPlugin.Initialize sets it
var runner = new Runner();
BountyTests.Register(runner);
BountyReviewTests.Register(runner);
AttributeRaiserTests.Register(runner);
SigilChainTests.Register(runner);
BankCommandTests.Register(runner);
MoveTests.Register(runner);
return runner.Run("RynthILT tests", args.Length > 0 ? args[0] : null);
}
}

View file

@ -1,28 +1,44 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
Tests for the RynthILT plugin's ACECustom bounty tracker (Bounty/BountyParse.cs and
Bounty/BountyTracker.cs, ported from SilentKelpie's rynth/RynthSuite PR #11 with his
BountyTests). The plugin is a NativeAOT x86 library, so its host-agnostic sources are
compiled in here directly instead of referencing the project. File tests use a scratch
folder next to the exe, never %APPDATA%\RynthCore.
Tests for the RynthILT plugin: the ACECustom bounty tracker (Bounty/, ported from SilentKelpie's
rynth/RynthSuite PR #11 with his BountyTests) and the ILT Hub moved out of RynthAi 2026-10-13
(the attribute raiser and aug costs, bank commands and the sigil chain, which ran in
RynthCore.RynthAiHostTests before, plus the move itself: data migration, the RynthILT.Hub
interface table, which "/ra" verbs RynthILT takes, the host-backed object view).
Like RynthCore.RynthAiHostTests this references the plugin project itself, so it is a
net10.0-windows x86 exe and needs the x86 .NET runtime (C:\Program Files (x86)\dotnet). The
plugin grants InternalsVisibleTo to this assembly name. The fake engine host is the RynthAi
host tests' FakeHost (linked; RYNTHILT_TESTS leaves out its RynthAi-only helpers). File tests
use a scratch folder next to the exe, never %APPDATA%\RynthCore or C:\Games.
Run: dotnet run -c Release (exit 0 = pass, 1 = fail; an argument filters by test name)
-->
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<InvariantGlobalization>true</InvariantGlobalization>
<RootNamespace>RynthILT.Tests</RootNamespace>
<AssemblyName>RynthILT.Tests</AssemblyName>
<Platforms>x86</Platforms>
<DefineConstants>$(DefineConstants);RYNTHILT_TESTS</DefineConstants>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthILT\Bounty\BountyParse.cs" Link="Plugin\BountyParse.cs" />
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthILT\Bounty\BountyTracker.cs" Link="Plugin\BountyTracker.cs" />
<Compile Include="..\..\Plugins\RynthCore.Plugin.RynthILT\RynthILTJsonContext.cs" Link="Plugin\RynthILTJsonContext.cs" />
<!-- The RynthAi test tools' check/runner harness (no plugin code in it). -->
<ProjectReference Include="..\..\Plugins\RynthCore.Plugin.RynthILT\RynthCore.Plugin.RynthILT.csproj" />
</ItemGroup>
<ItemGroup>
<!-- The RynthAi test tools' check/runner harness and fake engine host (no plugin code in them). -->
<Compile Include="..\RynthCore.RynthAiTests\Harness\Check.cs" Link="Harness\Check.cs" />
<Compile Include="..\RynthCore.RynthAiTests\Harness\Runner.cs" Link="Harness\Runner.cs" />
<Compile Include="..\RynthCore.RynthAiHostTests\Fakes\FakeHost.cs" Link="Fakes\FakeHost.cs" />
</ItemGroup>
<!-- The engine's Bounties snapshot reader (self-contained DTOs), so BountyTests checks the plugin's
@ -35,4 +51,9 @@
<Compile Include="..\..\..\RynthCore\src\RynthCore.Engine\UI\Data\BountiesSnapshotJson.cs" Link="Engine\BountiesSnapshotJson.cs" />
</ItemGroup>
<!-- The engine supplies cimgui; never copy ImGui.NET's own next to the test exe either. -->
<Target Name="RemoveBundledImGuiNative" AfterTargets="Build">
<Delete Files="$(OutputPath)cimgui.dll" Condition="Exists('$(OutputPath)cimgui.dll')" />
</Target>
</Project>

View file

@ -0,0 +1,83 @@
using RynthCore.Plugin.RynthILT.Hub;
using RynthCore.RynthAiTests.Harness;
namespace RynthILT.Tests;
// Enlightenment 301-325 sigil craft chain (2026-10-07). Each target level T costs T - 5 sigils and
// T x 2B luminance (ACECustom tier 5). Sigil = Lifeblood Elixir + Ascension Coin; Ascension Coin =
// E-coin + Ancient Yalani Trinket; Elixir = Lifebloom Resin + Necrolytic Extract; Resin = Life
// Splitter + Plant. Stock is used from the top of the chain down.
internal static class SigilChainTests
{
public static void Register(Runner r)
{
r.Add("sigil chain: 301-325 tier rates and sigil counts", TierRates);
r.Add("sigil chain: shortfall uses stock top-down", ShortfallTopDown);
r.Add("sigil chain: fulfillable count and shared e-coin pool", FulfillableAndCoins);
r.Add("sigil chain: item names (plural stacks, Plant exact)", Names);
}
private static void TierRates()
{
var t301 = IltProgression.EnlStepCost(301);
Check.Eq(t301.Item, "Enlightenment Sigils", "301 takes sigils");
Check.Eq(t301.Count, 296, "301 takes T - 5 sigils");
Check.Eq(t301.Lum, 301 * 2_000_000_000m, "301 costs T x 2B luminance (no step multiplier yet)");
Check.Eq(IltProgression.EnlStepCost(325).Lum, 325 * 2_000_000_000m, "325 still has no step multiplier");
Check.Eq(IltProgression.EnlStepCost(326).Item, "Enlightenment Crests", "326 moves to crests");
Check.Eq(IltSigilChain.SigilsForRange(300, 302), 296L + 297L, "range 300 -> 302 sums both levels");
Check.Eq(IltSigilChain.SigilsForRange(324, 330), 320L, "range clamps at 325");
Check.Eq(IltSigilChain.SigilsForRange(200, 300), 0L, "no sigils below 301");
}
private static void ShortfallTopDown()
{
var empty = IltSigilChain.Shortfall(10, new IltSigilStock());
Check.Eq(empty.CoinsShort, 10L, "empty pack: one e-coin per sigil");
Check.Eq(empty.PlantsShort, 10L, "empty pack: one plant per sigil");
Check.True(!empty.Covered, "empty pack is not covered");
var stock = new IltSigilStock
{
Sigils = 2, AscensionCoins = 3, LifebloodElixirs = 1, LifebloomResins = 4,
EnlightenedCoins = 100, YalaniTrinkets = 1, NecrolyticExtracts = 2, LifeSplitters = 0, Plants = 5,
};
var s = IltSigilChain.Shortfall(10, stock);
Check.Eq(s.SigilsToCraft, 8L, "2 finished sigils used first");
Check.Eq(s.AscensionToCraft, 5L, "3 Ascension Coins on hand");
Check.Eq(s.ElixirsToCraft, 7L, "1 Elixir on hand");
Check.Eq(s.CoinsShort, 0L, "100 e-coins cover 5 crafts");
Check.Eq(s.TrinketsShort, 4L, "1 trinket on hand");
Check.Eq(s.ExtractsShort, 5L, "2 extracts on hand");
Check.Eq(s.ResinsToCraft, 3L, "4 resins on hand");
Check.Eq(s.SplittersShort, 3L, "no splitters");
Check.Eq(s.PlantsShort, 0L, "5 plants cover 3 resins");
Check.True(IltSigilChain.Shortfall(5, new IltSigilStock { Sigils = 9 }).Covered, "finished sigils cover the demand");
}
private static void FulfillableAndCoins()
{
var stock = new IltSigilStock
{
Sigils = 1, AscensionCoins = 1, EnlightenedCoins = 10, YalaniTrinkets = 2,
LifebloomResins = 1, LifeSplitters = 10, Plants = 10, NecrolyticExtracts = 4,
};
Check.Eq(IltSigilChain.Fulfillable(stock), 4L, "1 finished + min(3 coins, 4 elixirs)");
IltSigilChain.EcoinDemand(50, 30, 2, 20, out long fromCoins, out long still, out long need);
Check.Eq(fromCoins, 1L, "20 coins left after Ascension crafts make 1 token");
Check.Eq(still, 1L, "one token still short");
Check.Eq(need, 20L, "one more token's worth of coins");
IltSigilChain.EcoinDemand(10, 25, 0, 20, out _, out _, out need);
Check.Eq(need, 15L, "Ascension crafts alone exceed the pool");
}
private static void Names()
{
Check.True(IltSigilChain.NameIs("Ascension Coins", IltSigilChain.AscensionCoin), "plural stack name");
Check.True(IltSigilChain.NameIs(" plant ", IltSigilChain.Plant), "case and spaces ignored");
Check.True(!IltSigilChain.NameIs("Plant Fiber", IltSigilChain.Plant), "Plant must be the whole name");
Check.True(!IltSigilChain.NameIs("Lifebloom Resin", IltSigilChain.LifebloodElixir), "Lifebloom is not Lifeblood");
}
}