Skip to content

Commit

Permalink
6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
wozaiha committed Feb 27, 2024
2 parents 4c22e76 + 722a2c5 commit c3c41a1
Show file tree
Hide file tree
Showing 449 changed files with 387,376 additions and 590,068 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Auto detect text files and perform LF normalization
* text eol=crlf
*.png binary

ida/ffxiv_client_structs*.h linguist-generated=true
11 changes: 9 additions & 2 deletions .github/workflows/cexporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
- name: Install dependencies
run: dotnet restore
- name: Run CExporter
working-directory: ./ida
run: dotnet run --project CExporter/CExporter.csproj -c Release
- name: Tar CExport
run: tar -czvf CExport.tar.gz ./ida/*.h
- uses: actions/upload-artifact@v4
with:
name: CExport
path: CExport.tar.gz
retention-days: 7
4 changes: 2 additions & 2 deletions .github/workflows/format-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'aers'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Restore
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/struct-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'aers'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup .NET
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Restore
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,5 @@ MigrationBackup/
.idea/

# VSCode
.vscode/
.vscode/
ida/errors.txt
53 changes: 52 additions & 1 deletion 6.5_diff.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
These are all the diffs from a593cb163e1c5d33b27d34df4d1ccc57d1e67643,
As of commit 962b51df12735fb7316b7b7541f3c6827e7e5a07:
As of commit c204e734d18febb0a4eeb85752bbde5811ccdb03:

Component/GUI/AtkUldManager.cs:
- Added CreateAtkResNode
- Added CreateAtkImageNode
- Added CreateAtkTextNode
- Added CreateAtkNineGridNode
- Added CreateAtkCounterNode
- Added CreateAtkCollisionNode

Client/Game/ActionManager.cs:
- Changed UseAction to take a ulong instead of long for targetID
- Changed UseActionLocation to take a ulong instead of long for targetID
- Changed GetActionStatus to take a ulong instead of long for targetID
- Updated ActionType enum

Client/Game/ActionTimelineManager.cs
- Added Parent character pointer
- Added GetHeightAdjustActionTimelineRowId

Client/UI/AddonTeleport.cs:
- Removed ChangeTab

Client/Game/Character/Character.cs:
- Changed ActionRecipientsObjectIdArray to be ulong instead of long
- Added EmoteController
- Added CalculateHeight
- Added VfxContainer
- Fixed internal structure to match 6.5 with addition of CharacterSetup

Client/Game/Character/DrawDataContainer.cs:
- Changed draw data to DrawObjectData structs to FixedArray
- Added function Weapon

Client/Game/Character/CharacterManager.cs:
- Changed LookupBattleCharaByObjectId to take a uint instead of int
Expand Down Expand Up @@ -81,6 +99,9 @@ Client/UI/AddonSalvageItemSelector.cs:
Client/UI/Agent/AgentContext.cs:
- Changed ContextMenu.EventParams to be a fixed array

Client/Game/MirageManager.cs:
- Added RestorePrismBoxItem

Client/UI/Agent/AgentFriendList.cs:
- Added SelectedPlayerName, SelectedContentId and SelectedIndex fields

Expand Down Expand Up @@ -121,6 +142,9 @@ Client/UI/Info/InfoProxyItemSearch.cs:
- Added RetainerListingsCount
- Added PlayerRetainers

Client/Graphics/Kernel/ShaderPackage.cs:
- Added Size

Client/UI/Misc/CharaViewPortrait.cs:
- Changed DirectionalLightingVerticalAngle and DirectionalLightingHorizontalAngle to be signed

Expand Down Expand Up @@ -160,10 +184,28 @@ Client/UI/Misc/RaptureHotbarModule.cs:
- Changed UNK_0xCA to CostType
- Changed UNK_0xCB to CostDisplayMode
- Changed UNK_0xD0 to CostValue
- Updated HotbarSlotType enum values

Client/UI/Info/InfoModule.cs:
- Updated InfoProxyId enum

Client/UI/Agent/AgentMap.cs:
- Added MinimapMSQLinkedTooltipMarkers
- Added MinimapMSQLinkedTooltipMarkersList
- Added MapQuestLinkContainer
- Added MiniMapQuestLinkContainer

Client/UI/Agent/AgentFieldMarker.cs:
- Removed WaymarkIndex enum

Client/UI/AddonFieldMarker.cs:
- Changed WaymarkInfo to FieldMarkerInfo

Client/Game/UI/UIState.cs:
- Corrected ChocoboTaxiStandsBitmask size
- Added CutsceneSeenBitmask
- Added IsCutsceneSeen

Component/GUI/AtkComponentDragDrop.cs:
- Added AtkDragDropInterface field

Expand All @@ -184,6 +226,8 @@ Component/GUI/AtkModule.cs:

Component/GUI/AtkStage.cs:
- Added AtkTextureResourceManager field
- Changed AtkEventDispatcher to FixedSizeArray
- Added NextEventDispatcherIndex

Component/GUI/AtkTextureResource.cs:
- Changed Count_1 to Count
Expand All @@ -201,6 +245,9 @@ Component/GUI/AtkUnitList.cs:
STD/Pair.cs:
- Added Deconstruct method to StdPair

Moved:
- Client/Game/Character/Data/CharacterData.cs to Client/Game/Character/CharacterData.cs

New Files Added:
- Component/GUI/AtkDragDropInterface.cs
- Component/GUI/AtkTextureResourceManager.cs
Expand All @@ -215,6 +262,10 @@ New Files Added:
- Application/Network/WorkDefinitions/EnterContentInfo.cs
- Client/Game/Control/EmoteController.cs
- Client/Game/Conditions.cs
- Component/GUI/AtkEventDispatcher.cs
- Client/UI/Agent/AgentBlacklist.cs
- Client/Game/Character/CharacterSetup.cs
- Client/UI/Misc/InputTimerModule.cs

Changed All Agents to use the new AgentGettersGenerator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,19 @@ public static Validation<DiagnosticInfo, FixedStringInfo> GetFromRoslyn(IFieldSy
}

public void RenderFixedString(IndentedStringBuilder builder) {
builder.AppendLine($"public string {PropertyName} {{ get {{ fixed (byte* p = {FieldName}) {{ var str = Encoding.UTF8.GetString(p, {MaxLength}); var nullIdx = str.IndexOf('\0'); return nullIdx >= 0 ? str[..nullIdx] : str; }} }} }}");
builder.AppendLine($"public string {PropertyName} {{");
using (builder.Indent()) {
builder.AppendLine($"get {{ fixed (byte* ptr = {FieldName}) {{ var str = Encoding.UTF8.GetString(ptr, 0x{MaxLength:X}); var nullIdx = str.IndexOf('\\0'); return nullIdx >= 0 ? str[..nullIdx] : str; }} }}");
builder.AppendLine($"set {{ fixed (byte* ptr = {FieldName}) {{ var bytes = Encoding.UTF8.GetBytes(value ?? string.Empty); var lastBytePos = Math.Min(bytes.Length, 0x{MaxLength:X} - 1); Marshal.Copy(bytes, 0, (nint)ptr, lastBytePos); ptr[lastBytePos] = 0; }} }}");
}
builder.AppendLine("}");
}
}

private sealed record StructWithFixedStringInfos(StructInfo StructInfo, Seq<FixedStringInfo> FixedStringInfos) {
public string RenderSource() {
IndentedStringBuilder builder = new();

builder.AppendLine("using System.Runtime.CompilerServices;");
builder.AppendLine("using System.Text;");

StructInfo.RenderStart(builder);
Expand Down
16 changes: 13 additions & 3 deletions FFXIVClientStructs.ResolverTester/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@
var totalSigCount = Resolver.GetInstance.Addresses.Count;
Console.WriteLine($"Unresolved count: {totalSigCount}");

Resolver.GetInstance.SetupSearchSpace(new IntPtr(bytes), relocFile.Length, textHeader.VirtualAddress,
textHeader.VirtualSize, dataHeader.VirtualAddress, dataHeader.VirtualSize,
rdataHeader.VirtualAddress, rdataHeader.VirtualSize);
Resolver.GetInstance.SetupSearchSpace(new IntPtr(bytes),
relocFile.Length,
textHeader.VirtualAddress,
textHeader.VirtualSize,
dataHeader.VirtualAddress,
dataHeader.VirtualSize,
rdataHeader.VirtualAddress,
rdataHeader.VirtualSize);

var watch = new Stopwatch();
watch.Start();
Expand All @@ -33,6 +38,11 @@
var resolvedCount = Resolver.GetInstance.Addresses.Count(sig => sig.Value != 0);
Console.WriteLine($"Resolved count: {resolvedCount} ({((float)resolvedCount / totalSigCount) * 100}%)");

Console.WriteLine("\n=== Broken Signatures ===");
var unresolvedSigs = Resolver.GetInstance.Addresses.Where(sig => sig.Value == 0);
foreach (var sig in unresolvedSigs)
Console.WriteLine($"[FAIL] {sig.Name}: {sig.String}");

Console.WriteLine("\n=== Static Addresses ===");
foreach (var address in Resolver.GetInstance.Addresses.Where(address => address is StaticAddress))
Console.WriteLine($"{address.Name} - {address.String} - {address.Value - new UIntPtr(bytes):X16}");
Expand Down
4 changes: 4 additions & 0 deletions FFXIVClientStructs.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForBuiltInTypes/@EntryValue">UseVar</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForOtherTypes/@EntryValue">UseVar</s:String>
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForSimpleTypes/@EntryValue">UseVar</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=FFXIV/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
1 change: 1 addition & 0 deletions FFXIVClientStructs/AssemblyAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[assembly: AssemblyCompany("FFXIVClientStructs")]
[assembly: AssemblyProduct("FFXIVClientStructs")]
[assembly: AssemblyTitle("FFXIVClientStructs")]
[assembly: InternalsVisibleTo("CExporter")]

#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
Expand Down
6 changes: 6 additions & 0 deletions FFXIVClientStructs/Attributes/CExportIgnore.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace FFXIVClientStructs.Attributes;

[AttributeUsage(AttributeTargets.Field)]
internal class CExportIgnoreAttribute : Attribute {

}
2 changes: 1 addition & 1 deletion FFXIVClientStructs/Attributes/FixedArrayAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace FFXIVClientStructs.Attributes;


/// <summary>
/// Describes a Fixed Buffer to assist with automatic parsing.
/// </summary>
[AttributeUsage(AttributeTargets.Field)]
[Obsolete("Use FFXIVClientStructs.Interop.Attributes.FixedSizeArrayAttribute instead")]
public class FixedArrayAttribute : Attribute {
public FixedArrayAttribute(Type type, int count) {
Type = type;
Expand Down
12 changes: 0 additions & 12 deletions FFXIVClientStructs/CExportIgnore.cs

This file was deleted.

54 changes: 36 additions & 18 deletions FFXIVClientStructs/FFXIV/Client/Game/ActionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

namespace FFXIVClientStructs.FFXIV.Client.Game;

// Client::Game::ActionManager
[StructLayout(LayoutKind.Explicit, Size = 0x7F0)]
public unsafe partial struct ActionManager {
[FieldOffset(0x60)] public ComboDetail Combo;
[StaticAddress("48 8D 0D ?? ?? ?? ?? F3 0F 10 13", 3)]
public static partial ActionManager* Instance();

[FieldOffset(0x60)] public ComboDetail Combo;
[FieldOffset(0x68)] public bool ActionQueued;
[FieldOffset(0x6C)] public ActionType QueuedActionType;
[FieldOffset(0x70)] public uint QueuedActionId;
Expand All @@ -15,9 +18,6 @@ public unsafe partial struct ActionManager {

[FieldOffset(0x13C)] public fixed uint BlueMageActions[24];

[StaticAddress("48 8D 0D ?? ?? ?? ?? F3 0F 10 13", 3)]
public static partial ActionManager* Instance();

[MemberFunction("E8 ?? ?? ?? ?? EB 64 B1 01")]
public partial bool UseAction(ActionType actionType, uint actionID, ulong targetID = 0xE000_0000, uint a4 = 0, uint a5 = 0, uint a6 = 0, void* a7 = null);

Expand Down Expand Up @@ -69,7 +69,7 @@ public unsafe partial struct ActionManager {
[MemberFunction("40 53 48 83 EC ?? 48 63 DA 85 D2")]
public partial RecastDetail* GetRecastGroupDetail(int recastGroup);

[MemberFunction("E8 ?? ?? ?? ?? 85 C0 75 ?? 83 FF ?? 0F 85")]
[MemberFunction("E8 ?? ?? ?? ?? 85 C0 75 94")]
public partial uint CheckActionResources(ActionType actionType, uint actionId, void* actionData = null);

/// <summary>
Expand All @@ -93,9 +93,18 @@ public unsafe partial struct ActionManager {
/// <param name="actionType">The type of action to check.</param>
/// <param name="actionId">The ID of the action to check.</param>
/// <returns>Returns true if the action is off-cooldown or slidecastable.</returns>
[MemberFunction("77 49 80 3B 00")]
[MemberFunction("E8 ?? ?? ?? ?? 84 C0 0F 84 ?? ?? ?? ?? F6 05 ?? ?? ?? ?? ?? 74 2C")]
public partial bool IsActionOffCooldown(ActionType actionType, uint actionId);

/// <summary>
/// Check if the specified action's target is within range, if any. Will not check line of sight (performance reasons?).
/// </summary>
/// <param name="actionType">The action type to check against.</param>
/// <param name="actionId">The action ID to check against.</param>
/// <returns>Returns true if target constraints are satisfied, false otherwise.</returns>
[MemberFunction("E8 ?? ?? ?? ?? 88 47 40 EB 36")]
public partial bool IsActionTargetInRange(ActionType actionType, uint actionId);

[MemberFunction("E8 ?? ?? ?? ?? F3 0F 11 43 ?? 80 3B 00")]
public static partial float GetActionRange(uint actionId);

Expand Down Expand Up @@ -135,6 +144,15 @@ public unsafe partial struct ActionManager {
[MemberFunction("40 53 55 57 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 33 DB")]
public partial bool SetBlueMageActions(uint* actionArray);

/// <summary>
/// Check whether this action should be highlighted (showing "ants") in the UI or not.
/// </summary>
/// <param name="actionType">The action type to check.</param>
/// <param name="actionId">The action ID to check.</param>
/// <returns>Returns true if ants should be drawn, false otherwise.</returns>
[MemberFunction("E8 ?? ?? ?? ?? 48 8B CB 88 47 41")]
public partial bool IsActionHighlighted(ActionType actionType, uint actionId);

[MemberFunction("48 89 5C 24 ?? 57 48 83 EC 20 48 8B DA 8B F9 E8 ?? ?? ?? ?? 4C 8B C3")]
public static partial bool CanUseActionOnTarget(uint actionId, GameObject* target);

Expand Down Expand Up @@ -207,24 +225,24 @@ public struct ComboDetail {

public enum ActionType : byte {
None = 0x00,
Spell = 0x01,
Action = 0x01, // Spell, Weaponskill, Ability. Confusing name, I know.
Item = 0x02,
KeyItem = 0x03,
Ability = 0x04,
General = 0x05,
Companion = 0x06,
Unk_7 = 0x07,
Unk_8 = 0x08, //something with Leve?
Ability = 0x04, // Not in UseAction (??)
GeneralAction = 0x05,
BuddyAction = 0x06,
MainCommand = 0x07,
Companion = 0x08,
CraftAction = 0x09,
MainCommand = 0x0A,
Unk_10 = 0x0A, // Fishing per Sapphire? Something to do with items.
PetAction = 0x0B,
Unk_12 = 0x0C,
Unk_12 = 0x0C, // Not in UseAction. Sapphire says CompanyAction, but not actually triggered.
Mount = 0x0D,
PvPAction = 0x0E,
Waymark = 0x0F,
FieldMarker = 0x0F,
ChocoboRaceAbility = 0x10,
ChocoboRaceItem = 0x11,
Unk_18 = 0x12,
SquadronAction = 0x13,
Accessory = 0x14
Unk_18 = 0x12, // Not in UseAction (?)
BgcArmyAction = 0x13,
Ornament = 0x14,
}
Loading

0 comments on commit c3c41a1

Please sign in to comment.