From 94f16ac16e3e44c822665641983966239e96eff6 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Fri, 15 Nov 2024 00:36:10 +0100 Subject: [PATCH] Alias ClientState.IsLoggedIn to AgentLobby.IsLoggedIn (#2082) --- Dalamud/Game/ClientState/ClientState.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Dalamud/Game/ClientState/ClientState.cs b/Dalamud/Game/ClientState/ClientState.cs index 6ceea4c6b..364466cce 100644 --- a/Dalamud/Game/ClientState/ClientState.cs +++ b/Dalamud/Game/ClientState/ClientState.cs @@ -1,5 +1,4 @@ using System.Linq; -using System.Runtime.InteropServices; using Dalamud.Data; using Dalamud.Game.ClientState.Conditions; @@ -71,7 +70,7 @@ internal sealed class ClientState : IInternalDisposableService, IClientState this.processPacketPlayerSetupHook.Enable(); this.onLogoutHook.Enable(); } - + private unsafe delegate void ProcessPacketPlayerSetupDelegate(nint a1, nint packet); /// @@ -121,7 +120,14 @@ internal sealed class ClientState : IInternalDisposableService, IClientState public unsafe ulong LocalContentId => PlayerState.Instance()->ContentId; /// - public bool IsLoggedIn { get; private set; } + public unsafe bool IsLoggedIn + { + get + { + var agentLobby = AgentLobby.Instance(); + return agentLobby != null && agentLobby->IsLoggedIn; + } + } /// public bool IsPvP { get; private set; } @@ -259,7 +265,6 @@ internal sealed class ClientState : IInternalDisposableService, IClientState try { Log.Debug("Login"); - this.IsLoggedIn = true; this.Login?.InvokeSafely(); gameGui?.ResetUiHideState(); this.lifecycle.ResetLogout(); @@ -283,8 +288,6 @@ internal sealed class ClientState : IInternalDisposableService, IClientState Log.Debug("Logout: Type {type}, Code {code}", type, code); - this.IsLoggedIn = false; - if (this.Logout is { } callback) { foreach (var action in callback.GetInvocationList().Cast())