RynthCore as of 2026-09-26 (internal 5326694): panels re-bind plugin exports after RL; deploy checks launcher locks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tom Bohar 2026-09-26 14:20:07 -04:00
commit 040b797be5
14 changed files with 151 additions and 0 deletions

View file

@ -254,6 +254,15 @@ internal static class PluginManager
private static string _shadowRootDir = "";
public static IReadOnlyList<LoadedPlugin> Plugins => _plugins;
/// <summary>
/// Raised after every plugin has been shut down and removed (RL / rescan, engine
/// shutdown). Unload never FreeLibrary's a NativeAOT plugin, so an export bound
/// before a reload stays callable — into the shut-down copy. Panels that cache
/// plugin exports drop them here; their next poll re-binds to the fresh copy.
/// Raised on the pump thread.
/// </summary>
public static event Action? PluginsUnloaded;
public static bool IsRescanQueued => _rescanRequested;
public static string PluginDirectory => _pluginsDir;
public static IReadOnlyList<string> ExtraPluginPaths => EngineSettings.PluginPaths;
@ -2191,6 +2200,9 @@ internal static class PluginManager
_plugins.Clear();
PublishPluginsRenderSnapshot();
try { PluginsUnloaded?.Invoke(); }
catch (Exception ex) { RynthLog.Plugin($"PluginManager: PluginsUnloaded handler threw: {ex.Message}"); }
}
private static void DispatchUIInitializedToLoadedPlugins()

View file

@ -729,6 +729,16 @@ internal static class ItemsPanel
}
// ── Plugin binding ────────────────────────────────────────────────────────
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static ItemsPanel() => PluginManager.PluginsUnloaded += () =>
{
_getItemsJson = null;
_setItemsJson = null;
_addSelectedWeapon = null;
_addSelectedConsumable = null;
};
private static void TryBind()
{
var plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -1481,6 +1481,14 @@ internal static class MetaPanel
// Plugin bridge
// =========================================================================
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static MetaPanel() => PluginManager.PluginsUnloaded += () =>
{
_getMetaJson = null;
_sendMetaCommand = null;
};
private static void TryBind()
{
var plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -58,6 +58,22 @@ internal static class MonsterDamagePanel
private static SetJsonFn? _setMonsters; // RynthPluginSetMonstersJson (write-back, whole rules array)
private static VoidFn? _clearStats; // RynthPluginClearMonsterStats (master reset)
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static MonsterDamagePanel() => PluginManager.PluginsUnloaded += () =>
{
_getJson = null;
_setHp = null;
_delRow = null;
_getWeapons = null;
_setWeapon = null;
_setOffhand = null;
_getMonsters = null;
_setMonsters = null;
_clearStats = null;
_setDefaultWeapon = null;
};
private static void TryBind()
{
if (_getJson != null) return;

View file

@ -955,6 +955,14 @@ internal static class MonstersPanel
}
// ── Plugin export binding ───────────────────────────────────────────────
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static MonstersPanel() => PluginManager.PluginsUnloaded += () =>
{
_getMonstersJson = null;
_setMonstersJson = null;
};
private static void TryBind()
{
var plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -552,6 +552,14 @@ internal static class NavPanel
// Plugin bridge
// =========================================================================
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static NavPanel() => PluginManager.PluginsUnloaded += () =>
{
_getNavJson = null;
_sendNavCommand = null;
};
private static void TryBind()
{
var plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -1319,6 +1319,13 @@ internal static partial class RadarPanel
}
// ── Plugin export binding ───────────────────────────────────────────────
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static RadarPanel() => PluginManager.PluginsUnloaded += () =>
{
_getRadarSnapshot = null;
};
private static void TryBind()
{
if (_getRadarSnapshot != null) return;

View file

@ -1420,6 +1420,23 @@ internal static partial class RynthAiPanel
}
}
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static RynthAiPanel() => PluginManager.PluginsUnloaded += () =>
{
_getSnapshotJson = null;
_toggleMacro = null;
_setSubsystemEnabled = null;
_selectProfile = null;
_forceRebuff = null;
_cancelForceRebuff = null;
_adjustOpacity = null;
_togglePanelLock = null;
_togglePanelMinimize = null;
_sendNavCommand = null;
_getPatrolInfoJson = null;
};
private static void TryBind()
{
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -1194,6 +1194,15 @@ internal static class RynthChatPanel
internal static bool FloatingSelectionActive => _selDragging;
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static RynthChatPanel() => PluginManager.PluginsUnloaded += () =>
{
_getScrollbackJson = null;
_sendLine = null;
_lastSeq = 0; // the fresh copy's scrollback numbers from 1 again
};
private static void TryBind()
{
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -200,6 +200,18 @@ internal static class RynthNavPanel
}
// ── Plugin binding ──────────────────────────────────────────────────────────
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static RynthNavPanel() => PluginManager.PluginsUnloaded += () =>
{
_getStatus = null;
_loadTile = null;
_testQuery = null;
_preview = null;
_move = null;
_goto = null;
};
private static void TryBind()
{
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -240,6 +240,14 @@ internal static class RynthTrackerPanel
return neg ? "-" + sb : sb.ToString();
}
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static RynthTrackerPanel() => PluginManager.PluginsUnloaded += () =>
{
_getSnapshotJson = null;
_reset = null;
};
private static void TryBind()
{
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -267,6 +267,15 @@ internal static class RynthVisionPanel
// ── Plugin binding ────────────────────────────────────────────────────────
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static RynthVisionPanel() => PluginManager.PluginsUnloaded += () =>
{
_getSettings = null;
_setSettings = null;
_inspect = null;
};
private static void TryBind()
{
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(

View file

@ -1296,6 +1296,14 @@ internal static class SettingsPanel
// Plugin bridge
// =========================================================================
// RL loads fresh plugin copies without unloading the old ones: drop the
// exports bound below so the next poll re-binds to the live copy.
static SettingsPanel() => PluginManager.PluginsUnloaded += () =>
{
_getSettingsJson = null;
_setSettingsJson = null;
};
private static void TryBind()
{
var plugin = PluginManager.Plugins.FirstOrDefault(