Compare commits

...

5 Commits
v3.2 ... master

Author SHA1 Message Date
Liza 0d889172bb
Fix load error 2024-07-16 11:17:58 +02:00
Liza 25d25ccf6b
Add /accountid command, use accountid/contentid properties from clientstructs 2024-07-16 10:40:45 +02:00
Liza 59c26c4f30
Performance optimization 2024-07-04 20:51:24 +02:00
Liza 65c0bec80e
API 10 2024-07-03 01:03:00 +02:00
Liza 6bdaca7650
Remove legacy litedb 2024-06-17 00:51:53 +02:00
25 changed files with 526 additions and 522 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "LLib"]
path = LLib
url = https://git.carvel.li/liza/LLib

1
LLib Submodule

@ -0,0 +1 @@
Subproject commit 7027d291efbbff6a55944dd521d3907210ddecbe

View File

@ -2,6 +2,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RetainerTrack", "RetainerTrack\RetainerTrack.csproj", "{5FA75994-45B8-4E1A-A9D6-F28CD4C52342}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LLib", "LLib\LLib.csproj", "{3095F0BF-355A-4D13-BDDE-CCB4CA48D3C3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -12,5 +14,9 @@ Global
{5FA75994-45B8-4E1A-A9D6-F28CD4C52342}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FA75994-45B8-4E1A-A9D6-F28CD4C52342}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FA75994-45B8-4E1A-A9D6-F28CD4C52342}.Release|Any CPU.Build.0 = Release|Any CPU
{3095F0BF-355A-4D13-BDDE-CCB4CA48D3C3}.Debug|Any CPU.ActiveCfg = Debug|x64
{3095F0BF-355A-4D13-BDDE-CCB4CA48D3C3}.Debug|Any CPU.Build.0 = Debug|x64
{3095F0BF-355A-4D13-BDDE-CCB4CA48D3C3}.Release|Any CPU.ActiveCfg = Debug|x64
{3095F0BF-355A-4D13-BDDE-CCB4CA48D3C3}.Release|Any CPU.Build.0 = Debug|x64
EndGlobalSection
EndGlobal

View File

@ -990,7 +990,7 @@ csharp_space_around_binary_operators = before_and_after
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_namespace_declarations = file_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion

View File

@ -0,0 +1,62 @@
using System;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Game.Command;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game.Character;
using RetainerTrack.Handlers;
namespace RetainerTrack.Commands
{
internal sealed class AccountIdCommand : IDisposable
{
private readonly ICommandManager _commandManager;
private readonly IClientState _clientState;
private readonly ITargetManager _targetManager;
private readonly IChatGui _chatGui;
private readonly PersistenceContext _persistenceContext;
public AccountIdCommand(ICommandManager commandManager, IClientState clientState, ITargetManager targetManager,
IChatGui chatGui, PersistenceContext persistenceContext)
{
_commandManager = commandManager;
_clientState = clientState;
_targetManager = targetManager;
_chatGui = chatGui;
_persistenceContext = persistenceContext;
_commandManager.AddHandler("/accountid", new CommandInfo(ProcessCommand)
{
HelpMessage = "Shows the accountid of your target (or if no target, yourself)"
});
}
private void ProcessCommand(string command, string arguments)
{
IGameObject? character = _targetManager.Target ?? _clientState.LocalPlayer;
if (character == null || character.ObjectKind != ObjectKind.Player)
return;
unsafe
{
var bc = (BattleChara*)character.Address;
_chatGui.Print($"{character.Name} has Account Id: {bc->AccountId}, Content Id: {bc->ContentId}");
_persistenceContext.HandleContentIdMapping([
new PlayerMapping
{
ContentId = bc->ContentId,
AccountId = bc->AccountId,
PlayerName = bc->NameString,
}
]);
}
}
public void Dispose()
{
_commandManager.RemoveHandler("/accountid");
}
}
}

View File

@ -28,6 +28,14 @@ namespace RetainerTrack.Database.Compiled
sentinel: 0ul);
localContentId.TypeMapping = SqliteULongTypeMapping.Default;
var accountId = runtimeEntityType.AddProperty(
"AccountId",
typeof(ulong?),
propertyInfo: typeof(Player).GetProperty("AccountId", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly),
fieldInfo: typeof(Player).GetField("<AccountId>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
nullable: true);
accountId.TypeMapping = SqliteULongTypeMapping.Default;
var name = runtimeEntityType.AddProperty(
"Name",
typeof(string),

View File

@ -34,6 +34,11 @@ namespace RetainerTrack.Database.Compiled
var defaultTableMappings = new List<TableMappingBase<ColumnMappingBase>>();
player.SetRuntimeAnnotation("Relational:DefaultMappings", defaultTableMappings);
var retainerTrackDatabasePlayerTableBase = new TableBase("RetainerTrack.Database.Player", null, relationalModel);
var accountIdColumnBase = new ColumnBase<ColumnMappingBase>("AccountId", "INTEGER", retainerTrackDatabasePlayerTableBase)
{
IsNullable = true
};
retainerTrackDatabasePlayerTableBase.Columns.Add("AccountId", accountIdColumnBase);
var localContentIdColumnBase = new ColumnBase<ColumnMappingBase>("LocalContentId", "INTEGER", retainerTrackDatabasePlayerTableBase);
retainerTrackDatabasePlayerTableBase.Columns.Add("LocalContentId", localContentIdColumnBase);
var nameColumnBase = new ColumnBase<ColumnMappingBase>("Name", "TEXT", retainerTrackDatabasePlayerTableBase);
@ -43,6 +48,7 @@ namespace RetainerTrack.Database.Compiled
retainerTrackDatabasePlayerTableBase.AddTypeMapping(retainerTrackDatabasePlayerMappingBase, false);
defaultTableMappings.Add(retainerTrackDatabasePlayerMappingBase);
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)localContentIdColumnBase, player.FindProperty("LocalContentId")!, retainerTrackDatabasePlayerMappingBase);
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)accountIdColumnBase, player.FindProperty("AccountId")!, retainerTrackDatabasePlayerMappingBase);
RelationalModel.CreateColumnMapping((ColumnBase<ColumnMappingBase>)nameColumnBase, player.FindProperty("Name")!, retainerTrackDatabasePlayerMappingBase);
var tableMappings = new List<TableMapping>();
@ -50,6 +56,11 @@ namespace RetainerTrack.Database.Compiled
var playersTable = new Table("Players", null, relationalModel);
var localContentIdColumn = new Column("LocalContentId", "INTEGER", playersTable);
playersTable.Columns.Add("LocalContentId", localContentIdColumn);
var accountIdColumn = new Column("AccountId", "INTEGER", playersTable)
{
IsNullable = true
};
playersTable.Columns.Add("AccountId", accountIdColumn);
var nameColumn = new Column("Name", "TEXT", playersTable);
playersTable.Columns.Add("Name", nameColumn);
var pK_Players = new UniqueConstraint("PK_Players", playersTable, new[] { localContentIdColumn });
@ -65,6 +76,7 @@ namespace RetainerTrack.Database.Compiled
playersTable.AddTypeMapping(playersTableMapping, false);
tableMappings.Add(playersTableMapping);
RelationalModel.CreateColumnMapping(localContentIdColumn, player.FindProperty("LocalContentId")!, playersTableMapping);
RelationalModel.CreateColumnMapping(accountIdColumn, player.FindProperty("AccountId")!, playersTableMapping);
RelationalModel.CreateColumnMapping(nameColumn, player.FindProperty("Name")!, playersTableMapping);
var retainer = FindEntityType("RetainerTrack.Database.Retainer")!;

View File

@ -4,97 +4,23 @@ using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using Dalamud.Plugin;
using LiteDB;
using Microsoft.EntityFrameworkCore.Migrations;
using RetainerTrack.LegacyDb;
#nullable disable
#pragma warning disable 0612
namespace RetainerTrack.Database.Migrations
{
/// <inheritdoc />
public partial class ImportLegacyData : Migration
{
public static DalamudPluginInterface PluginInterface { get; set; }
private static readonly string[] PlayerColumns = new[] { "LocalContentId", "Name" };
private static readonly string[] RetainerColumns = new []{ "LocalContentId", "Name", "WorldId", "OwnerLocalContentId" };
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
if (PluginInterface == null)
return;
string legacyDatabaseFileName = Path.Join(PluginInterface.GetPluginConfigDirectory(), "retainer-data.litedb");
if (!File.Exists(legacyDatabaseFileName))
return;
using var liteDatabase = new LiteDatabase(new ConnectionString
{
Filename = Path.Join(PluginInterface.GetPluginConfigDirectory(), "retainer-data.litedb"),
Connection = ConnectionType.Direct,
Upgrade = true,
},
new BsonMapper
{
ResolveCollectionName = (type) =>
{
if (type == typeof(LegacyPlayer))
return LegacyPlayer.CollectionName;
if (type == typeof(LegacyRetainer))
return LegacyRetainer.CollectionName;
throw new ArgumentOutOfRangeException(nameof(type));
}
});
liteDatabase.GetCollection<LegacyRetainer>()
.EnsureIndex(x => x.Id);
liteDatabase.GetCollection<LegacyPlayer>()
.EnsureIndex(x => x.Id);
List<LegacyPlayer> allPlayers = liteDatabase.GetCollection<LegacyPlayer>().FindAll().ToList();
object[,] playersToInsert = To2DArray(
allPlayers.Select(player => new object[] { player.Id, player.Name }).ToList(),
PlayerColumns.Length);
migrationBuilder.InsertData(
table:"Players",
columns: PlayerColumns,
values: playersToInsert);
List<LegacyRetainer> allRetainers = liteDatabase.GetCollection<LegacyRetainer>().FindAll().ToList();
object[,] retainersToInsert = To2DArray(
allRetainers.Select(retainer => new object[] { retainer.Id, retainer.Name, retainer.WorldId, retainer.OwnerContentId }).ToList(),
RetainerColumns.Length);
migrationBuilder.InsertData(
table: "Retainers",
columns: RetainerColumns, values: retainersToInsert);
}
[SuppressMessage("Performance", "CA1814")]
private static object[,] To2DArray(IReadOnlyList<object[]> data, int columnCount)
{
object[,] result = new object[data.Count, columnCount];
for (int i = 0; i < data.Count; i++)
{
for (int j = 0; j < columnCount; j++)
{
result[i, j] = data[i][j];
}
}
return result;
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("DELETE FROM Players");
migrationBuilder.Sql("DELETE FROM Retainers");
}
}
}
#pragma warning restore 0612

View File

@ -0,0 +1,66 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using RetainerTrack.Database;
#nullable disable
namespace RetainerTrack.Database.Migrations
{
[DbContext(typeof(RetainerTrackContext))]
[Migration("20240629073047_AddAccountIdToPlayer")]
partial class AddAccountIdToPlayer
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.5");
modelBuilder.Entity("RetainerTrack.Database.Player", b =>
{
b.Property<ulong>("LocalContentId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong?>("AccountId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("TEXT");
b.HasKey("LocalContentId");
b.ToTable("Players");
});
modelBuilder.Entity("RetainerTrack.Database.Retainer", b =>
{
b.Property<ulong>("LocalContentId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(24)
.HasColumnType("TEXT");
b.Property<ulong>("OwnerLocalContentId")
.HasColumnType("INTEGER");
b.Property<ushort>("WorldId")
.HasColumnType("INTEGER");
b.HasKey("LocalContentId");
b.ToTable("Retainers");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RetainerTrack.Database.Migrations
{
/// <inheritdoc />
public partial class AddAccountIdToPlayer : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<ulong>(
name: "AccountId",
table: "Players",
type: "INTEGER",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AccountId",
table: "Players");
}
}
}

View File

@ -1,4 +1,5 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
@ -22,6 +23,9 @@ namespace RetainerTrack.Database.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<ulong?>("AccountId")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(20)

View File

@ -9,4 +9,6 @@ public class Player
[MaxLength(20), Required]
public string? Name { get; set; }
public ulong? AccountId { get; set; }
}

View File

@ -1,7 +0,0 @@
namespace RetainerTrack.Handlers;
internal sealed class ContentIdToName
{
public ulong ContentId { get; init; }
public string PlayerName { get; init; } = string.Empty;
}

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using Dalamud.Hooking;
using Dalamud.Memory;
using Dalamud.Plugin.Services;
using Dalamud.Utility;
using Dalamud.Utility.Signatures;
using Microsoft.Extensions.Logging;
@ -36,7 +37,8 @@ internal sealed unsafe class GameHooks : IDisposable
#pragma warning restore CS0649
public GameHooks(ILogger<GameHooks> logger, PersistenceContext persistenceContext, IGameInteropProvider gameInteropProvider)
public GameHooks(ILogger<GameHooks> logger, PersistenceContext persistenceContext,
IGameInteropProvider gameInteropProvider)
{
_logger = logger;
_persistenceContext = persistenceContext;
@ -53,9 +55,10 @@ internal sealed unsafe class GameHooks : IDisposable
{
try
{
var mapping = new ContentIdToName
var mapping = new PlayerMapping
{
ContentId = contentId,
AccountId = null,
PlayerName = MemoryHelper.ReadString(new nint(playerName), Encoding.ASCII, 32),
};
@ -63,7 +66,8 @@ internal sealed unsafe class GameHooks : IDisposable
{
_logger.LogTrace("Content id {ContentId} belongs to '{Name}'", mapping.ContentId,
mapping.PlayerName);
Task.Run(() => _persistenceContext.HandleContentIdMapping(mapping));
if (mapping.PlayerName.IsValidCharacterName())
Task.Run(() => _persistenceContext.HandleContentIdMapping(new List<PlayerMapping> { mapping }));
}
else
{
@ -84,19 +88,23 @@ internal sealed unsafe class GameHooks : IDisposable
try
{
var result = Marshal.PtrToStructure<SocialListResultPage>(dataPtr);
List<ContentIdToName> mappings = new();
List<PlayerMapping> mappings = new();
foreach (SocialListPlayer player in result.PlayerSpan)
{
var mapping = new ContentIdToName
if (player.ContentId == 0)
continue;
var mapping = new PlayerMapping
{
ContentId = player.ContentId,
AccountId = player.AccountId != 0 ? player.AccountId : null,
PlayerName = MemoryHelper.ReadString(new nint(player.CharacterName), Encoding.ASCII, 32),
};
if (!string.IsNullOrEmpty(mapping.PlayerName))
{
_logger.LogDebug("Content id {ContentId} belongs to '{Name}'", mapping.ContentId,
mapping.PlayerName);
_logger.LogDebug("Content id {ContentId} belongs to '{Name}' ({AccountId})", mapping.ContentId,
mapping.PlayerName, mapping.AccountId);
mappings.Add(mapping);
}
else
@ -139,12 +147,12 @@ internal sealed unsafe class GameHooks : IDisposable
[StructLayout(LayoutKind.Explicit, Size = 0x420)]
internal struct SocialListResultPage
{
[FieldOffset(0x10)] private fixed byte Players[10 * 0x58];
[FieldOffset(0x10)] private fixed byte Players[10 * 0x70];
public Span<SocialListPlayer> PlayerSpan => new(Unsafe.AsPointer(ref Players[0]), 10);
}
[StructLayout(LayoutKind.Explicit, Size = 0x68, Pack = 1)]
[StructLayout(LayoutKind.Explicit, Size = 0x70, Pack = 1)]
internal struct SocialListPlayer
{
/// <summary>
@ -153,9 +161,14 @@ internal sealed unsafe class GameHooks : IDisposable
/// </summary>
[FieldOffset(0x00)] public readonly ulong ContentId;
/// <summary>
/// Only seems to be set for certain kind of social lists, e.g. friend list/FC members doesn't include any.
/// </summary>
[FieldOffset(0x18)] public readonly ulong AccountId;
/// <summary>
/// This *can* be empty, e.g. if you're querying your friend list, the names are ONLY set for characters on the same world.
/// </summary>
[FieldOffset(0x3C)] public fixed byte CharacterName[32];
[FieldOffset(0x44)] public fixed byte CharacterName[32];
}
}

View File

@ -1,64 +1,38 @@
using System;
using System.Threading.Tasks;
using Dalamud.Game.Network.Structures;
using Dalamud.Hooking;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.UI.Info;
using Microsoft.Extensions.Logging;
namespace RetainerTrack.Handlers;
internal sealed class MarketBoardOfferingsHandler : IDisposable
{
private unsafe delegate void* MarketBoardOfferings(InfoProxyItemSearch* a1, nint packetData);
private readonly IMarketBoard _marketBoard;
private readonly ILogger<MarketBoardOfferingsHandler> _logger;
private readonly IClientState _clientState;
private readonly PersistenceContext _persistenceContext;
private readonly Hook<MarketBoardOfferings> _marketBoardOfferingsHook;
public unsafe MarketBoardOfferingsHandler(
public MarketBoardOfferingsHandler(
IMarketBoard marketBoard,
ILogger<MarketBoardOfferingsHandler> logger,
IClientState clientState,
IGameInteropProvider gameInteropProvider,
PersistenceContext persistenceContext)
{
_marketBoard = marketBoard;
_logger = logger;
_clientState = clientState;
_persistenceContext = persistenceContext;
_logger.LogDebug("Setting up offerings hook");
_marketBoardOfferingsHook =
gameInteropProvider.HookFromSignature<MarketBoardOfferings>("48 89 5C 24 ?? 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 0F B6 82 ?? ?? ?? ?? 48 8B FA 48 8B D9 38 41 19 74 54",
MarketBoardOfferingsDetour);
_marketBoardOfferingsHook.Enable();
_logger.LogDebug("Offerings hook enabled successfully");
_marketBoard.OfferingsReceived += HandleOfferings;
}
public void Dispose()
{
_marketBoardOfferingsHook.Dispose();
_marketBoard.OfferingsReceived += HandleOfferings;
}
// adapted from https://github.com/tesu/PennyPincher/commit/0f9b3963fd4a6e9b87f585ee491d4de59a93f7a3
private unsafe void* MarketBoardOfferingsDetour(InfoProxyItemSearch* a1, nint packetData)
{
try
{
if (packetData != nint.Zero)
{
ParseOfferings(packetData);
}
}
catch (Exception e)
{
_logger.LogError(e, "Could not parse marketboard offerings.");
}
return _marketBoardOfferingsHook.Original(a1, packetData);
}
private void ParseOfferings(nint dataPtr)
private void HandleOfferings(IMarketBoardCurrentOfferings currentOfferings)
{
ushort worldId = (ushort?)_clientState.LocalPlayer?.CurrentWorld.Id ?? 0;
if (worldId == 0)
@ -67,7 +41,6 @@ internal sealed class MarketBoardOfferingsHandler : IDisposable
return;
}
var listings = MarketBoardCurrentOfferings.Read(dataPtr);
Task.Run(() => _persistenceContext.HandleMarketBoardPage(listings, worldId));
Task.Run(() => _persistenceContext.HandleMarketBoardPage(currentOfferings, worldId));
}
}

View File

@ -51,11 +51,17 @@ internal sealed unsafe class MarketBoardUiHandler : IDisposable
for (int i = 0; i < length; ++i)
{
var listItem = results->ItemRendererList[i].AtkComponentListItemRenderer;
if (listItem == null)
return;
var uldManager = listItem->AtkComponentButton.AtkComponentBase.UldManager;
if (uldManager.NodeListCount < 14)
continue;
var retainerNameNode = (AtkTextNode*)uldManager.NodeList[5];
if (retainerNameNode == null)
return;
string retainerName = retainerNameNode->NodeText.ToString();
if (!retainerName.Contains('(', StringComparison.Ordinal))
{

View File

@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Memory;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game.Character;
using Microsoft.Extensions.Logging;
namespace RetainerTrack.Handlers;
internal sealed class ObjectTableHandler : IDisposable
{
private readonly IObjectTable _objectTable;
private readonly IFramework _framework;
private readonly IClientState _clientState;
private readonly ILogger<ObjectTableHandler> _logger;
private readonly PersistenceContext _persistenceContext;
private long _lastUpdate;
public ObjectTableHandler(IObjectTable objectTable, IFramework framework, IClientState clientState, ILogger<ObjectTableHandler> logger, PersistenceContext persistenceContext)
{
_objectTable = objectTable;
_framework = framework;
_clientState = clientState;
_logger = logger;
_persistenceContext = persistenceContext;
_framework.Update += FrameworkUpdate;
}
private unsafe void FrameworkUpdate(IFramework framework)
{
long now = Environment.TickCount64;
if (!_clientState.IsLoggedIn || _clientState.IsPvPExcludingDen || now - _lastUpdate < 30_000)
return;
_lastUpdate = now;
List<PlayerMapping> playerMappings = new();
foreach (var obj in _objectTable)
{
if (obj.ObjectKind == ObjectKind.Player)
{
var bc = (BattleChara*)obj.Address;
if (bc->ContentId == 0 || bc->AccountId == 0)
continue;
playerMappings.Add(new PlayerMapping
{
ContentId = bc->ContentId,
AccountId = bc->AccountId,
PlayerName = bc->NameString,
});
}
}
if (playerMappings.Count > 0)
Task.Run(() => _persistenceContext.HandleContentIdMapping(playerMappings));
_logger.LogTrace("ObjectTable handling for {Count} players took {TimeMs}", playerMappings.Count, TimeSpan.FromMilliseconds(Environment.TickCount64 - now));
}
public void Dispose()
{
_framework.Update -= FrameworkUpdate;
}
}

View File

@ -1,68 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Dalamud.Memory;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game.Group;
namespace RetainerTrack.Handlers;
internal sealed class PartyHandler : IDisposable
{
private readonly IFramework _framework;
private readonly IClientState _clientState;
private readonly PersistenceContext _persistenceContext;
private long _lastUpdate;
public PartyHandler(IFramework framework, IClientState clientState, PersistenceContext persistenceContext)
{
_framework = framework;
_clientState = clientState;
_persistenceContext = persistenceContext;
_framework.Update += FrameworkUpdate;
}
private unsafe void FrameworkUpdate(IFramework _)
{
long now = Environment.TickCount64;
if (!_clientState.IsLoggedIn || _clientState.IsPvPExcludingDen || now - _lastUpdate < 180_000)
return;
_lastUpdate = now;
// skip if we're not in an alliance, party members are handled via social list updates
var groupManager = GroupManager.Instance();
if (groupManager->AllianceFlags == 0x0)
return;
List<ContentIdToName> mappings = new();
foreach (var allianceMember in groupManager->AllianceMembersSpan)
HandlePartyMember(allianceMember, mappings);
if (mappings.Count > 0)
Task.Run(() => _persistenceContext.HandleContentIdMapping(mappings));
}
private static unsafe void HandlePartyMember(PartyMember partyMember, List<ContentIdToName> contentIdToNames)
{
if (partyMember.ContentID == 0)
return;
string name = MemoryHelper.ReadStringNullTerminated((nint)partyMember.Name);
if (string.IsNullOrEmpty(name))
return;
contentIdToNames.Add(new ContentIdToName
{
ContentId = (ulong)partyMember.ContentID,
PlayerName = name,
});
}
public void Dispose()
{
_framework.Update -= FrameworkUpdate;
}
}

View File

@ -5,6 +5,7 @@ using System.Globalization;
using System.Linq;
using Dalamud.Game.Network.Structures;
using Dalamud.Plugin.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using RetainerTrack.Database;
@ -17,7 +18,7 @@ internal sealed class PersistenceContext
private readonly IClientState _clientState;
private readonly IServiceProvider _serviceProvider;
private readonly ConcurrentDictionary<uint, ConcurrentDictionary<string, ulong>> _worldRetainerCache = new();
private readonly ConcurrentDictionary<ulong, string> _playerNameCache = new();
private readonly ConcurrentDictionary<ulong, CachedPlayer> _playerCache = new();
public PersistenceContext(ILogger<PersistenceContext> logger, IClientState clientState,
IServiceProvider serviceProvider)
@ -42,7 +43,13 @@ internal sealed class PersistenceContext
}
foreach (var player in dbContext.Players)
_playerNameCache[player.LocalContentId] = player.Name ?? string.Empty;
{
_playerCache[player.LocalContentId] = new CachedPlayer
{
AccountId = player.AccountId,
Name = player.Name ?? string.Empty,
};
}
}
}
@ -56,7 +63,9 @@ internal sealed class PersistenceContext
if (!currentWorldCache.TryGetValue(retainerName, out ulong playerContentId))
return string.Empty;
return _playerNameCache.TryGetValue(playerContentId, out string? playerName) ? playerName : string.Empty;
return _playerCache.TryGetValue(playerContentId, out CachedPlayer? cachedPlayer)
? cachedPlayer.Name
: string.Empty;
}
public IReadOnlyList<string> GetRetainerNamesForCharacter(string characterName, uint world)
@ -73,12 +82,14 @@ internal sealed class PersistenceContext
.AsReadOnly();
}
public void HandleMarketBoardPage(MarketBoardCurrentOfferings listings, ushort worldId)
public void HandleMarketBoardPage(IMarketBoardCurrentOfferings currentOfferings, ushort worldId)
{
try
{
var updates =
listings.ItemListings.DistinctBy(o => o.RetainerId)
currentOfferings.ItemListings
.Cast<MarketBoardCurrentOfferings.MarketBoardItemListing>()
.DistinctBy(o => o.RetainerId)
.Where(l => l.RetainerId != 0)
.Where(l => l.RetainerOwnerId != 0)
.Select(l =>
@ -111,7 +122,8 @@ internal sealed class PersistenceContext
Retainer? dbRetainer = dbContext.Retainers.Find(retainer.LocalContentId);
if (dbRetainer != null)
{
_logger.LogDebug("Updating retainer {RetainerName} with {LocalContentId}", retainer.Name, retainer.LocalContentId);
_logger.LogDebug("Updating retainer {RetainerName} with {LocalContentId}", retainer.Name,
retainer.LocalContentId);
dbRetainer.Name = retainer.Name;
dbRetainer.WorldId = retainer.WorldId;
dbRetainer.OwnerLocalContentId = retainer.OwnerLocalContentId;
@ -119,11 +131,15 @@ internal sealed class PersistenceContext
}
else
{
_logger.LogDebug("Adding retainer {RetainerName} with {LocalContentId}", retainer.Name, retainer.LocalContentId);
_logger.LogDebug("Adding retainer {RetainerName} with {LocalContentId}", retainer.Name,
retainer.LocalContentId);
dbContext.Retainers.Add(retainer);
}
if (!_playerNameCache.TryGetValue(retainer.OwnerLocalContentId, out string? ownerName))
string ownerName;
if (_playerCache.TryGetValue(retainer.OwnerLocalContentId, out CachedPlayer? cachedPlayer))
ownerName = cachedPlayer.Name;
else
ownerName = retainer.OwnerLocalContentId.ToString(CultureInfo.InvariantCulture);
_logger.LogDebug(" Retainer {RetainerName} belongs to {OwnerName}", retainer.Name,
ownerName);
@ -145,45 +161,94 @@ internal sealed class PersistenceContext
}
}
public void HandleContentIdMapping(ContentIdToName mapping)
=> HandleContentIdMapping(new List<ContentIdToName> { mapping });
public void HandleContentIdMapping(IReadOnlyList<ContentIdToName> mappings)
private void HandleContentIdMappingFallback(PlayerMapping mapping)
{
try
{
var updates = mappings.DistinctBy(x => x.ContentId)
.Where(mapping => mapping.ContentId != 0 && !string.IsNullOrEmpty(mapping.PlayerName))
.Where(mapping =>
{
if (_playerNameCache.TryGetValue(mapping.ContentId, out string? existingName))
return mapping.PlayerName != existingName;
if (mapping.ContentId == 0 || string.IsNullOrEmpty(mapping.PlayerName))
return;
return true;
})
.Select(mapping =>
new Player
if (_playerCache.TryGetValue(mapping.ContentId, out CachedPlayer? cachedPlayer))
{
if (mapping.PlayerName == cachedPlayer.Name && mapping.AccountId == cachedPlayer.AccountId)
return;
}
using (var scope = _serviceProvider.CreateScope())
{
using var dbContext = scope.ServiceProvider.GetRequiredService<RetainerTrackContext>();
var dbPlayer = dbContext.Players.Find(mapping.ContentId);
if (dbPlayer == null)
dbContext.Players.Add(new Player
{
LocalContentId = mapping.ContentId,
Name = mapping.PlayerName,
})
.ToList();
AccountId = mapping.AccountId,
});
else
{
dbPlayer.Name = mapping.PlayerName;
dbPlayer.AccountId ??= mapping.AccountId;
dbContext.Entry(dbPlayer).State = EntityState.Modified;
}
if (updates.Count == 0)
return;
int changeCount = dbContext.SaveChanges();
if (changeCount > 0)
{
_logger.LogDebug("Saved fallback player mappings for {ContentId} / {Name} / {AccountId}",
mapping.ContentId, mapping.PlayerName, mapping.AccountId);
}
_playerCache[mapping.ContentId] = new CachedPlayer
{
AccountId = mapping.AccountId,
Name = mapping.PlayerName,
};
}
}
catch (Exception e)
{
_logger.LogWarning(e, "Could not persist singular mapping for {ContentId} / {Name} / {AccountId}",
mapping.ContentId, mapping.PlayerName, mapping.AccountId);
}
}
public void HandleContentIdMapping(IReadOnlyList<PlayerMapping> mappings)
{
var updates = mappings.DistinctBy(x => x.ContentId)
.Where(mapping => mapping.ContentId != 0 && !string.IsNullOrEmpty(mapping.PlayerName))
.Where(mapping =>
{
if (_playerCache.TryGetValue(mapping.ContentId, out CachedPlayer? cachedPlayer))
return mapping.PlayerName != cachedPlayer.Name || mapping.AccountId != cachedPlayer.AccountId;
return true;
})
.ToList();
if (updates.Count == 0)
return;
try
{
using (var scope = _serviceProvider.CreateScope())
{
using var dbContext = scope.ServiceProvider.GetRequiredService<RetainerTrackContext>();
foreach (var update in updates)
{
var dbPlayer = dbContext.Players.Find(update.LocalContentId);
var dbPlayer = dbContext.Players.Find(update.ContentId);
if (dbPlayer == null)
dbContext.Players.Add(update);
dbContext.Players.Add(new Player
{
LocalContentId = update.ContentId,
Name = update.PlayerName,
AccountId = update.AccountId,
});
else
{
dbPlayer.Name = update.Name;
dbContext.Players.Update(dbPlayer);
dbPlayer.Name = update.PlayerName;
dbPlayer.AccountId ??= update.AccountId;
dbContext.Entry(dbPlayer).State = EntityState.Modified;
}
}
@ -192,16 +257,33 @@ internal sealed class PersistenceContext
{
_logger.LogDebug("Saved {Count} player mappings", changeCount);
foreach (var update in updates)
_logger.LogTrace(" {ContentId} = {Name}", update.LocalContentId, update.Name);
_logger.LogTrace(" {ContentId} = {Name} ({AccountId})", update.ContentId, update.PlayerName,
update.AccountId);
}
}
foreach (var player in updates)
_playerNameCache[player.LocalContentId] = player.Name ?? string.Empty;
{
_playerCache[player.ContentId] = new CachedPlayer
{
AccountId = player.AccountId,
Name = player.PlayerName,
};
}
}
catch (Exception e)
{
_logger.LogError(e, "Could not persist multiple mappings");
_logger.LogWarning(e, "Could not persist multiple mappings, attempting non-batch update");
foreach (var update in updates)
{
HandleContentIdMappingFallback(update);
}
}
}
public sealed class CachedPlayer
{
public required ulong? AccountId { get; init; }
public required string Name { get; init; }
}
}

View File

@ -0,0 +1,8 @@
namespace RetainerTrack.Handlers;
internal sealed class PlayerMapping
{
public required ulong? AccountId { get; init; }
public required ulong ContentId { get; init; }
public required string PlayerName { get; init; } = string.Empty;
}

View File

@ -1,12 +0,0 @@
using System;
namespace RetainerTrack.LegacyDb;
[Obsolete]
internal sealed class LegacyPlayer
{
public static string CollectionName => "Player";
public ulong Id { get; set; }
public string? Name { get; set; }
}

View File

@ -1,14 +0,0 @@
using System;
namespace RetainerTrack.LegacyDb;
[Obsolete]
internal sealed class LegacyRetainer
{
public static string CollectionName => "Retainer";
public ulong Id { get; set; }
public string? Name { get; set; }
public ushort WorldId { get; set; }
public ulong OwnerContentId { get; set; }
}

View File

@ -1,73 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Dalamud.NET.Sdk/9.0.2">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Version>3.2</Version>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<Version>4.3</Version>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<OutputPath>dist</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<DebugType>portable</DebugType>
<PathMap Condition="$(SolutionDir) != ''">$(SolutionDir)=X:\</PathMap>
<SatelliteResourceLanguages>none</SatelliteResourceLanguages>
<OutputPath Condition="'$(Configuration)' != 'EF'">dist</OutputPath>
</PropertyGroup>
<PropertyGroup>
<DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
</PropertyGroup>
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
<DalamudLibPath>$(DALAMUD_HOME)/</DalamudLibPath>
</PropertyGroup>
<Import Project="..\LLib\LLib.targets"/>
<Import Project="..\LLib\RenameZip.targets"/>
<ItemGroup>
<PackageReference Include="Dalamud.Extensions.MicrosoftLogging" Version="3.0.0" />
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<PackageReference Include="LiteDB" Version="5.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.5">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.5" Condition="'$(Configuration)' == 'EF'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Dalamud">
<HintPath>$(DalamudLibPath)Dalamud.dll</HintPath>
<Private Condition="'$(Configuration)' != 'EF'">false</Private>
</Reference>
<Reference Include="ImGui.NET">
<HintPath>$(DalamudLibPath)ImGui.NET.dll</HintPath>
<Private Condition="'$(Configuration)' != 'EF'">false</Private>
</Reference>
<Reference Include="ImGuiScene">
<HintPath>$(DalamudLibPath)ImGuiScene.dll</HintPath>
<Private Condition="'$(Configuration)' != 'EF'">false</Private>
</Reference>
<Reference Include="Lumina">
<HintPath>$(DalamudLibPath)Lumina.dll</HintPath>
<Private Condition="'$(Configuration)' != 'EF'">false</Private>
</Reference>
<Reference Include="Lumina.Excel">
<HintPath>$(DalamudLibPath)Lumina.Excel.dll</HintPath>
<Private Condition="'$(Configuration)' != 'EF'">false</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
<Private Condition="'$(Configuration)' != 'EF'">false</Private>
</Reference>
<Reference Include="FFXIVClientStructs">
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
<Private Condition="'$(Configuration)' != 'EF'">false</Private>
</Reference>
</ItemGroup>
<Target Name="RenameLatestZip" AfterTargets="PackagePlugin" Condition="'$(Configuration)' == 'Release'">
<Exec Command="rename $(OutDir)$(AssemblyName)\latest.zip $(AssemblyName)-$(Version).zip" />
</Target>
</Project>

View File

@ -1,6 +1,7 @@
using System;
using System.IO;
using Dalamud.Extensions.MicrosoftLogging;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using Microsoft.Data.Sqlite;
@ -10,7 +11,6 @@ using Microsoft.Extensions.Logging;
using RetainerTrack.Commands;
using RetainerTrack.Database;
using RetainerTrack.Database.Compiled;
using RetainerTrack.Database.Migrations;
using RetainerTrack.Handlers;
namespace RetainerTrack;
@ -23,7 +23,7 @@ internal sealed class RetainerTrackPlugin : IDalamudPlugin
private readonly ServiceProvider? _serviceProvider;
public RetainerTrackPlugin(
DalamudPluginInterface pluginInterface,
IDalamudPluginInterface pluginInterface,
IFramework framework,
IClientState clientState,
IGameGui gameGui,
@ -32,6 +32,9 @@ internal sealed class RetainerTrackPlugin : IDalamudPlugin
IAddonLifecycle addonLifecycle,
ICommandManager commandManager,
IDataManager dataManager,
ITargetManager targetManager,
IObjectTable objectTable,
IMarketBoard marketBoard,
IPluginLog pluginLog)
{
ServiceCollection serviceCollection = new();
@ -49,41 +52,52 @@ internal sealed class RetainerTrackPlugin : IDalamudPlugin
serviceCollection.AddSingleton(addonLifecycle);
serviceCollection.AddSingleton(commandManager);
serviceCollection.AddSingleton(dataManager);
serviceCollection.AddSingleton(targetManager);
serviceCollection.AddSingleton(objectTable);
serviceCollection.AddSingleton(marketBoard);
serviceCollection.AddSingleton<PersistenceContext>();
serviceCollection.AddSingleton<MarketBoardOfferingsHandler>();
serviceCollection.AddSingleton<PartyHandler>();
serviceCollection.AddSingleton<MarketBoardUiHandler>();
serviceCollection.AddSingleton<ObjectTableHandler>();
serviceCollection.AddSingleton<GameHooks>();
serviceCollection.AddSingleton<AccountIdCommand>();
serviceCollection.AddSingleton<WhoCommand>();
_sqliteConnectionString =
$"Data Source={Path.Join(pluginInterface.GetPluginConfigDirectory(), DatabaseFileName)}";
serviceCollection.AddDbContext<RetainerTrackContext>(o => o
.UseSqlite(_sqliteConnectionString)
.UseModel(RetainerTrackContextModel.Instance));
_sqliteConnectionString = PrepareSqliteDb(serviceCollection, pluginInterface.GetPluginConfigDirectory());
_serviceProvider = serviceCollection.BuildServiceProvider();
RunMigrations(_serviceProvider);
InitializeRequiredServices(_serviceProvider);
}
_serviceProvider.GetRequiredService<PartyHandler>();
_serviceProvider.GetRequiredService<MarketBoardOfferingsHandler>();
_serviceProvider.GetRequiredService<MarketBoardUiHandler>();
_serviceProvider.GetRequiredService<GameHooks>();
_serviceProvider.GetRequiredService<WhoCommand>();
private static string PrepareSqliteDb(IServiceCollection serviceCollection, string getPluginConfigDirectory)
{
string connectionString = $"Data Source={Path.Join(getPluginConfigDirectory, DatabaseFileName)}";
serviceCollection.AddDbContext<RetainerTrackContext>(o => o
.UseSqlite(connectionString)
.UseModel(RetainerTrackContextModel.Instance));
return connectionString;
}
private static void RunMigrations(IServiceProvider serviceProvider)
{
ImportLegacyData.PluginInterface = serviceProvider.GetRequiredService<DalamudPluginInterface>();
using var scope = serviceProvider.CreateScope();
using var dbContext = scope.ServiceProvider.GetRequiredService<RetainerTrackContext>();
dbContext.Database.Migrate();
}
private static void InitializeRequiredServices(ServiceProvider serviceProvider)
{
serviceProvider.GetRequiredService<MarketBoardOfferingsHandler>();
serviceProvider.GetRequiredService<MarketBoardUiHandler>();
serviceProvider.GetRequiredService<ObjectTableHandler>();
serviceProvider.GetRequiredService<GameHooks>();
serviceProvider.GetRequiredService<AccountIdCommand>();
serviceProvider.GetRequiredService<WhoCommand>();
}
public void Dispose()
{
_serviceProvider?.Dispose();

View File

@ -13,15 +13,21 @@
},
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.12, )",
"resolved": "2.1.12",
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg=="
"requested": "[2.1.13, )",
"resolved": "2.1.13",
"contentHash": "rMN1omGe8536f4xLMvx9NwfvpAc9YFFfeXJ1t4P4PE6Gu8WCIoFliR1sh07hM+bfODmesk/dvMbji7vNI+B/pQ=="
},
"LiteDB": {
"DotNet.ReproducibleBuilds": {
"type": "Direct",
"requested": "[5.0.17, )",
"resolved": "5.0.17",
"contentHash": "cKPvkdlzIts3ZKu/BzoIc/Y71e4VFKlij4LyioPFATZMot+wB7EAm1FFbZSJez6coJmQUoIg/3yHE1MMU+zOdg=="
"requested": "[1.1.1, )",
"resolved": "1.1.1",
"contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==",
"dependencies": {
"Microsoft.SourceLink.AzureRepos.Git": "1.1.1",
"Microsoft.SourceLink.Bitbucket.Git": "1.1.1",
"Microsoft.SourceLink.GitHub": "1.1.1",
"Microsoft.SourceLink.GitLab": "1.1.1"
}
},
"Microsoft.EntityFrameworkCore.Sqlite": {
"type": "Direct",
@ -33,82 +39,20 @@
"SQLitePCLRaw.bundle_e_sqlite3": "2.1.6"
}
},
"Microsoft.EntityFrameworkCore.Tools": {
"type": "Direct",
"requested": "[8.0.5, )",
"resolved": "8.0.5",
"contentHash": "ZG5X2uznVmw+Mk0HVv3YHiTaGcCANDmZg81/9GLvE5zU4B11oxuM1+tndkYCFoM9CSN0/+XfB89TVYViKXYiRA==",
"dependencies": {
"Microsoft.EntityFrameworkCore.Design": "8.0.5"
}
},
"Microsoft.Extensions.DependencyInjection": {
"Microsoft.SourceLink.Gitea": {
"type": "Direct",
"requested": "[8.0.0, )",
"resolved": "8.0.0",
"contentHash": "V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==",
"contentHash": "KOBodmDnlWGIqZt2hT47Q69TIoGhIApDVLCyyj9TT5ct8ju16AbHYcB4XeknoHX562wO1pMS/1DfBIZK+V+sxg==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
"Microsoft.Build.Tasks.Git": "8.0.0",
"Microsoft.SourceLink.Common": "8.0.0"
}
},
"Humanizer.Core": {
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "2.14.1",
"contentHash": "lQKvtaTDOXnoVJ20ibTuSIOf2i0uO0MPbDhd1jm238I+U/2ZnRENj0cktKZhtchBMtCUSRQ5v4xBCUbKNmyVMw=="
},
"Microsoft.Bcl.AsyncInterfaces": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
},
"Microsoft.CodeAnalysis.Analyzers": {
"type": "Transitive",
"resolved": "3.3.3",
"contentHash": "j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ=="
},
"Microsoft.CodeAnalysis.Common": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "lwAbIZNdnY0SUNoDmZHkVUwLO8UyNnyyh1t/4XsbFxi4Ounb3xszIYZaWhyj5ZjyfcwqwmtMbE7fUTVCqQEIdQ==",
"dependencies": {
"Microsoft.CodeAnalysis.Analyzers": "3.3.3",
"System.Collections.Immutable": "6.0.0",
"System.Reflection.Metadata": "6.0.1",
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encoding.CodePages": "6.0.0"
}
},
"Microsoft.CodeAnalysis.CSharp": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "cM59oMKAOxvdv76bdmaKPy5hfj+oR+zxikWoueEB7CwTko7mt9sVKZI8Qxlov0C/LuKEG+WQwifepqL3vuTiBQ==",
"dependencies": {
"Microsoft.CodeAnalysis.Common": "[4.5.0]"
}
},
"Microsoft.CodeAnalysis.CSharp.Workspaces": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "h74wTpmGOp4yS4hj+EvNzEiPgg/KVs2wmSfTZ81upJZOtPkJsVkgfsgtxxqmAeapjT/vLKfmYV0bS8n5MNVP+g==",
"dependencies": {
"Humanizer.Core": "2.14.1",
"Microsoft.CodeAnalysis.CSharp": "[4.5.0]",
"Microsoft.CodeAnalysis.Common": "[4.5.0]",
"Microsoft.CodeAnalysis.Workspaces.Common": "[4.5.0]"
}
},
"Microsoft.CodeAnalysis.Workspaces.Common": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "l4dDRmGELXG72XZaonnOeORyD/T5RpEu5LGHOUIhnv+MmUWDY/m1kWXGwtcgQ5CJ5ynkFiRnIYzTKXYjUs7rbw==",
"dependencies": {
"Humanizer.Core": "2.14.1",
"Microsoft.Bcl.AsyncInterfaces": "6.0.0",
"Microsoft.CodeAnalysis.Common": "[4.5.0]",
"System.Composition": "6.0.0",
"System.IO.Pipelines": "6.0.3",
"System.Threading.Channels": "6.0.0"
}
"resolved": "8.0.0",
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
},
"Microsoft.Data.Sqlite.Core": {
"type": "Transitive",
@ -139,18 +83,6 @@
"resolved": "8.0.5",
"contentHash": "LzoKedC+9A8inF5d3iIzgyv/JDXgKrtpYoGIC3EqGWuHVDm9s/IHHApeTOTbzvnr7yBVV+nmYfyT1nwtzRDp0Q=="
},
"Microsoft.EntityFrameworkCore.Design": {
"type": "Transitive",
"resolved": "8.0.5",
"contentHash": "HWYnbuMwllSCsZjfKj3Vz+HDGOCyGlTMYjI7tZH5pK7AuiGNHOdshCnWlEFEuDV6oAadWfXGTDmkmV53gwTqSQ==",
"dependencies": {
"Humanizer.Core": "2.14.1",
"Microsoft.CodeAnalysis.CSharp.Workspaces": "4.5.0",
"Microsoft.EntityFrameworkCore.Relational": "8.0.5",
"Microsoft.Extensions.DependencyModel": "8.0.0",
"Mono.TextTemplating": "2.2.1"
}
},
"Microsoft.EntityFrameworkCore.Relational": {
"type": "Transitive",
"resolved": "8.0.5",
@ -198,6 +130,14 @@
"Microsoft.Extensions.Primitives": "8.0.0"
}
},
"Microsoft.Extensions.DependencyInjection": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "V8S3bsm50ig6JSyrbcJJ8bW2b9QLGouz+G1miK3UTaOWmMtFwNNNzUf4AleyDWUmTrWMLNnFSLEQtxmxgNQnNQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "8.0.0",
@ -244,12 +184,45 @@
"resolved": "8.0.0",
"contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g=="
},
"Mono.TextTemplating": {
"Microsoft.SourceLink.AzureRepos.Git": {
"type": "Transitive",
"resolved": "2.2.1",
"contentHash": "KZYeKBET/2Z0gY1WlTAK7+RHTl7GSbtvTLDXEZZojUdAPqpQNDL6tHv7VUpqfX5VEOh+uRGKaZXkuD253nEOBQ==",
"resolved": "1.1.1",
"contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==",
"dependencies": {
"System.CodeDom": "4.4.0"
"Microsoft.Build.Tasks.Git": "1.1.1",
"Microsoft.SourceLink.Common": "1.1.1"
}
},
"Microsoft.SourceLink.Bitbucket.Git": {
"type": "Transitive",
"resolved": "1.1.1",
"contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1",
"Microsoft.SourceLink.Common": "1.1.1"
}
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Transitive",
"resolved": "1.1.1",
"contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1",
"Microsoft.SourceLink.Common": "1.1.1"
}
},
"Microsoft.SourceLink.GitLab": {
"type": "Transitive",
"resolved": "1.1.1",
"contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1",
"Microsoft.SourceLink.Common": "1.1.1"
}
},
"SQLitePCLRaw.bundle_e_sqlite3": {
@ -282,98 +255,11 @@
"SQLitePCLRaw.core": "2.1.6"
}
},
"System.CodeDom": {
"type": "Transitive",
"resolved": "4.4.0",
"contentHash": "2sCCb7doXEwtYAbqzbF/8UAeDRMNmPaQbU2q50Psg1J9KzumyVVCgKQY8s53WIPTufNT0DpSe9QRvVjOzfDWBA=="
},
"System.Collections.Immutable": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "l4zZJ1WU2hqpQQHXz1rvC3etVZN+2DLmQMO79FhOTZHMn8tDRr+WU287sbomD0BETlmKDn0ygUgVy9k5xkkJdA==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Composition": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "d7wMuKQtfsxUa7S13tITC8n1cQzewuhD5iDjZtK2prwFfKVzdYtgrTHgjaV03Zq7feGQ5gkP85tJJntXwInsJA==",
"dependencies": {
"System.Composition.AttributedModel": "6.0.0",
"System.Composition.Convention": "6.0.0",
"System.Composition.Hosting": "6.0.0",
"System.Composition.Runtime": "6.0.0",
"System.Composition.TypedParts": "6.0.0"
}
},
"System.Composition.AttributedModel": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "WK1nSDLByK/4VoC7fkNiFuTVEiperuCN/Hyn+VN30R+W2ijO1d0Z2Qm0ScEl9xkSn1G2MyapJi8xpf4R8WRa/w=="
},
"System.Composition.Convention": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "XYi4lPRdu5bM4JVJ3/UIHAiG6V6lWWUlkhB9ab4IOq0FrRsp0F4wTyV4Dj+Ds+efoXJ3qbLqlvaUozDO7OLeXA==",
"dependencies": {
"System.Composition.AttributedModel": "6.0.0"
}
},
"System.Composition.Hosting": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "w/wXjj7kvxuHPLdzZ0PAUt++qJl03t7lENmb2Oev0n3zbxyNULbWBlnd5J5WUMMv15kg5o+/TCZFb6lSwfaUUQ==",
"dependencies": {
"System.Composition.Runtime": "6.0.0"
}
},
"System.Composition.Runtime": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "qkRH/YBaMPTnzxrS5RDk1juvqed4A6HOD/CwRcDGyPpYps1J27waBddiiq1y93jk2ZZ9wuA/kynM+NO0kb3PKg=="
},
"System.Composition.TypedParts": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "iUR1eHrL8Cwd82neQCJ00MpwNIBs4NZgXzrPqx8NJf/k4+mwBO0XCRmHYJT4OLSwDDqh5nBLJWkz5cROnrGhRA==",
"dependencies": {
"System.Composition.AttributedModel": "6.0.0",
"System.Composition.Hosting": "6.0.0",
"System.Composition.Runtime": "6.0.0"
}
},
"System.IO.Pipelines": {
"type": "Transitive",
"resolved": "6.0.3",
"contentHash": "ryTgF+iFkpGZY1vRQhfCzX0xTdlV3pyaTTqRu2ETbEv+HlV7O6y7hyQURnghNIXvctl5DuZ//Dpks6HdL/Txgw=="
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA=="
},
"System.Reflection.Metadata": {
"type": "Transitive",
"resolved": "6.0.1",
"contentHash": "III/lNMSn0ZRBuM9m5Cgbiho5j81u0FAEagFX5ta2DKbljZ3T0IpD8j+BIiHQPeKqJppWS9bGEp6JnKnWKze0g==",
"dependencies": {
"System.Collections.Immutable": "6.0.0"
}
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg=="
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "8.0.0",
@ -386,11 +272,6 @@
"dependencies": {
"System.Text.Encodings.Web": "8.0.0"
}
},
"System.Threading.Channels": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q=="
}
},
"net8.0-windows7.0/win-x64": {
@ -399,14 +280,6 @@
"resolved": "2.1.6",
"contentHash": "2ObJJLkIUIxRpOUlZNGuD4rICpBnrBR5anjyfUFQep4hMOIeqW+XGQYzrNmHSVz5xSWZ3klSbh7sFR6UyDj68Q=="
},
"System.Text.Encoding.CodePages": {
"type": "Transitive",
"resolved": "6.0.0",
"contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==",
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Text.Encodings.Web": {
"type": "Transitive",
"resolved": "8.0.0",