feat: SK backlog from test through 2026.11.22.48 (Trade Shop, Oracle, quests, loot, nav)

Squash of test/main-merge-2026-10-25 onto aelrynth main 2026.11.19.1 for the standing sk PR. Includes Trade Shop, Oracle wiki/ILT tracker, quest runs, loot checklist, RynthNav, VTank import. HandWrittenVersion remains 0.5.0-legacy-ui. See Changelog/2026-11-22-sk-backlog-test-merge.md.
This commit is contained in:
BlankenshipG 2026-11-23 00:08:38 -05:00
commit dc08e1abba
521 changed files with 47247 additions and 795 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.InteropServices;
using RynthCore.PluginCore;
@ -7,10 +7,19 @@ namespace RynthCore.Plugin.RynthChat;
public sealed class RynthChatPlugin : RynthPluginBase
{
internal static readonly IntPtr NamePointer = Marshal.StringToHGlobalAnsi("RynthChat");
internal static readonly IntPtr VersionPointer = Marshal.StringToHGlobalAnsi("0.3.0");
// Previous release: 0.3.4.
internal static readonly IntPtr VersionPointer = Marshal.StringToHGlobalAnsi("0.3.5");
/// <summary>How long after login completes the server's system text still counts as the login burst.</summary>
internal const long LoginBurstMs = 30_000;
private readonly ChatBuffer _buffer = new();
// The login burst: on until a login completes, then for LoginBurstMs more (the welcome,
// MOTD, house / allegiance notices and the plugins' login probes). On again at logout.
private volatile bool _loggedIn;
private long _loginBurstUntilMs;
public override int Initialize()
{
Host.Log("[RynthChat] Plugin initialized.");
@ -19,20 +28,25 @@ public sealed class RynthChatPlugin : RynthPluginBase
public override void OnLoginComplete()
{
_loggedIn = true;
System.Threading.Interlocked.Exchange(ref _loginBurstUntilMs, Environment.TickCount64 + LoginBurstMs);
Host.Log("[RynthChat] Login complete.");
}
public override void OnLogout()
{
_loggedIn = false;
Host.Log("[RynthChat] Logout.");
}
/// <summary>Entering the world, or within LoginBurstMs of the login completing.</summary>
private bool InLoginBurst =>
!_loggedIn || Environment.TickCount64 < System.Threading.Interlocked.Read(ref _loginBurstUntilMs);
public override void OnChatWindowText(string? text, int chatType, ref int eat)
{
// A plugin earlier in the dispatch ate the line (RynthAi's Meta Manager eats the
// reply to its own /myquests poll): keep it out of the chat window.
if (eat != 0) return;
_buffer.Add(text, chatType);
// Always buffer for RynthChat, even when an earlier plugin ate the line for retail.
_buffer.Add(text, chatType, InLoginBurst);
}
public override void OnChatBarEnter(string? text, ref int eat)
@ -44,12 +58,18 @@ public sealed class RynthChatPlugin : RynthPluginBase
internal int SetScrollbackCapacity(int lines) => _buffer.SetCapacity(lines);
/// <summary>The engine reports that a plugin ate the line just dispatched (RynthChatNoteEaten).</summary>
internal bool NoteEaten(string? text) => _buffer.NoteEaten(text);
// Called on the game thread from the engine's deferred chat dispatch
// (Win32Backend posts WM_RYNTHCORE_CHAT so this runs on a fresh, non-reentrant
// message dispatch rather than inline inside the Enter keystroke handler).
internal void SendLine(string text)
{
if (!Host.HasInvokeChatParser || string.IsNullOrWhiteSpace(text)) return;
// Typed by the player: a quest list they ask for shows (plugins' own reads stay hidden).
if (ChatClassifier.IsQuestListCommand(text)) _buffer.NoteTypedQuestCommand();
else if (ChatClassifier.IsBankBalanceCommand(text)) _buffer.NoteTypedBankCommand();
Host.InvokeChatParser(text);
}
}