Fix logout crash, add OnLogout plugin export, and read true buffed skill

The long-standing "DX9 error / client crash on logout" was ChatHooks.TickHide
calling SetVisible() on a stale gmMainChatUI pointer that AC frees during the
world-to-charselect transition. TickHide now gates on HasObservedLoginComplete
and the cached instance is reset in DispatchPendingLogout. CrashLogger gained a
register dump + EBP-frame walk + ESP sweep with module resolution that made
this trace possible.

Plugin contract bumped to v57 with optional RynthPluginOnLogout export.
LogoutLifecycleHooks hooks CPlayerSystem::ExecuteLogOff (fires after the user
confirms the logoff prompt — not RecvNotice_EndCharacterSession which fires on
the menu click before the prompt) plus RecvNotice_Logoff as fallback.
RynthCoreShell + PluginManager.RenderAll gate on HasObservedLoginComplete so
the bar/plugins hide between sessions.

ClientObjectHooks.TryGetObjectSkill now calls CACQualities::InqSkill(raw=0)
for the truly buffed skill — the old code returned InitialLevel +
LevelFromPracticePoints which is just the base trained level, missing
attribute / augmentation / spell-buff contributions.

CharacterCaptureHooks latches _autoLoginEverFired so manual logout doesn't
re-fire auto-login from the next 0xF658 packet. AccountProfileDialog drops
the now-redundant Character/Slot field. UpdateObjectInventoryHooks pack scan
also matches by wielderID so wielded items are picked up.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
tombohar 2026-04-25 23:36:56 -04:00
commit 8260c60494
17 changed files with 539 additions and 125 deletions

View file

@ -171,6 +171,10 @@ internal static class PluginLoader
if (onLoginCompletePtr != IntPtr.Zero)
plugin.OnLoginComplete = Marshal.GetDelegateForFunctionPointer<PluginOnLoginCompleteDelegate>(onLoginCompletePtr);
IntPtr onLogoutPtr = GetProcAddress(handle, "RynthPluginOnLogout");
if (onLogoutPtr != IntPtr.Zero)
plugin.OnLogout = Marshal.GetDelegateForFunctionPointer<PluginOnLogoutDelegate>(onLogoutPtr);
IntPtr onUiInitializedPtr = GetProcAddress(handle, "RynthPluginOnUIInitialized");
if (onUiInitializedPtr != IntPtr.Zero)
plugin.OnUIInitialized = Marshal.GetDelegateForFunctionPointer<PluginOnUIInitializedDelegate>(onUiInitializedPtr);
@ -358,6 +362,7 @@ internal static class PluginLoader
{
var parts = new List<string>(4) { "init", "shutdown" };
if (p.OnLoginComplete != null) parts.Add("login");
if (p.OnLogout != null) parts.Add("logout");
if (p.OnUIInitialized != null) parts.Add("ui");
if (p.OnBusyCountIncremented != null) parts.Add("busy+");
if (p.OnBusyCountDecremented != null) parts.Add("busy-");