// IltHubState.cs — Persisted per-character state for the ILT Hub (Infinite Leaftide tools). // Originally SilentKelpie's ILT Hub state in RynthAi; moved to RynthILT 2026-10-13. // // Lives in %APPDATA%\RynthCore\RynthILT\\\hub.json (IltHubStore). The first // login with RynthILT copies RynthAi's \ilt-hub.json there (IltMigration), so the // shape stays compatible with that file: the parts that stayed with RynthAi's universal Mini // Remote tabs (the Pets tab's settings, the quest tracker's filter and favorites, the VTank // import path) are simply not read here any more. Serialized with the NativeAOT source-generated // IltHubJsonContext (IncludeFields = true), so plain public fields are used throughout. using System; using System.Collections.Generic; namespace RynthCore.Plugin.RynthILT.Hub; /// Root of everything the Hub remembers between sessions. public sealed class IltHubState { /// Bumped when the shape changes in a way that needs a migration. public int SchemaVersion = 1; // ── Window / shell ────────────────────────────────────────────────────── /// /// Hub UI on screen: the Mini Remote or any ILT section window (IltHubController.Tick keeps it /// current). Bank auto-refresh and the gear / split-arrow scans run only while it is true. /// public bool WindowVisible; /// Unused since the tabbed Hub window was retired; kept so old files still load. public int SelectedTab; public bool GamesHudVisible = true; /// /// "This world is an ACECustom/ILT shard even though its name isn't InfiniteLeaftide." /// World-identity override ONLY: it makes the Hub ask the server for its options, it /// never turns a feature on by itself. /// public bool ForceLeaftideFeatures; /// True once the one-time UtilityBelt sidecar import has run for this character. public bool UbSidecarsImported; /// Last-seen server feature bits. Cache only — overwritten by every login refresh. public IltServerOptionsSnapshot ServerOptions = new(); public IltBankState Bank = new(); public IltPetState Pet = new(); public IltCharacterState Character = new(); public IltGearState Gear = new(); public IltGamesState Games = new(); public IltGuardianState Guardian = new(); } /// Cached result of the server-options check (see IltServerOptions). public sealed class IltServerOptionsSnapshot { public string WorldName = string.Empty; /// "ilt-features" (structured dump), "probe" (command probing) or "" (never refreshed). public string Source = string.Empty; public DateTime LastRefreshUtc = DateTime.MinValue; /// Feature key → -1 unknown, 0 off, 1 on. public Dictionary Bits = new(StringComparer.OrdinalIgnoreCase); } // ── Banking ───────────────────────────────────────────────────────────────── public sealed class IltBankState { public long Pyreals; public long Luminance; public long LegendaryKeys; public long MythicalKeys; public long EnlightenedCoins; public long WeaklyEnlightenedCoins; /// Bound to the character: deposit and withdraw only, never transferred. public long PrestigeCoins; public DateTime LastUpdated = DateTime.MinValue; /// Last transfer recipient typed into the transfer form. public string TransferTarget = string.Empty; public int TransferCurrencyIndex; /// Deposit / withdraw form choices (IltBankCommands.Deposits / Withdrawals / NoteDenominations). public int DepositIndex; public int WithdrawIndex; public int WithdrawNoteIndex = 9; /// Re-issue /bank every N seconds while the Hub is open (0 = manual only). public int AutoRefreshSeconds = 120; } /// One "Transferred …" / "Received …" bank line seen in chat. public sealed class IltBankTransaction { public DateTime Timestamp; /// "Sent" or "Received". public string Type = string.Empty; public string Currency = string.Empty; public long Amount; public string OtherPlayer = string.Empty; public string Description = string.Empty; } // ── Pet ───────────────────────────────────────────────────────────────────── public sealed class IltPetState { /// Last captured /pets and /shinies rosters (display only; the Pets tab's logs). public List PetLog = new(); public List ShinyLog = new(); // The Pets tab's own settings (roster, healing / cosmetic pets, refill path) are RynthAi's // (its miniremote.json); older ilt-hub.json files still carry them, and they are ignored here. } // ── Character ─────────────────────────────────────────────────────────────── public sealed class IltCharacterState { /// Item → coin conversion table used by the session-rates strip. public List ItemConversions = new() { new IltItemConversion { ItemName = "Strawberry Jam Jar", ItemsPerConversion = 100, CoinsPerConversion = 10 }, new IltItemConversion { ItemName = "Ancient Pyreal", ItemsPerConversion = 100, CoinsPerConversion = 37 }, }; /// Augmentation planner targets, keyed by aug type (lowercase). public Dictionary AugTargets = new(StringComparer.OrdinalIgnoreCase); /// Luminance price of one Enlightened Coin (planner math only; 0 = don't price coins). public long LumPerEnlightenedCoin; /// Enlightenment planner target level (0 = current + 5). public int EnlTargetLevel; public int EnlightenedCoinsPerToken = 20; /// /// Auto-enlighten preference. Even when true it stays DISARMED each session until the /// player confirms in the Hub, and the server's own Yes/No dialog is never auto-clicked. /// public bool AutoEnlightenEnabled; public int AutoEnlightenCheckSeconds = 30; /// Spend unassigned XP with /attr before sending /enl (enlightening wipes unspent XP). public bool AutoEnlightenSpendXpFirst; // ── Attribute raiser (IltAttributeRaiser; Skills panel > Progression) ── /// Spend unassigned XP on the ticked attributes/vitals every AttrAutoRaiseMinutes. public bool AttrAutoRaise; public int AttrAutoRaiseMinutes = 5; /// IltAttributeRaiser.Mode: 0 priority (top of the order first), 1 round robin, 2 cheapest first. public int AttrRaiseMode; /// Unassigned XP the raiser never spends. public long AttrKeepXp; /// /attr abbreviations in raise-priority order (all nine; repaired on load). public List AttrOrder = new(IltAttributeRaiser.DefaultOrder); /// /attr abbreviations the raiser may spend on ("Raise now" and auto-raise). public List AttrRaiseStats = new(); /// Quest bonus (/qb) list filter. (The /myquests tracker's filter and favorites are RynthAi's.) public string QbFilter = string.Empty; // The ILT sections are Mini Remote tabs now (HudState.MiniRemoteTab); the old per-section // "window open" flags in older files are ignored on load. /// /// Registry charms this character has carried, keyed by charm name. Lets the Charms Tracking /// tab report "acquired" for charms that are now in storage (the client only sees carried items). /// public Dictionary CharmsSeen = new(StringComparer.OrdinalIgnoreCase); } /// Last time a charm was seen in the character's possession, with its best tier. public sealed class IltCharmSeen { public int Tier; public int MaxTier; public DateTime LastSeenUtc; } public sealed class IltItemConversion { public string ItemName = string.Empty; public int ItemsPerConversion = 100; public int CoinsPerConversion; } // ── Gear ──────────────────────────────────────────────────────────────────── public sealed class IltGearState { // Dispel (Rune of Dispel on harmful debuffs) public bool AutoDispel; public int DispelCooldownSeconds = 10; /// Spell-name substrings that are ALWAYS dispelled. public List DispelInclusions = new(); /// Spell-name substrings that are NEVER dispelled. public List DispelExclusions = new(); // Surging Strength (Empowered Volcanic Ember keeper) public bool SurgingStrength; public int SurgingCooldownSeconds = 15; // Aetheria / corrupted-weapon chunking public bool AutoChunkAetheria; public bool AutoChunkCorrupted; public bool ChunkInCombat; public int ChunkIntervalMs = 2000; /// Only chunk aetheria whose max level is below this (Coalesced always chunks). public int ChunkAetheriaUnderLevel = 4; // Auto-clap (/clap all) public bool AutoClap; public int ClapIntervalMinutes = 30; // Guardian Hand charm (WCID unpublished — name match until set) public uint GuardianHandWcid; public string GuardianHandName = "Guardian Hand"; // Split arrows (White Quartz imbue on missile weapons) public int SplitArrowTarget = 3; public bool SplitIgnoreImbued = true; // Equipment profiles (.utl suits). (The VTank .usd import path is RynthAi's: the importer stayed there.) public string LastEquipProfile = string.Empty; } // ── Games ─────────────────────────────────────────────────────────────────── public sealed class IltGamesState { public long BlackjackBet = 1_000_000; public long FellowshipBlackjackBet = 1_000_000; public int PowerballQuantity = 1; } // ── Guardian (Temple of Enlightenment) ────────────────────────────────────── public sealed class IltGuardianState { /// Translate incoming guardian tells and show the answer (Guardian window + Mini Remote). public bool AutoDetectFromChat = true; /// After a chat answer, give the item to the guardian automatically. public bool AutoHandIn; /// Temple guardian only: buy one of the item from the nearest vendor when none is carried. public bool BuyMissingFromVendor = true; /// Assumed attribute turn-in cooldown when only /qb wait stamps are known (hours). public int CooldownHoursAssumed = 20; /// Turn-ins counted from /qb wait-stamp transitions, keyed by attribute (fallback when /myquests lacks the flag). public Dictionary TurnInCounts = new(StringComparer.OrdinalIgnoreCase); /// Estimated end of each attribute's cooldown (UTC), keyed by attribute (same fallback). public Dictionary CooldownUntilUtc = new(StringComparer.OrdinalIgnoreCase); }