Snapshot for release 2026.10.13.1 (internal d2b5fb3)

This commit is contained in:
Tom Bohar 2026-10-13 14:25:49 -04:00
commit 319740ff5d
291 changed files with 58505 additions and 2107 deletions

View file

@ -27,7 +27,7 @@ public static unsafe class PluginExports
public static IntPtr GetName() => LiteralPointer("RynthSort"u8);
[UnmanagedCallersOnly(EntryPoint = "RynthPluginVersion", CallConvs = new[] { typeof(CallConvCdecl) })]
public static IntPtr GetVersion() => LiteralPointer("0.3.0"u8);
public static IntPtr GetVersion() => LiteralPointer("0.3.1"u8);
private static IntPtr LiteralPointer(ReadOnlySpan<byte> literal)
{
@ -51,6 +51,21 @@ public static unsafe class PluginExports
[UnmanagedCallersOnly(EntryPoint = "RynthPluginOnVendorOpen", CallConvs = new[] { typeof(CallConvCdecl) })]
public static void OnVendorOpen(uint vendorId) => Runtime.OnVendorOpen(vendorId);
// The engine's RynthAi dashboard toggle: polls the auto-sort state (-1 not logged in,
// 0 off, 1 on; twice a second, any thread) and sends "on quiet" / "off quiet" (UTF-8,
// without "/rsort"; queued, runs on the tick).
[UnmanagedCallersOnly(EntryPoint = "RynthSortAutoState", CallConvs = new[] { typeof(CallConvCdecl) })]
public static int AutoState()
{
try { return Runtime.Plugin?.AutoState ?? -1; } catch { return -1; }
}
[UnmanagedCallersOnly(EntryPoint = "RynthSortCommand", CallConvs = new[] { typeof(CallConvCdecl) })]
public static void Command(IntPtr utf8)
{
try { if (utf8 != IntPtr.Zero) Runtime.Plugin?.EnqueueCommand(Marshal.PtrToStringUTF8(utf8)); } catch { }
}
[UnmanagedCallersOnly(EntryPoint = "RynthPluginOnVendorClose", CallConvs = new[] { typeof(CallConvCdecl) })]
public static void OnVendorClose(uint vendorId) => Runtime.OnVendorClose(vendorId);
}

View file

@ -30,7 +30,7 @@ namespace RynthCore.Plugin.RynthSort;
/// </summary>
public sealed class RynthSortPlugin : RynthPluginBase
{
public const string Version = "0.3.0";
public const string Version = "0.3.1";
private const long IdentityRetryMs = 1000;
private const long SaveDelayMs = 750;
private const long PassIntervalMs = 500;
@ -55,6 +55,16 @@ public sealed class RynthSortPlugin : RynthPluginBase
private bool _noUiLogged;
private bool _backupOnSave;
private readonly List<string> _warnings = new();
private volatile int _autoState = -1;
/// <summary>For the engine's dashboard toggle (RynthSortAutoState): -1 not logged in yet, 0 auto-sort off, 1 on. Any thread.</summary>
public int AutoState => _autoState;
/// <summary>An /rsort command from the engine (RynthSortCommand), without "/rsort". Any thread; runs on the tick.</summary>
public void EnqueueCommand(string? arg)
{
if (arg != null) _commands.Enqueue(arg.Trim());
}
public override int Initialize()
{
@ -144,7 +154,9 @@ public sealed class RynthSortPlugin : RynthPluginBase
case "on":
case "off":
_sort.SetAuto(word == "on");
Print("Auto-sort " + word);
// "quiet": the dashboard's toggle, which shows the state itself.
if (!(words.Length > 1 && words[1].Equals("quiet", StringComparison.OrdinalIgnoreCase)))
Print("Auto-sort " + word);
break;
case "now":
case "tidy":
@ -204,6 +216,7 @@ public sealed class RynthSortPlugin : RynthPluginBase
}
}
if (_saveDueMs != 0 && now >= _saveDueMs) SaveNow();
_autoState = _inWorld && _identityKnown ? (_sort.Data.Settings.Auto ? 1 : 0) : -1;
if (!Host.HasUi || _window == null || _panel == null) return;
Record(_window, now);