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:
parent
cd3ccfd550
commit
8260c60494
17 changed files with 539 additions and 125 deletions
|
|
@ -61,6 +61,14 @@ internal static class CharacterCaptureHooks
|
|||
|
||||
private static int _autoLoginScheduled;
|
||||
|
||||
// Latches once auto-login has fired in this process. The character-list packet
|
||||
// (0xF658) arrives every time the client sees char-select — including the
|
||||
// logout-to-char-select transition — and without this latch we'd re-trigger
|
||||
// auto-login the moment the user manually logs out. One-shot per process: if
|
||||
// the user wants to swap characters, they can pick from char-select manually,
|
||||
// or relaunch.
|
||||
private static int _autoLoginEverFired;
|
||||
|
||||
public static void ProcessPotentialCharacterMessage(IntPtr blob, bool isGameEvent = false)
|
||||
{
|
||||
if (blob == IntPtr.Zero)
|
||||
|
|
@ -269,6 +277,15 @@ internal static class CharacterCaptureHooks
|
|||
if (string.IsNullOrWhiteSpace(targetCharacter))
|
||||
return;
|
||||
|
||||
// One-shot per process: if auto-login already fired (and the user has
|
||||
// since logged back out), don't re-trigger. This keeps a manual logout
|
||||
// from instantly re-logging the same character.
|
||||
if (Interlocked.CompareExchange(ref _autoLoginEverFired, 1, 0) != 0)
|
||||
{
|
||||
RynthLog.Verbose($"CharacterCapture: Auto-login already fired this session — skipping for '{targetCharacter}'.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Interlocked.Exchange(ref _autoLoginScheduled, 1) != 0)
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue