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:
parent
89166f23bd
commit
040b797be5
14 changed files with 151 additions and 0 deletions
|
|
@ -199,6 +199,25 @@ $rootCleanup = @(
|
||||||
)
|
)
|
||||||
|
|
||||||
if (-not $SkipLauncher) {
|
if (-not $SkipLauncher) {
|
||||||
|
# Same pre-flight for the launcher payload: a running RynthCore.exe holds its
|
||||||
|
# Avalonia DLLs, and the copy failing on one of them used to abort the deploy
|
||||||
|
# AFTER Runtime\ below had been wiped (2026-09-26) — no engine until a redeploy.
|
||||||
|
$launcherLocked = @()
|
||||||
|
foreach ($f in Get-ChildItem -LiteralPath $launcherPublish -File) {
|
||||||
|
$target = Join-Path $Destination $f.Name
|
||||||
|
if ($f.Name -eq "RynthCore.App.Avalonia.exe") { $target = Join-Path $Destination "RynthCore.exe" }
|
||||||
|
if (-not (Test-Path -LiteralPath $target)) { continue }
|
||||||
|
try {
|
||||||
|
$s = [System.IO.File]::Open($target, 'Open', 'ReadWrite', 'None')
|
||||||
|
$s.Close()
|
||||||
|
} catch {
|
||||||
|
$launcherLocked += $target
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($launcherLocked.Count -gt 0) {
|
||||||
|
throw ("Deploy aborted BEFORE touching anything - $($launcherLocked.Count) launcher file(s) are locked (close the RynthCore launcher, or pass -SkipLauncher):`n " + ($launcherLocked -join "`n "))
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($name in $rootCleanup) {
|
foreach ($name in $rootCleanup) {
|
||||||
$target = Join-Path $Destination $name
|
$target = Join-Path $Destination $name
|
||||||
if (Test-Path -LiteralPath $target) {
|
if (Test-Path -LiteralPath $target) {
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,15 @@ internal static class PluginManager
|
||||||
private static string _shadowRootDir = "";
|
private static string _shadowRootDir = "";
|
||||||
|
|
||||||
public static IReadOnlyList<LoadedPlugin> Plugins => _plugins;
|
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 bool IsRescanQueued => _rescanRequested;
|
||||||
public static string PluginDirectory => _pluginsDir;
|
public static string PluginDirectory => _pluginsDir;
|
||||||
public static IReadOnlyList<string> ExtraPluginPaths => EngineSettings.PluginPaths;
|
public static IReadOnlyList<string> ExtraPluginPaths => EngineSettings.PluginPaths;
|
||||||
|
|
@ -2191,6 +2200,9 @@ internal static class PluginManager
|
||||||
|
|
||||||
_plugins.Clear();
|
_plugins.Clear();
|
||||||
PublishPluginsRenderSnapshot();
|
PublishPluginsRenderSnapshot();
|
||||||
|
|
||||||
|
try { PluginsUnloaded?.Invoke(); }
|
||||||
|
catch (Exception ex) { RynthLog.Plugin($"PluginManager: PluginsUnloaded handler threw: {ex.Message}"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DispatchUIInitializedToLoadedPlugins()
|
private static void DispatchUIInitializedToLoadedPlugins()
|
||||||
|
|
|
||||||
|
|
@ -729,6 +729,16 @@ internal static class ItemsPanel
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Plugin binding ────────────────────────────────────────────────────────
|
// ── 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
var plugin = PluginManager.Plugins.FirstOrDefault(
|
var plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -1481,6 +1481,14 @@ internal static class MetaPanel
|
||||||
// Plugin bridge
|
// 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
var plugin = PluginManager.Plugins.FirstOrDefault(
|
var plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,22 @@ internal static class MonsterDamagePanel
|
||||||
private static SetJsonFn? _setMonsters; // RynthPluginSetMonstersJson (write-back, whole rules array)
|
private static SetJsonFn? _setMonsters; // RynthPluginSetMonstersJson (write-back, whole rules array)
|
||||||
private static VoidFn? _clearStats; // RynthPluginClearMonsterStats (master reset)
|
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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
if (_getJson != null) return;
|
if (_getJson != null) return;
|
||||||
|
|
|
||||||
|
|
@ -955,6 +955,14 @@ internal static class MonstersPanel
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Plugin export binding ───────────────────────────────────────────────
|
// ── 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
var plugin = PluginManager.Plugins.FirstOrDefault(
|
var plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -552,6 +552,14 @@ internal static class NavPanel
|
||||||
// Plugin bridge
|
// 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
var plugin = PluginManager.Plugins.FirstOrDefault(
|
var plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -1319,6 +1319,13 @@ internal static partial class RadarPanel
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Plugin export binding ───────────────────────────────────────────────
|
// ── 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
if (_getRadarSnapshot != null) return;
|
if (_getRadarSnapshot != null) return;
|
||||||
|
|
|
||||||
|
|
@ -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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -1194,6 +1194,15 @@ internal static class RynthChatPanel
|
||||||
|
|
||||||
internal static bool FloatingSelectionActive => _selDragging;
|
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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,18 @@ internal static class RynthNavPanel
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Plugin binding ──────────────────────────────────────────────────────────
|
// ── 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,14 @@ internal static class RynthTrackerPanel
|
||||||
return neg ? "-" + sb : sb.ToString();
|
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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -267,6 +267,15 @@ internal static class RynthVisionPanel
|
||||||
|
|
||||||
// ── Plugin binding ────────────────────────────────────────────────────────
|
// ── 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
LoadedPlugin? plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
|
|
@ -1296,6 +1296,14 @@ internal static class SettingsPanel
|
||||||
// Plugin bridge
|
// 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()
|
private static void TryBind()
|
||||||
{
|
{
|
||||||
var plugin = PluginManager.Plugins.FirstOrDefault(
|
var plugin = PluginManager.Plugins.FirstOrDefault(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue