Use client structs to read remaining delivery item fields

This commit is contained in:
Liza 2023-10-31 18:27:13 +01:00
parent eba2ac997a
commit 3f3306eec5
Signed by: liza
GPG Key ID: 7199F8D727D55F67
3 changed files with 5 additions and 21 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<Version>2.14</Version>
<Version>2.15</Version>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

View File

@ -132,25 +132,12 @@ partial class DeliverooPlugin
// this includes all items, even if they don't match the filter
list.Add(new TurnInItem
{
ItemId = Marshal.ReadInt32(new nint(&item) + 132),
ItemId = item.ItemId,
Name = MemoryHelper.ReadSeString(&item.ItemName).ToString(),
SealsWithBonus = (int)Math.Round(item.SealReward * GetSealMultiplier(), MidpointRounding.AwayFromZero),
SealsWithoutBonus = item.SealReward,
ItemUiCategory = Marshal.ReadByte(new nint(&item) + 150),
ItemUiCategory = item.ItemUiCategory,
});
// GrandCompanyItem + 104 = [int] InventoryType
// GrandCompanyItem + 108 = [int] ??
// GrandCompanyItem + 124 = [int] <Item's Column 19 in the sheet, but that has no name>
// GrandCompanyItem + 132 = [int] itemId
// GrandCompanyItem + 136 = [int] 0 (always)?
// GrandCompanyItem + 140 = [int] i (item's own position within the unsorted list)
// GrandCompanyItem + 148 = [short] ilvl
// GrandCompanyItem + 150 = [byte] ItemUICategory
// GrandCompanyItem + 151 = [byte] (unchecked) inventory slot in container
// GrandCompanyItem + 152 = [short] 512 (always)?
// int itemId = Marshal.ReadInt32(new nint(&item) + 132);
// PluginLog.Verbose($" {Marshal.ReadInt32(new nint(&item) + 132)};;;; {MemoryHelper.ReadSeString(&item.ItemName)}, {new nint(&agent->ItemArray[i]):X8}, {item.SealReward}, {item.IsTurnInAvailable}");
}
return list.OrderByDescending(x => x.SealsWithBonus)

View File

@ -1,11 +1,8 @@
using System.Runtime.InteropServices;
using FFXIVClientStructs.FFXIV.Client.System.String;
namespace Deliveroo.GameData;
namespace Deliveroo.GameData;
internal sealed class TurnInItem
{
public required int ItemId { get; init; }
public required uint ItemId { get; init; }
public required string Name { get; init; }
public required int SealsWithBonus { get; init; }
public required int SealsWithoutBonus { get; init; }