Attribute raiser (IltHub/IltAttributeRaiser, drawn by the engine's Skills panel > Progression): for servers where attributes and vitals go past the retail cap. Like UB's Leaftide XP Calculator it asks the server: "/xp all" for each stat's next-level cost, "/attr <abbr> 1" to raise, waiting for the "[ATTR] ... raised" reply and re-reading the costs before the next raise. Raise now / auto-raise (every N minutes) spend only on the ticked stats, never below the reserve, in the set order and mode (priority, round robin, cheapest first), up to 200 raises a run. +1 / +10 send "/attr <abbr> N" directly. Safety: a run decides only from the costs it just read, ignores a reply about another stat, stops if the world leaves Server Features or /xp goes off, never runs alongside the spend-before-/enl loop (either way round), and ends itself after 45 s with no reply. Chat: /ra hub attr run|stop|costs|status|auto on|off|every|raise. Saved per character in ilt-hub.json. Server Features (Settings > Misc, both the engine panel and the legacy ImGui window): a list of world-name patterns (* wildcard, case-insensitive; default "InfiniteLeaftide, *Leaftide*") plus a manual override now decide whether the ILT Hub, Mini Remote, Progression planners and the raiser run, replacing the hard-coded name check in IltServerOptions.IsIltLikeWorld. The per-character "Treat this world as ILT" override still counts. Features still follow the server's own report. Saved in the RynthAi profile and carried by the settings bridge (FeatureServerNames, ForceServerFeatures, ServerFeaturesStatus). Tests: RynthAiHostTests AttributeRaiserTests (patterns, list/override, pick modes, limits, order repair, server line parsing, a full run on the fake host, gating, and the safety cases). Host suite: 369 tests, only the 2 failures the untouched base also has when run off Windows (Windows paths). Pairs with the engine half in rynth/RynthCore PR #2 (Progression tab section, Settings text row). Co-authored-by: Cursor <cursoragent@cursor.com>
70 lines
3 KiB
C#
70 lines
3 KiB
C#
using System;
|
|
using System.IO;
|
|
using RynthCore.Plugin.RynthAi;
|
|
using RynthCore.Plugin.RynthAi.Meta;
|
|
using RynthCore.RynthAiHostTests.Tests;
|
|
using RynthCore.RynthAiTests.Harness;
|
|
|
|
namespace RynthCore.RynthAiHostTests;
|
|
|
|
// Offline tests for RynthAi's host-bound logic: loot rule matching and metas. Each test prints
|
|
// PASS / FAIL, or KNOWN for a registered real bug (which does not fail the run).
|
|
//
|
|
// Run: dotnet run -c Release (all tests)
|
|
// dotnet run -c Release -- vtank (tests whose name contains "vtank")
|
|
internal static class Program
|
|
{
|
|
/// <summary>Scratch folder next to the exe for files tests write. Emptied at start.</summary>
|
|
public static string TempRoot { get; } = Path.Combine(AppContext.BaseDirectory, "scratch");
|
|
|
|
private static int Main(string[] args)
|
|
{
|
|
if (Directory.Exists(TempRoot)) Directory.Delete(TempRoot, recursive: true);
|
|
Directory.CreateDirectory(TempRoot);
|
|
|
|
// SAFETY: the expression engine reads and writes pvars/gvars (and reads ItemGiver
|
|
// profiles) under C:\Games\RynthSuite\RynthAi. Point them at the scratch folder before
|
|
// any engine exists. The "expr: safety" test checks this held.
|
|
ExpressionEngine.PvarsDir = Path.Combine(TempRoot, "pvars");
|
|
ExpressionEngine.GvarsPath = Path.Combine(TempRoot, "gvars.txt");
|
|
ExpressionEngine.ItemGiverDir = Path.Combine(TempRoot, "ItemGiver");
|
|
// The dungeon map bake writes floor plans under C:\Games\RynthSuite\RynthAi\Maps.
|
|
RynthCore.Plugin.RynthAi.Maps.DungeonMapBake.CacheDir = Path.Combine(TempRoot, "Maps");
|
|
|
|
// Spell names (item spells, spell expiry by name) come from the plugin's embedded table.
|
|
SpellDatabase.Load();
|
|
|
|
var runner = new Runner();
|
|
NativeLootTests.Register(runner);
|
|
VTankLootTests.Register(runner);
|
|
ExpressionTests.Register(runner);
|
|
MetaTests.Register(runner);
|
|
MetaSchedulerTests.Register(runner);
|
|
NavEngineTests.Register(runner);
|
|
PatrolDoorwayTests.Register(runner);
|
|
BuffTests.Register(runner);
|
|
CombatMathTests.Register(runner);
|
|
WeaponTests.Register(runner);
|
|
RadarSnapshotTests.Register(runner);
|
|
AmmoTests.Register(runner);
|
|
VTankYieldTests.Register(runner);
|
|
OffhandTests.Register(runner);
|
|
FloodPerfTests.Register(runner);
|
|
LootSalvageTests.Register(runner);
|
|
LootCorpseTests.Register(runner);
|
|
OwnCorpseTests.Register(runner);
|
|
VitalsTests.Register(runner);
|
|
CastSafetyTests.Register(runner);
|
|
HealLatencyTests.Register(runner);
|
|
BlastTests.Register(runner);
|
|
ArcWhenClearTests.Register(runner);
|
|
UseAtLoginTests.Register(runner);
|
|
LearnSpellsTests.Register(runner);
|
|
AttackLatencyTests.Register(runner);
|
|
LootAddItemTests.Register(runner);
|
|
GiveTests.Register(runner);
|
|
DungeonMapBakeTests.Register(runner);
|
|
AttributeRaiserTests.Register(runner);
|
|
return runner.Run("RynthAi host tests", args.Length > 0 ? args[0] : null);
|
|
}
|
|
}
|