mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 15:17:23 +01:00
Merge branch 'main' of https://github.com/Penumbra-Sync/client
This commit is contained in:
commit
f94af2cc9e
1 changed files with 9 additions and 4 deletions
|
|
@ -37,6 +37,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||||
private readonly IGameGui _gameGui;
|
private readonly IGameGui _gameGui;
|
||||||
private readonly ILogger<DalamudUtilService> _logger;
|
private readonly ILogger<DalamudUtilService> _logger;
|
||||||
private readonly IObjectTable _objectTable;
|
private readonly IObjectTable _objectTable;
|
||||||
|
private readonly ISigScanner _sigScanner;
|
||||||
private readonly PerformanceCollectorService _performanceCollector;
|
private readonly PerformanceCollectorService _performanceCollector;
|
||||||
private uint? _classJobId = 0;
|
private uint? _classJobId = 0;
|
||||||
private DateTime _delayedFrameworkUpdateCheck = DateTime.UtcNow;
|
private DateTime _delayedFrameworkUpdateCheck = DateTime.UtcNow;
|
||||||
|
|
@ -47,7 +48,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||||
private readonly List<string> _notUpdatedCharas = [];
|
private readonly List<string> _notUpdatedCharas = [];
|
||||||
private bool _sentBetweenAreas = false;
|
private bool _sentBetweenAreas = false;
|
||||||
private readonly Dictionary<ulong, string> _aidCache = [];
|
private readonly Dictionary<ulong, string> _aidCache = [];
|
||||||
private readonly Lazy<uint> _aid;
|
private Lazy<uint> _aid;
|
||||||
private int _aidCounter = 0;
|
private int _aidCounter = 0;
|
||||||
|
|
||||||
public DalamudUtilService(ILogger<DalamudUtilService> logger, IClientState clientState, IObjectTable objectTable, IFramework framework,
|
public DalamudUtilService(ILogger<DalamudUtilService> logger, IClientState clientState, IObjectTable objectTable, IFramework framework,
|
||||||
|
|
@ -64,6 +65,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||||
_gameConfig = gameConfig;
|
_gameConfig = gameConfig;
|
||||||
_blockedCharacterHandler = blockedCharacterHandler;
|
_blockedCharacterHandler = blockedCharacterHandler;
|
||||||
Mediator = mediator;
|
Mediator = mediator;
|
||||||
|
_sigScanner = sigScanner;
|
||||||
_performanceCollector = performanceCollector;
|
_performanceCollector = performanceCollector;
|
||||||
WorldData = new(() =>
|
WorldData = new(() =>
|
||||||
{
|
{
|
||||||
|
|
@ -126,12 +128,15 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
IsWine = Util.IsWine();
|
IsWine = Util.IsWine();
|
||||||
|
_aid = RebuildAid();
|
||||||
|
}
|
||||||
|
|
||||||
_aid = new(() =>
|
private Lazy<uint> RebuildAid() {
|
||||||
|
return new(() =>
|
||||||
{
|
{
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
var address = sigScanner.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 4C 8B CA");
|
var address = _sigScanner.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 4C 8B CA");
|
||||||
return (uint)(address != nint.Zero ? (*(ulong**)address)[1] : 0u);
|
return (uint)(address != nint.Zero ? (*(ulong**)address)[1] : 0u);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -169,7 +174,6 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||||
public Lazy<Dictionary<uint, string>> TerritoryData { get; private set; }
|
public Lazy<Dictionary<uint, string>> TerritoryData { get; private set; }
|
||||||
public Lazy<Dictionary<uint, (Map Map, string MapName)>> MapData { get; private set; }
|
public Lazy<Dictionary<uint, (Map Map, string MapName)>> MapData { get; private set; }
|
||||||
public bool IsLodEnabled { get; private set; }
|
public bool IsLodEnabled { get; private set; }
|
||||||
|
|
||||||
public MareMediator Mediator { get; }
|
public MareMediator Mediator { get; }
|
||||||
|
|
||||||
public IGameObject? CreateGameObject(IntPtr reference)
|
public IGameObject? CreateGameObject(IntPtr reference)
|
||||||
|
|
@ -758,6 +762,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
||||||
_logger.LogDebug("Logged in");
|
_logger.LogDebug("Logged in");
|
||||||
IsLoggedIn = true;
|
IsLoggedIn = true;
|
||||||
_lastZone = _clientState.TerritoryType;
|
_lastZone = _clientState.TerritoryType;
|
||||||
|
_aid = RebuildAid();
|
||||||
Mediator.Publish(new DalamudLoginMessage());
|
Mediator.Publish(new DalamudLoginMessage());
|
||||||
}
|
}
|
||||||
else if (localPlayer == null && IsLoggedIn)
|
else if (localPlayer == null && IsLoggedIn)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue