Skip to content

Commit

Permalink
Merge branch 'awgil:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Herculezz55 authored Jun 3, 2024
2 parents da79218 + c11b140 commit 7783016
Show file tree
Hide file tree
Showing 30 changed files with 530 additions and 1,361 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "FFXIVClientStructs"]
path = FFXIVClientStructs
url = https://github.com/awgil/FFXIVClientStructs.git
54 changes: 54 additions & 0 deletions BossMod.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,78 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UIDev", "UIDev\UIDev.csproj
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CodeAnalysis", "CodeAnalysis\CodeAnalysis.csproj", "{F5F7E565-DCF2-494A-A18F-F7FA503428F5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFXIVClientStructs", "FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj", "{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FFXIVClientStructs.InteropSourceGenerators", "FFXIVClientStructs\FFXIVClientStructs.InteropSourceGenerators\FFXIVClientStructs.InteropSourceGenerators.csproj", "{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropGenerator", "FFXIVClientStructs\InteropGenerator\InteropGenerator.csproj", "{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InteropGenerator.Runtime", "FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj", "{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|Any CPU.ActiveCfg = Debug|x64
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|Any CPU.Build.0 = Debug|x64
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|x64.ActiveCfg = Debug|x64
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|x64.Build.0 = Debug|x64
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|Any CPU.ActiveCfg = Release|x64
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|Any CPU.Build.0 = Release|x64
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.ActiveCfg = Release|x64
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.Build.0 = Release|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Debug|Any CPU.ActiveCfg = Debug|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Debug|Any CPU.Build.0 = Debug|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Debug|x64.ActiveCfg = Debug|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Debug|x64.Build.0 = Debug|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Release|Any CPU.ActiveCfg = Release|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Release|Any CPU.Build.0 = Release|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Release|x64.ActiveCfg = Release|x64
{9FFC3FB6-C9B3-4FA9-8378-F56B5916C8EC}.Release|x64.Build.0 = Release|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Debug|Any CPU.ActiveCfg = Debug|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Debug|Any CPU.Build.0 = Debug|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Debug|x64.ActiveCfg = Release|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Debug|x64.Build.0 = Release|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Release|Any CPU.ActiveCfg = Release|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Release|Any CPU.Build.0 = Release|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Release|x64.ActiveCfg = Release|x64
{F5F7E565-DCF2-494A-A18F-F7FA503428F5}.Release|x64.Build.0 = Release|x64
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Debug|x64.ActiveCfg = Debug|Any CPU
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Debug|x64.Build.0 = Debug|Any CPU
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Release|Any CPU.Build.0 = Release|Any CPU
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Release|x64.ActiveCfg = Release|Any CPU
{A1B9F2E8-1051-47C0-A480-20E1E9F8EF21}.Release|x64.Build.0 = Release|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|x64.ActiveCfg = Debug|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Debug|x64.Build.0 = Debug|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|Any CPU.Build.0 = Release|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|x64.ActiveCfg = Release|Any CPU
{0177B53D-6FFD-465D-A0A3-C18EA18BADD5}.Release|x64.Build.0 = Release|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Debug|x64.ActiveCfg = Debug|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Debug|x64.Build.0 = Debug|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Release|Any CPU.Build.0 = Release|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Release|x64.ActiveCfg = Release|Any CPU
{95FF6D8F-4513-470E-9C13-7FFC8A9D03B9}.Release|x64.Build.0 = Release|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Debug|x64.ActiveCfg = Debug|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Debug|x64.Build.0 = Debug|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Release|Any CPU.Build.0 = Release|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Release|x64.ActiveCfg = Release|Any CPU
{6ED2F995-6CBE-4630-9BA6-4F46F1A84BCB}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 8 additions & 2 deletions BossMod/Autorotation/Autorotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ public unsafe void Update()
if (Hints.ForcedTarget != null && PrimaryTarget != Hints.ForcedTarget)
{
PrimaryTarget = Hints.ForcedTarget;
FFXIVClientStructs.FFXIV.Client.Game.Control.TargetSystem.Instance()->Target = Utils.GameObjectInternal(Service.ObjectTable.FirstOrDefault(go => go.ObjectId == Hints.ForcedTarget.InstanceID));
var obj = Hints.ForcedTarget.SpawnIndex >= 0 ? FFXIVClientStructs.FFXIV.Client.Game.Object.GameObjectManager.Instance()->Objects.All[Hints.ForcedTarget.SpawnIndex].Value : null;
if (obj != null && obj->EntityId != Hints.ForcedTarget.InstanceID)
Service.Log($"[AR] Unexpected new target: expected {Hints.ForcedTarget.InstanceID:X} at #{Hints.ForcedTarget.SpawnIndex}, but found {obj->EntityId:X}");
FFXIVClientStructs.FFXIV.Client.Game.Control.TargetSystem.Instance()->Target = obj;
}

Type? classType = null;
Expand Down Expand Up @@ -135,7 +138,10 @@ public unsafe void Update()

ClassActions?.FillStatusesToCancel(Hints.StatusesToCancel);
foreach (var s in Hints.StatusesToCancel)
ActionManagerEx.Instance!.CancelStatus(s.statusId, s.sourceId != 0 ? (uint)s.sourceId : Dalamud.Game.ClientState.Objects.Types.GameObject.InvalidGameObjectId);
{
var res = FFXIVClientStructs.FFXIV.Client.Game.StatusManager.ExecuteStatusOff(s.statusId, s.sourceId != 0 ? (uint)s.sourceId : Dalamud.Game.ClientState.Objects.Types.GameObject.InvalidGameObjectId);
Service.Log($"[AR] Canceling status {s.statusId} from {s.sourceId:X} -> {res}");
}

_ui.IsOpen = ClassActions != null && Config.ShowUI;

Expand Down
11 changes: 3 additions & 8 deletions BossMod/BossMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<Content Include="BossMod.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<Using Include="System" />
<Using Include="System.Collections" />
Expand All @@ -58,10 +52,11 @@
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>Analyzer</OutputItemType>
</ProjectReference>
<Reference Include="FFXIVClientStructs">
<ProjectReference Include="..\FFXIVClientStructs\FFXIVClientStructs\FFXIVClientStructs.csproj" />
<!--<Reference Include="FFXIVClientStructs">
<HintPath>$(DalamudLibPath)FFXIVClientStructs.dll</HintPath>
<Private>false</Private>
</Reference>
</Reference>-->
<Reference Include="Newtonsoft.Json">
<HintPath>$(DalamudLibPath)Newtonsoft.Json.dll</HintPath>
<Private>false</Private>
Expand Down
6 changes: 4 additions & 2 deletions BossMod/Data/PartyState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

namespace BossMod;

// state of the party/alliance that player is part of; part of the world state structure
// state of the party/alliance/trust that player is part of; part of the world state structure
// solo player is considered to be in party of size 1
// after joining the party, member's slot never changes until leaving the party; this means that there could be intermediate gaps
// note that player could be in party without having actor in world (e.g. if he is in different zone)
// if player does not exist in world, party is always empty; otherwise player is always in slot 0
// in alliance, two 'other' groups use slots 8-15 and 16-23; alliance members don't have content-ID, but always have actor-ID
// in trust, buddies are considered party members with content-id 0 (but non-zero actor id, they are always in world)
// party slot is considered 'empty' if both ids are 0
public sealed class PartyState
{
public const int PlayerSlot = 0;
public const int MaxPartySize = 8;
public const int MaxAllianceSize = 24;

private readonly ulong[] _contentIDs = new ulong[MaxPartySize]; // non-alliance slots: empty slots contain 0's, alliance slots: n/a (FF always reports 0)
private readonly ulong[] _contentIDs = new ulong[MaxPartySize]; // non-alliance slots: empty slots or buddy slots contain 0's, alliance slots: n/a (FF always reports 0)
private readonly ulong[] _actorIDs = new ulong[MaxAllianceSize]; // non-alliance slots: empty slots or slots corresponding to players not in world contain 0's, alliance slots: empty slots contains 0's
private readonly Actor?[] _actors = new Actor?[MaxAllianceSize];

Expand Down
24 changes: 15 additions & 9 deletions BossMod/Debug/DebugAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@ public unsafe void DrawActionManagerExtensions()
{
var am = ActionManagerEx.Instance!;
var amr = FFXIVClientStructs.FFXIV.Client.Game.ActionManager.Instance();
var aidCastAction = am.CastAction;
var aidCastSpell = am.CastSpell;
var aidCombo = new ActionID(ActionType.Spell, amr->Combo.Action);
var aidQueued = am.QueuedAction;
var aidGTAction = new ActionID((ActionType)amr->AreaTargetingActionType, amr->AreaTargetingActionId);
var aidGTSpell = new ActionID(ActionType.Spell, amr->AreaTargetingSpellId);
ImGui.TextUnformatted($"ActionManager singleton address: 0x{(ulong)amr:X}");
ImGui.TextUnformatted($"Anim lock: {am.AnimationLock:f3}");
ImGui.TextUnformatted($"Cast: {am.CastAction} / {am.CastSpell}, progress={am.CastTimeElapsed:f3}/{am.CastTimeTotal:f3}, target={am.CastTargetID:X}/{Utils.Vec3String(am.CastTargetPos)}");
ImGui.TextUnformatted($"Combo: {new ActionID(ActionType.Spell, am.ComboLastMove)}, {am.ComboTimeLeft:f3}");
ImGui.TextUnformatted($"Queue: {(am.QueueActive ? "active" : "inactive")}, {am.QueueAction} @ {am.QueueTargetID:X} [{am.QueueCallType}], combo={am.QueueComboRouteID}");
ImGui.TextUnformatted($"GT: {am.GTAction} / {am.GTSpell}, arg={am.GTUnkArg}, obj={am.GTUnkObj:X}, a0={am.GTUnkA0:X2}, b8={am.GTUnkB8:X2}, bc={am.GTUnkBC:X}");
ImGui.TextUnformatted($"Last used action sequence: {am.LastUsedActionSequence}");
ImGui.TextUnformatted($"Anim lock: {amr->AnimationLock:f3}");
ImGui.TextUnformatted($"Cast: {aidCastAction} / {aidCastSpell}, progress={amr->CastTimeElapsed:f3}/{amr->CastTimeTotal:f3}, target={amr->CastTargetId:X}/{Utils.Vec3String(amr->CastTargetPosition)}");
ImGui.TextUnformatted($"Combo: {aidCombo}, {am.ComboTimeLeft:f3}");
ImGui.TextUnformatted($"Queue: {(amr->ActionQueued ? "active" : "inactive")}, {aidQueued} @ {(ulong)amr->QueuedTargetId:X} [{amr->QueueType}], combo={amr->QueuedComboRouteId}");
ImGui.TextUnformatted($"GT: {aidGTAction} / {aidGTSpell}, arg={Utils.ReadField<uint>(amr, 0x94)}, obj={Utils.ReadField<ulong>(amr, 0x98):X}, a0={Utils.ReadField<byte>(amr, 0xA0):X2}, b8={Utils.ReadField<byte>(amr, 0xB8):X2}, bc={Utils.ReadField<byte>(amr, 0xBC):X}");
ImGui.TextUnformatted($"Last used action sequence: {amr->LastUsedActionSequence}");
if (ImGui.Button("GT complete"))
{
Utils.WriteField(amr, 0xB8, (byte)1);
Expand All @@ -43,7 +49,7 @@ public unsafe void DrawActionData()
if (data != null)
{
ImGui.TextUnformatted($"Name: {data.Name}");
ImGui.TextUnformatted($"Cast time: {data.Cast100ms / 10.0:f1}");
ImGui.TextUnformatted($"Cast time: {data.Cast100ms * 0.1f:f1} + {data.Unknown38 * 0.1f:f1}");
ImGui.TextUnformatted($"Range: {data.Range}");
ImGui.TextUnformatted($"Effect range: {data.EffectRange}");
ImGui.TextUnformatted($"Cooldown group: {data.CooldownGroup}");
Expand Down Expand Up @@ -110,7 +116,7 @@ public unsafe void DrawActionData()
ImGui.TextUnformatted($"Recast group: {groupID}");
var group = mgr->GetRecastGroupDetail(groupID);
if (group != null)
ImGui.TextUnformatted($"Recast group details: active={group->IsActive}, action={group->ActionID}, elapsed={group->Elapsed:f3}, total={group->Total:f3}, cooldown={group->Total - group->Elapsed:f3}");
ImGui.TextUnformatted($"Recast group details: active={group->IsActive}, action={group->ActionId}, elapsed={group->Elapsed:f3}, total={group->Total:f3}, cooldown={group->Total - group->Elapsed:f3}");
}
}
else if (Service.GameGui.HoveredItem != 0)
Expand All @@ -130,7 +136,7 @@ public unsafe void DrawActionData()
ImGui.TextUnformatted($"Recast group: {groupID}");
var group = mgr->GetRecastGroupDetail(groupID);
if (group != null)
ImGui.TextUnformatted($"Recast group details: active={group->IsActive}, action={group->ActionID}, elapsed={group->Elapsed}, total={group->Total}");
ImGui.TextUnformatted($"Recast group details: active={group->IsActive}, action={group->ActionId}, elapsed={group->Elapsed}, total={group->Total}");
}
else
{
Expand Down
43 changes: 15 additions & 28 deletions BossMod/Debug/DebugAddon.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Dalamud.Hooking;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET;

Expand All @@ -10,8 +9,8 @@ public unsafe sealed class DebugAddon : IDisposable
delegate nint AddonReceiveEventDelegate(AtkEventListener* self, AtkEventType eventType, uint eventParam, AtkEvent* eventData, ulong* inputData);
delegate void* AgentReceiveEventDelegate(AgentInterface* self, void* eventData, AtkValue* values, int valueCount, ulong eventKind);

private readonly Dictionary<nint, Hook<AddonReceiveEventDelegate>> _rcvAddonHooks = [];
private readonly Dictionary<nint, Hook<AgentReceiveEventDelegate>> _rcvAgentHooks = [];
private readonly Dictionary<nint, HookAddress<AddonReceiveEventDelegate>> _rcvAddonHooks = [];
private readonly Dictionary<nint, HookAddress<AgentReceiveEventDelegate>> _rcvAgentHooks = [];
private readonly Dictionary<string, nint> _addonRcvs = [];
private readonly Dictionary<uint, nint> _agentRcvs = [];
private string _newHook = "";
Expand All @@ -34,26 +33,16 @@ public void Draw()
foreach (var (k, v) in _addonRcvs)
{
var hook = _rcvAddonHooks[v];
if (ImGui.Button($"{(hook.IsEnabled ? "Disable" : "Enable")} {k} ({v:X})"))
{
if (hook.IsEnabled)
hook.Disable();
else
hook.Enable();
}
if (ImGui.Button($"{(hook.Enabled ? "Disable" : "Enable")} {k} ({v:X})"))
hook.Enabled ^= true;
}

ImGui.TextUnformatted("Agents:");
foreach (var (k, v) in _agentRcvs)
{
var hook = _rcvAgentHooks[v];
if (ImGui.Button($"{(hook.IsEnabled ? "Disable" : "Enable")} {k} ({v:X})"))
{
if (hook.IsEnabled)
hook.Disable();
else
hook.Enable();
}
if (ImGui.Button($"{(hook.Enabled ? "Disable" : "Enable")} {k} ({v:X})"))
hook.Enabled ^= true;
}

ImGui.InputText("Addon name / agent id", ref _newHook, 256);
Expand All @@ -62,18 +51,17 @@ public void Draw()
ImGui.SameLine();
if (ImGui.Button("Hook addon!"))
{
var address = (nint)addon->AtkEventListener.vfunc[2];
var address = (nint)addon->VirtualTable->ReceiveEvent;
_addonRcvs[_newHook] = address;
if (!_rcvAddonHooks.ContainsKey(address))
{
var name = _newHook;
Hook<AddonReceiveEventDelegate> hook = null!;
_rcvAddonHooks[address] = hook = Service.Hook.HookFromAddress<AddonReceiveEventDelegate>(address, (self, eventType, eventParam, eventData, inputData) =>
HookAddress<AddonReceiveEventDelegate> hook = null!;
_rcvAddonHooks[address] = hook = new(address, (self, eventType, eventParam, eventData, inputData) =>
{
Service.Log($"RCV: listener={name} {(nint)self:X}, type={eventType}, param={eventParam}, input={inputData[0]:X16} {inputData[1]:X16} {inputData[2]:X16}");
return hook.Original(self, eventType, eventParam, eventData, inputData);
});
hook.Enable();
}
}
}
Expand All @@ -82,17 +70,16 @@ public void Draw()
ImGui.SameLine();
if (ImGui.Button("Hook agent!"))
{
var address = (nint)agent->VTable->ReceiveEvent;
var address = (nint)agent->VirtualTable->ReceiveEvent;
_agentRcvs[agentId] = address;
if (!_rcvAgentHooks.ContainsKey(address))
{
Hook<AgentReceiveEventDelegate> hook = null!;
_rcvAgentHooks[address] = hook = Service.Hook.HookFromAddress<AgentReceiveEventDelegate>(address, (self, eventData, values, valueCount, eventKind) =>
HookAddress<AgentReceiveEventDelegate> hook = null!;
_rcvAgentHooks[address] = hook = new(address, (self, eventData, values, valueCount, eventKind) =>
{
Service.Log($"RCV: listener={agentId} {(nint)self:X}, kind={eventKind}, values={AtkValuesString(values, valueCount)}");
return hook.Original(self, eventData, values, valueCount, eventKind);
});
hook.Enable();
}
}
}
Expand All @@ -115,8 +102,8 @@ private string AtkValuesString(AtkValue* values, int count)
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.String8 => $"string8",
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Vector => $"vector",
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.Texture => $"texture",
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.AllocatedString => $"astring",
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.AllocatedVector => $"avector",
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.ManagedString => $"astring",
FFXIVClientStructs.FFXIV.Component.GUI.ValueType.ManagedVector => $"avector",
_ => $"{values[i].Type} unknown"
};
}
Expand Down
Loading

0 comments on commit 7783016

Please sign in to comment.