mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-23 08:17:47 +01:00
Alias ClientState.IsLoggedIn to AgentLobby.IsLoggedIn (#2082)
This commit is contained in:
parent
b483b63bf2
commit
94f16ac16e
1 changed files with 9 additions and 6 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
using Dalamud.Game.ClientState.Conditions;
|
using Dalamud.Game.ClientState.Conditions;
|
||||||
|
|
@ -121,7 +120,14 @@ internal sealed class ClientState : IInternalDisposableService, IClientState
|
||||||
public unsafe ulong LocalContentId => PlayerState.Instance()->ContentId;
|
public unsafe ulong LocalContentId => PlayerState.Instance()->ContentId;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool IsLoggedIn { get; private set; }
|
public unsafe bool IsLoggedIn
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var agentLobby = AgentLobby.Instance();
|
||||||
|
return agentLobby != null && agentLobby->IsLoggedIn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public bool IsPvP { get; private set; }
|
public bool IsPvP { get; private set; }
|
||||||
|
|
@ -259,7 +265,6 @@ internal sealed class ClientState : IInternalDisposableService, IClientState
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.Debug("Login");
|
Log.Debug("Login");
|
||||||
this.IsLoggedIn = true;
|
|
||||||
this.Login?.InvokeSafely();
|
this.Login?.InvokeSafely();
|
||||||
gameGui?.ResetUiHideState();
|
gameGui?.ResetUiHideState();
|
||||||
this.lifecycle.ResetLogout();
|
this.lifecycle.ResetLogout();
|
||||||
|
|
@ -283,8 +288,6 @@ internal sealed class ClientState : IInternalDisposableService, IClientState
|
||||||
|
|
||||||
Log.Debug("Logout: Type {type}, Code {code}", type, code);
|
Log.Debug("Logout: Type {type}, Code {code}", type, code);
|
||||||
|
|
||||||
this.IsLoggedIn = false;
|
|
||||||
|
|
||||||
if (this.Logout is { } callback)
|
if (this.Logout is { } callback)
|
||||||
{
|
{
|
||||||
foreach (var action in callback.GetInvocationList().Cast<IClientState.LogoutDelegate>())
|
foreach (var action in callback.GetInvocationList().Cast<IClientState.LogoutDelegate>())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue