using System; using RynthCore.Plugin.RynthAi; using RynthCore.Plugin.RynthOracle.Data; using RynthCore.PluginSdk; namespace RynthCore.Plugin.RynthOracle; /// Everything the views read and the actions they can take. Pump thread only. internal sealed class OracleContext { public RynthCoreHost Host; public readonly OracleSettings Settings = new(); public readonly QuestFlagStore Flags = new(); public readonly QuestCatalog Catalog = new(); public readonly QuestCatalogUpdater Updater = new(); public readonly CharacterSnapshot Character = new(); public readonly VoidTracker Void = new(); public readonly FellowshipTracker Fellowship = new(); public readonly ServerIdentity Server = new(); /// ConquestAC-only data (tag Conquest); fed only while on ConquestAC. public readonly ConquestData Conquest = new(); /// Aelrynth's leaderboards (tag Aelrynth); fed only while on Aelrynth. public readonly AelrynthBoards Boards = new(); /// Titles the character holds (engine API v75); TitlesKnown false until the engine has the list. public readonly System.Collections.Generic.HashSet EarnedTitles = new(); public bool TitlesKnown; public uint CurrentTitle; public bool InWorld; public long NowMs; public DateTime UtcNow; /// The last thing the quest list check said, shown on the About tab. public string UpdaterMessage = ""; /// Set by the plugin: sends /myquests (reply hidden when the setting says so). public Action RequestQuests = () => { }; /// Set by the plugin: sends a chat command to the server as if typed (the views' buttons). public Func Send = _ => false; public Func Props => id => Character.Int(Host, id); /// A line in the player's chat window only (nothing is sent to the server). public void Print(string text) { if (!Host.WriteToChat("[RynthOracle] " + text, 1)) Host.Log("[RynthOracle] " + text); } }