Skip to content

Commit 638cd3e

Browse files
committed
7.2
2 parents c98f4a6 + 2f69c01 commit 638cd3e

File tree

83 files changed

+33675
-9426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+33675
-9426
lines changed

CExporter/Exporter.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ private static ProcessedField ProcessVirtualParameter(Type parameter, int i, Par
471471
if (!type.IsStruct() || type.IsEnum) return null;
472472
if (type.IsInStructList(_structs) || (overrideType?.IsInStructList(_structs) ?? false)) return null;
473473
var vtable = type.GetField("VirtualTable", ExporterStatics.BindingFlags)?.FieldType;
474+
var vtableSize = 0;
474475
ProcessedVirtualFunction[]? virtualFunctions = null;
475476
if (vtable != null) {
476477
vtable = vtable.GetElementType()!;
@@ -487,6 +488,7 @@ private static ProcessedField ProcessVirtualParameter(Type parameter, int i, Par
487488
VirtualFunctionParameters = f.FieldType.GetFunctionPointerParameterTypes().Select((p, i) => ProcessVirtualParameter(p, i, memberFunction?.Item2)).ToArray()
488489
};
489490
}).ToArray();
491+
vtableSize = vtable.StructLayoutAttribute?.Size ?? vtableSize;
490492
}
491493

492494
var memberFunctionClass = type.GetMember("MemberFunctionPointers", ExporterStatics.BindingFlags).FirstOrDefault()?.DeclaringType;
@@ -544,6 +546,7 @@ .. memberFunctionParameters.Select(ProcessParameter).ToArray()]
544546
StructNamespace = type.FullSanitizeName() + (attr.IsStruct ? $"{ExporterStatics.Separator}{attr.Union}" : ""),
545547
StructTypeName = type.FullSanitizeName() + $"{ExporterStatics.Separator}{attr.Union}{(attr.IsStruct ? $"{ExporterStatics.Separator}{attr.Struct}" : "")}",
546548
StructSize = 0,
549+
VirtualFunctionSize = 0,
547550
Fields = [
548551
ProcessField(unionField, unionStartField.GetFieldOffset())
549552
],
@@ -588,6 +591,7 @@ .. memberFunctionParameters.Select(ProcessParameter).ToArray()]
588591
StructNamespace = type.GetNamespace(),
589592
StructTypeName = overrideType ?? type.FullSanitizeName(),
590593
StructSize = type.SizeOf(),
594+
VirtualFunctionSize = vtableSize,
591595
Fields = ProcessFields(fields),
592596
VirtualFunctions = virtualFunctions,
593597
MemberFunctions = memberFunctionsArray,
@@ -686,6 +690,7 @@ public class ProcessedStruct {
686690
public required string StructNamespace;
687691
public required int StructSize;
688692
public required ProcessedField[] Fields;
693+
public required int VirtualFunctionSize;
689694
public ProcessedVirtualFunction[]? VirtualFunctions; // null if there are no virtual functions, empty if there's a vtable with unknown contents
690695
public required ProcessedMemberFunction[] MemberFunctions;
691696
public ProcessedMemberFunction[]? StaticMemberFunctions;
@@ -863,6 +868,10 @@ public void WriteYaml(IEmitter emitter, object? value, Type type) {
863868
ProcessedFieldConverter.Instance.WriteYaml(emitter, field, field.GetType());
864869
}
865870
emitter.Emit(new SequenceEnd());
871+
if (s.VirtualFunctionSize != 0) {
872+
emitter.Emit(new Scalar("vtable_size"));
873+
emitter.Emit(new Scalar(s.VirtualFunctionSize.ToString()));
874+
}
866875
if (s.VirtualFunctions != null) {
867876
emitter.Emit(new Scalar("virtual_functions"));
868877
emitter.Emit(new SequenceStart(null, null, true, SequenceStyle.Block));

FFXIVClientStructs/FFXIV/Client/Game/ActionManager.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ public unsafe partial struct ActionManager {
5959
[FieldOffset(0x124), FixedSizeArray] internal FixedSizeArray24<uint> _blueMageActions;
6060
[FieldOffset(0x184), FixedSizeArray] internal FixedSizeArray80<RecastDetail> _cooldowns;
6161

62+
// used for some actions that are only conditionally usable, corresponding timer is set to 5s and ticks down every frame when ActionEffect is received
63+
// 0 = unused (padding bytes?)
64+
// 1 = player's action is dodged by any character (including player, i.e. SGE Pepsis)
65+
// 2 = player blocks
66+
// 3 = player parries
67+
// 4 = player dodges
68+
[FieldOffset(0x7C4), FixedSizeArray] internal FixedSizeArray5<float> _procTimers;
69+
6270
[FieldOffset(0x7E8)] public float DistanceToTargetHitbox; // distance to target minus both self & target hitbox radius, clamped to 0
6371

6472
/// <summary>

FFXIVClientStructs/FFXIV/Client/Game/Event/EventFramework.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using FFXIVClientStructs.FFXIV.Client.Game.InstanceContent;
22
using FFXIVClientStructs.FFXIV.Client.Game.MassivePcContent;
33
using FFXIVClientStructs.FFXIV.Client.Game.Object;
4+
using FFXIVClientStructs.FFXIV.Client.Game.UI;
45
using FFXIVClientStructs.FFXIV.Common.Lua;
56

67
namespace FFXIVClientStructs.FFXIV.Client.Game.Event;
@@ -67,6 +68,9 @@ public void MaterializeItem(InventoryItem* itemSlot, MaterializeEntryId entryId)
6768
MaterializeItem(new EventId { ContentId = EventHandlerContent.Materialize, EntryId = (ushort)entryId }, itemSlot->Container, itemSlot->Slot, 0);
6869
}
6970

71+
[MemberFunction("E8 ?? ?? ?? ?? 4C 8B 46 ?? 49 BF")]
72+
public partial void GetEventMapMarkers(ushort territoryId, StdVector<MapMarkerData>* markerVector);
73+
7074
[MemberFunction("E8 ?? ?? ?? ?? 41 0F B7 4E ?? 3B C8")]
7175
public static partial uint GetCurrentContentId();
7276

@@ -79,6 +83,9 @@ public void MaterializeItem(InventoryItem* itemSlot, MaterializeEntryId entryId)
7983
[MemberFunction("48 83 EC 28 48 8B 05 ?? ?? ?? ?? 48 85 C0 74 2C")]
8084
public static partial bool CanLeaveCurrentContent();
8185

86+
[MemberFunction("E8 ?? ?? ?? ?? 48 8B 43 ?? 41 B2")]
87+
public static partial void LeaveCurrentContent(bool forced = false);
88+
8289
private T* GetInstanceContentDirector<T>(InstanceContentType instanceContentType) where T : unmanaged {
8390
var instanceDirector = GetInstanceContentDirector();
8491
if (instanceDirector == null || instanceDirector->InstanceContentType != instanceContentType)

FFXIVClientStructs/FFXIV/Client/Game/Fate/FateManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,10 @@ public unsafe partial struct FateManager {
3030

3131
[MemberFunction("40 53 48 83 EC ?? 48 8B 81 ?? ?? ?? ?? 49 8B D8")]
3232
public partial bool TryGetFatePosition(ushort fateId, Vector3* position);
33+
34+
[MemberFunction("40 53 48 83 EC ?? 48 8B 91 ?? ?? ?? ?? 48 8B D9 48 85 D2 0F 84 ?? ?? ?? ?? E8")]
35+
public partial FateContext* LevelSync();
36+
37+
[MemberFunction("48 83 EC ?? 0F B7 42 ?? 66 39 81")]
38+
public partial bool IsSyncedToFate(FateContext* fate);
3339
}

FFXIVClientStructs/FFXIV/Client/Game/InstanceContent/ContentDirector.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public unsafe partial struct ContentDirector {
1414

1515
[FieldOffset(0x580)] public DutyActionManager DutyActionManager;
1616

17+
[FieldOffset(0xCE8)] public MapEffectList* MapEffects;
18+
1719
[FieldOffset(0xCF0)] private DynamicEventContainer* DynamicEvents;
1820

1921
[FieldOffset(0xD48)] public float ContentTimeLeft;
@@ -24,4 +26,19 @@ public unsafe partial struct ContentDirector {
2426
/// <returns>Time in seconds</returns>
2527
[VirtualFunction(313)]
2628
public partial uint GetContentTimeMax();
29+
30+
[GenerateInterop]
31+
[StructLayout(LayoutKind.Explicit, Size = 0x608)]
32+
public partial struct MapEffectList {
33+
[FieldOffset(0x00), FixedSizeArray] internal FixedSizeArray128<MapEffectItem> _items;
34+
[FieldOffset(0x602)] public ushort ItemCount;
35+
[FieldOffset(0x604)] public byte Dirty;
36+
}
37+
38+
[StructLayout(LayoutKind.Explicit, Size = 0xC)]
39+
public struct MapEffectItem {
40+
[FieldOffset(0x00)] public uint LayoutId;
41+
[FieldOffset(0x08)] public ushort State;
42+
[FieldOffset(0x0A)] public byte Flags;
43+
}
2744
}

FFXIVClientStructs/FFXIV/Client/Game/InstanceContent/DynamicEventContainer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public unsafe partial struct DynamicEvent {
7272
[FieldOffset(0x154)] public byte MaxParticipants2;
7373
[FieldOffset(0x170)] public MapMarkerData MapMarker;
7474
[FieldOffset(0x1C0)] public DynamicEventContainer* EventContainer;
75+
76+
[MemberFunction("E8 ?? ?? ?? ?? 84 C0 74 ?? 44 0F B7 03")]
77+
public partial bool IsActive();
7578
}
7679

7780
public enum DynamicEventState : byte {

FFXIVClientStructs/FFXIV/Client/Game/InstanceContent/PublicContentOccultCrescent.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,22 @@ public unsafe partial struct PublicContentOccultCrescent {
4444
public static partial bool ChangeSupportJob(byte id);
4545
}
4646

47+
[GenerateInterop]
4748
[StructLayout(LayoutKind.Explicit, Size = 0x24)]
48-
public struct OccultCrescentMKDData {
49+
public partial struct OccultCrescentMKDData {
4950
[FieldOffset(0x00), CExporterExcelBegin("MKDData")] public uint QuestId;
5051
[FieldOffset(0x04)] public uint ZoneNameId; // Addon RowId
51-
[FieldOffset(0x08), FixedSizeArray] internal FixedSizeArray2<uint> _currencyItemIds;
52-
[FieldOffset(0x10)] public uint CipherItemId;
53-
[FieldOffset(0x14), FixedSizeArray] internal FixedSizeArray2<uint> _currencyNameIds; // Addon RowIds
54-
[FieldOffset(0x1C)] public int CipherNameId;
52+
[FieldOffset(0x08), FixedSizeArray] internal FixedSizeArray3<uint> _currencyItemIds;
53+
[FieldOffset(0x10), Obsolete("Use CurrencyItemIds[2] instead")] public uint CipherItemId;
54+
[FieldOffset(0x14), FixedSizeArray] internal FixedSizeArray3<uint> _currencyNameIds; // Addon RowIds
55+
[FieldOffset(0x1C), Obsolete("Use CurrencyNameIds[2] instead")] public int CipherNameId;
5556
[FieldOffset(0x20)] public byte Unknown8; // Minimum Knowledge Level?
5657
[FieldOffset(0x21), CExporterExcelEnd] public byte Unknown9;
5758
}
5859

60+
[GenerateInterop]
5961
[StructLayout(LayoutKind.Explicit, Size = 0x5A)] // unsure how long
60-
public struct OccultCrescentState {
62+
public partial struct OccultCrescentState {
6163
[FieldOffset(0x00), FixedSizeArray] internal FixedSizeArray13<uint> _supportJobExperience;
6264
[FieldOffset(0x34)] public uint CurrentKnowledge;
6365
[FieldOffset(0x38)] public uint NeededKnowledge;

FFXIVClientStructs/FFXIV/Client/Game/InventoryManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public unsafe partial struct InventoryManager {
112112
[MemberFunction("E8 ?? ?? ?? ?? 48 8B 4B ?? 40 88 71")]
113113
public partial void SetRetainerMarketPrice(short slot, uint price);
114114

115+
[MemberFunction("E8 ?? ?? ?? ?? 39 6B 38")]
116+
public partial void SetSlotUnblocked(InventoryType type, short slot);
117+
115118
/// <summary> Gets the number of (limited) tomestones the user has acquired during the current reset cycle. </summary>
116119
public int GetWeeklyAcquiredTomestoneCount() => GetLimitedTomestoneCount(GetSpecialItemId(9));
117120
}

FFXIVClientStructs/FFXIV/Client/Game/Object/Treasure.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@ namespace FFXIVClientStructs.FFXIV.Client.Game.Object;
55
[GenerateInterop]
66
[Inherits<GameObject>]
77
[StructLayout(LayoutKind.Explicit, Size = 0x200)]
8-
public unsafe partial struct Treasure;
8+
public unsafe partial struct Treasure {
9+
[FieldOffset(0x1EC)] public TreasureFlags Flags;
10+
11+
[Flags]
12+
public enum TreasureFlags : byte {
13+
None = 0,
14+
Opened = 1,
15+
FadedOut = 2
16+
}
17+
}

FFXIVClientStructs/FFXIV/Client/System/Input/SoftKeyboardDeviceInterface.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public unsafe partial struct SoftKeyboardDeviceInterface {
3131
public partial bool IsSoftKeyboardOpen();
3232

3333
// Client::System::Input::SoftKeyboardDeviceInterface::SoftKeyboardInputInterface
34-
[GenerateInterop]
34+
[GenerateInterop(true)]
3535
[StructLayout(LayoutKind.Explicit, Size = 0x8)]
3636
public unsafe partial struct SoftKeyboardInputInterface {
3737
// CAUTION: May be the concrete class' dtor!

0 commit comments

Comments
 (0)