diff --git a/installer/previous-release/last-built-version.txt b/installer/previous-release/last-built-version.txt index 1f305ec..f5a2c8c 100644 --- a/installer/previous-release/last-built-version.txt +++ b/installer/previous-release/last-built-version.txt @@ -1 +1 @@ -2026.10.4.18 \ No newline at end of file +2026.10.4.22 \ No newline at end of file diff --git a/installer/previous-release/last-release-manifest.json b/installer/previous-release/last-release-manifest.json index 834ce70..85295af 100644 --- a/installer/previous-release/last-release-manifest.json +++ b/installer/previous-release/last-release-manifest.json @@ -1,24 +1,24 @@ { "schema": 1, "product": "RynthCore + RynthSuite", - "version": "2026.10.4.18", - "release": 2026100418, - "builtUtc": "2026-10-05T01:15:49Z", - "previous": "2026.10.4.17", + "version": "2026.10.4.22", + "release": 2026100422, + "builtUtc": "2026-10-05T05:05:36Z", + "previous": "2026.10.4.21", "installer": { - "file": "RynthCore-Setup-2026.10.4.18.exe", - "size": 108546627, - "sha256": "70f6a3c0ebe1c279d60e48c739e4664f8ce625b9aa5d055283b2c207219acf26" + "file": "RynthCore-Setup-2026.10.4.22.exe", + "size": 108550595, + "sha256": "9e29c47918dfae7cbcf6def51386e55d9ecb9b7d410d9e2fea5d29ce86911379" }, "source": { "rynthCore": { "branch": "SK-local", - "commit": "75a1f63c6893a8c9577c697a224f44bd942ea768", + "commit": "ae775110769b1367288ff8979525bbb3a1a55535", "dirty": false }, "rynthSuite": { "branch": "SK-local", - "commit": "0c3800294ce07e5ebf25cd83d28ba7ea0039baf1", + "commit": "dc9b6a48849161866d90a252303b6ff9b2d610b2", "dirty": false } }, @@ -26,72 +26,71 @@ { "name": "Launcher (RynthCore.exe)", "file": "core\\RynthCore.exe", - "version": "2026.10.4.18+75a1f63c6893a8c9577c697a224f44bd942ea768" + "version": "2026.10.4.22+ae775110769b1367288ff8979525bbb3a1a55535" }, { "name": "Engine", "file": "core\\Runtime\\RynthCore.Engine.dll", - "version": "2026.10.4.18+75a1f63c6893a8c9577c697a224f44bd942ea768" + "version": "2026.10.4.22+ae775110769b1367288ff8979525bbb3a1a55535" }, { "name": "Loader", "file": "core\\Runtime\\RynthCore.Loader.dll", - "version": "2026.10.4.18+75a1f63c6893a8c9577c697a224f44bd942ea768" + "version": "2026.10.4.22+ae775110769b1367288ff8979525bbb3a1a55535" }, { "name": "Loot Editor", "file": "core\\Tools\\LootEditor\\RynthCore.LootEditor.exe", - "version": "2026.10.4.18+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "2026.10.4.22+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "RynthAi plugin", "file": "suite\\RynthAi\\RynthCore.Plugin.RynthAi.dll", - "version": "0.6.23-legacy-ui+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "0.6.32-legacy-ui+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "Monster Editor", "file": "suite\\RynthAi\\MonsterEditor\\RynthCore.MonsterEditor.exe", - "version": "2026.10.4.18+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "2026.10.4.22+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "RynthChat (experimental)", "file": "suite\\RynthChat\\RynthCore.Plugin.RynthChat.dll", - "version": "0.1.1-experimental+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "0.1.1-experimental+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "RynthJuice (experimental)", "file": "suite\\RynthJuice\\RynthCore.Plugin.RynthJuice.dll", - "version": "0.1.2-experimental+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "0.1.2-experimental+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "RynthNav (experimental)", "file": "suite\\RynthNav\\RynthCore.Plugin.RynthNav.dll", - "version": "0.5.5-experimental+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "0.5.5-experimental+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "RynthTracker (experimental)", "file": "suite\\RynthTracker\\RynthCore.Plugin.RynthTracker.dll", - "version": "0.1.1-experimental+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "0.1.1-experimental+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "RynthVision (experimental)", "file": "suite\\RynthVision\\RynthCore.Plugin.RynthVision.dll", - "version": "0.1.1-experimental+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "0.1.1-experimental+dc9b6a48849161866d90a252303b6ff9b2d610b2" }, { "name": "UbRythai (experimental)", "file": "suite\\UbRythai\\RynthCore.Plugin.UbRythai.dll", - "version": "3.1.10+0c3800294ce07e5ebf25cd83d28ba7ea0039baf1" + "version": "3.1.10+dc9b6a48849161866d90a252303b6ff9b2d610b2" } ], "changelog": [ - "RynthCore/Changelog/2026-10-04-floating-huds.md", - "RynthCore/Changelog/2026-10-04-ilt-hub-pet-roster.md", - "RynthCore/Changelog/2026-10-04-installer-2026.10.4.17-release.md" + "RynthCore/Changelog/2026-10-05-chat-translation.md", + "RynthCore/Changelog/2026-10-05-installer-2026.10.4.21-release.md" ], "changelogSince": { - "rynthCore": "b90e49486fae2a530dcf4f414c1c5d3057636e38", - "rynthSuite": "a6ab2f86a3dae774bda650a60b32e4e3a2b4f61b", + "rynthCore": "51307657d971ff81c61aa6532fb1ad941c54ca7f", + "rynthSuite": "a7754b972b26a78a2e28f3d0938c68e522cea0af", "date": "" } } \ No newline at end of file diff --git a/src/RynthCore.Engine/EntryPoint.cs b/src/RynthCore.Engine/EntryPoint.cs index 4b8f6e8..ba3cce7 100644 --- a/src/RynthCore.Engine/EntryPoint.cs +++ b/src/RynthCore.Engine/EntryPoint.cs @@ -40,6 +40,10 @@ public static class EntryPoint private static int _initCount; private static bool _imGuiResolverConfigured; private static IntPtr _imGuiNativeHandle; + + /// Module handle of the loaded cimgui DLL (zero until the ImGui resolver is configured). + internal static IntPtr ImGuiNativeHandle => _imGuiNativeHandle; + private static readonly object LogLock = new(); private static readonly Queue RecentLogLines = new(); diff --git a/src/RynthCore.Engine/ImGui/EngineFrameController.cs b/src/RynthCore.Engine/ImGui/EngineFrameController.cs index 35c030f..01c5638 100644 --- a/src/RynthCore.Engine/ImGui/EngineFrameController.cs +++ b/src/RynthCore.Engine/ImGui/EngineFrameController.cs @@ -601,6 +601,10 @@ internal static class EngineFrameController RynthLog.Info($"EngineFrameController: ImGui branch = {(branch == 1 ? "shell (RenderAll)" : branch == 2 ? "overlay windows (RenderOverlayAll)" : "none (shell and overlay windows both off)")}."); } + // A plugin that threw mid-window leaves scopes open; EndFrame would assert + // with a modal dialog on AC's main thread. + if (branch != 0) ImGuiStackRecovery.RecoverBeforeEndFrame(); + bool captureMouse = ImGuiNET.ImGui.IsWindowHovered(ImGuiHoveredFlags.AnyWindow) || ImGuiNET.ImGui.IsAnyItemActive(); diff --git a/src/RynthCore.Engine/ImGui/ImGuiController.cs b/src/RynthCore.Engine/ImGui/ImGuiController.cs index fc67460..8e62807 100644 --- a/src/RynthCore.Engine/ImGui/ImGuiController.cs +++ b/src/RynthCore.Engine/ImGui/ImGuiController.cs @@ -273,6 +273,10 @@ internal static class ImGuiController // Plugin render (ImGui draw calls) PluginManager.RenderAll(); + // A plugin that threw mid-window leaves scopes open; EndFrame would assert + // with a modal dialog on AC's main thread. + ImGuiStackRecovery.RecoverBeforeEndFrame(); + bool captureMouse = ImGuiNET.ImGui.IsWindowHovered(ImGuiHoveredFlags.AnyWindow) || ImGuiNET.ImGui.IsAnyItemActive(); diff --git a/src/RynthCore.Engine/ImGui/ImGuiStackRecovery.cs b/src/RynthCore.Engine/ImGui/ImGuiStackRecovery.cs new file mode 100644 index 0000000..41a6ff3 --- /dev/null +++ b/src/RynthCore.Engine/ImGui/ImGuiStackRecovery.cs @@ -0,0 +1,99 @@ +// ============================================================================ +// RynthCore.Engine - ImGuiStackRecovery.cs +// +// Closes ImGui scopes a plugin left open when it threw mid-frame (Begin without +// End, BeginTable without EndTable, unpopped IDs / style vars, ...). +// +// The shipped cimgui (Dear ImGui 1.89.7, static CRT, asserts on) reports a +// mismatched stack at EndFrame through IM_ASSERT, which shows a modal +// MessageBoxA on AC's main thread. The client then freezes until the hang +// watchdog kills it. ImGui's own recovery routine, +// ErrorCheckEndFrameRecover, unwinds everything down to the implicit fallback +// window; it is documented as safe to call right before EndFrame. +// +// 1.89.7 has no io.ConfigErrorRecovery* fields, so ImGui.NET's 1.91 IO layout +// must not be used to switch the assert off; the export is called directly. +// ============================================================================ + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace RynthCore.Engine.ImGuiBackend; + +internal static unsafe class ImGuiStackRecovery +{ + [DllImport("kernel32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)] + private static extern IntPtr GetProcAddress(IntPtr hModule, string procName); + + // void igErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data) + private static delegate* unmanaged[Cdecl] _recover; + private static bool _resolved; + private static bool _loggedUnavailable; + + private static int _recoveredThisFrame; + private static long _totalRecovered; + private static long _nextLogAtMs; + private static string _lastMessage = string.Empty; + + /// Scopes closed since the engine started. + internal static long TotalRecovered => _totalRecovered; + + /// + /// Unwinds any ImGui scope still open at the end of plugin rendering. Must be + /// called on the render thread, with the engine's context current, outside + /// every Begin the caller itself opened (i.e. right before EndFrame). + /// + internal static void RecoverBeforeEndFrame() + { + if (!_resolved) Resolve(); + if (_recover == null) return; + + _recoveredThisFrame = 0; + _recover((IntPtr)(delegate* unmanaged[Cdecl])&OnRecovered, IntPtr.Zero); + if (_recoveredThisFrame == 0) return; + + _totalRecovered += _recoveredThisFrame; + long now = Environment.TickCount64; + if (now < _nextLogAtMs) return; + _nextLogAtMs = now + 10_000; + RynthLog.Warn($"ImGuiStackRecovery: closed {_recoveredThisFrame} ImGui scope(s) a plugin left open " + + $"(total {_totalRecovered}); last: {_lastMessage}"); + } + + private static void Resolve() + { + _resolved = true; + IntPtr module = EntryPoint.ImGuiNativeHandle; + IntPtr fn = module != IntPtr.Zero ? GetProcAddress(module, "igErrorCheckEndFrameRecover") : IntPtr.Zero; + _recover = (delegate* unmanaged[Cdecl])fn; + if (fn == IntPtr.Zero && !_loggedUnavailable) + { + _loggedUnavailable = true; + RynthLog.Warn("ImGuiStackRecovery: igErrorCheckEndFrameRecover not exported by cimgui; plugin frame errors can still assert."); + } + else if (fn != IntPtr.Zero) + { + RynthLog.Info($"ImGuiStackRecovery: armed (igErrorCheckEndFrameRecover @ 0x{fn:X8})."); + } + } + + // ImGuiErrorLogCallback is variadic cdecl (caller cleans the stack). Every recovery + // message in 1.89.7 carries exactly one %s (the window name), so the first variadic + // argument is read as a third fixed parameter. + [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })] + private static void OnRecovered(IntPtr userData, byte* fmt, byte* arg) + { + try + { + _recoveredThisFrame++; + string format = fmt != null ? Marshal.PtrToStringAnsi((IntPtr)fmt) ?? string.Empty : string.Empty; + string name = arg != null ? Marshal.PtrToStringAnsi((IntPtr)arg) ?? string.Empty : string.Empty; + _lastMessage = format.Replace("%s", name); + } + catch + { + // Never let a managed exception unwind into native ImGui. + } + } +}