From 859cd4500ef99c537b36e9e9bd3bb9e618ac6cd2 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 14 Jul 2024 16:11:27 +0200 Subject: [PATCH] Make plugin compatible with AllaganTools 1.7.0.11+ --- Influx/AllaganTools/AllaganToolsIpc.cs | 8 +++----- Influx/Influx.csproj | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Influx/AllaganTools/AllaganToolsIpc.cs b/Influx/AllaganTools/AllaganToolsIpc.cs index 3557ed1..1e83161 100644 --- a/Influx/AllaganTools/AllaganToolsIpc.cs +++ b/Influx/AllaganTools/AllaganToolsIpc.cs @@ -65,10 +65,8 @@ internal sealed class AllaganToolsIpc : IDisposable { if (_dalamudReflector.TryGetDalamudPlugin("Allagan Tools", out var it, false, true)) { - var pluginLoader = it.GetType() - .GetProperty("PluginLoader", BindingFlags.NonPublic | BindingFlags.Instance)! - .GetValue(it)!; - var host = pluginLoader.GetType().GetProperty("Host")!.GetValue(pluginLoader)!; + var hostedPlugin = it.GetType().BaseType!; + var host = hostedPlugin.GetField("host", BindingFlags.NonPublic | BindingFlags.Instance)!.GetValue(it)!; var serviceProvider = host.GetType().GetProperty("Services")!.GetValue(host)!; var getServiceMethod = serviceProvider.GetType().GetMethod("GetService")!; object GetService(Type t) => getServiceMethod.Invoke(serviceProvider, [t])!; @@ -128,7 +126,7 @@ internal sealed class AllaganToolsIpc : IDisposable public Dictionary CountCurrencies() { - _pluginLog.Debug($"{_characters.GetType()}, {_inventories.GetType()}"); + _pluginLog.Verbose($"Updating characters with {_characters.GetType()} and {_inventories.GetType()}"); var characters = _characters.All.ToDictionary(x => x.CharacterId, x => x); return _inventories.All .Where(x => characters.ContainsKey(x.Value.CharacterId)) diff --git a/Influx/Influx.csproj b/Influx/Influx.csproj index f4d56ef..0d4e776 100644 --- a/Influx/Influx.csproj +++ b/Influx/Influx.csproj @@ -1,6 +1,6 @@ - 1.0 + 1.1 dist