Skip to content

Commit

Permalink
不要再改姓名版了
Browse files Browse the repository at this point in the history
  • Loading branch information
wozaiha committed Mar 27, 2024
2 parents 65db924 + 4bfbbe1 commit 90d08c8
Show file tree
Hide file tree
Showing 52 changed files with 43,246 additions and 48,386 deletions.
38 changes: 37 additions & 1 deletion .github/workflows/cexporter.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: CExporter Check

on:
pull_request:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- main
paths:
Expand All @@ -12,6 +16,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
Expand All @@ -20,6 +26,36 @@ jobs:
- name: Run CExporter
working-directory: ./ida
run: dotnet run --project CExporter/CExporter.csproj -c Release
- name: Check error txt file for content
id: check_error
run: |
if [ -s ./ida/errors.txt ]; then
echo "error=true" >> $GITHUB_OUTPUT
else
echo "error=false" >> $GITHUB_OUTPUT
fi
- name: Upload error txt to comment
if: steps.check_error.outputs.error == 'true'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const content = fs.readFileSync('./ida/errors.txt', 'utf8');
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: content
});
github.rest.issues.addLabels({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["requested changes"]
})
- name: Exit with error
if: steps.check_error.outputs.error == 'true'
run: exit 1
- name: Tar CExport
run: tar -czvf CExport.tar.gz ./ida/*.h
- uses: actions/upload-artifact@v4
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/pr-breaking-change-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Breaking Change Check

on:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- main
paths:
- 'FFXIVClientStructs/**/*.cs'

jobs:
build-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependencies for PR branch
run: dotnet restore
- name: Build PR branch
run: dotnet build FFXIVClientStructs/FFXIVClientStructs.csproj --output ida/cs
- uses: actions/upload-artifact@v4
with:
name: cs-pr
path: ida/cs/FFXIVClientStructs.dll
retention-days: 1

build-main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies for Main branch
run: dotnet restore
- name: Build Main branch
run: dotnet build FFXIVClientStructs/FFXIVClientStructs.csproj --output ida/cs
- uses: actions/upload-artifact@v4
with:
name: cs-main
path: ida/cs/FFXIVClientStructs.dll
retention-days: 1

check-breaking-changes:
runs-on: ubuntu-latest
needs: [build-pr, build-main]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cs-pr
path: ida/cs-pr
- uses: actions/download-artifact@v4
with:
name: cs-main
path: ida/cs-main
- name: Check for breaking changes
id: breaking_changes
run: |
dotnet tool install -g Microsoft.DotNet.ApiCompat.Tool
testout=$(apicompat -l ida/cs-main/FFXIVClientStructs.dll -r ida/cs-pr/FFXIVClientStructs.dll)
echo $testout
if [ "$testout" != "APICompat ran successfully without finding any breaking changes." ]; then
echo "Breaking changes detected"
echo "breaking=true" >> $GITHUB_OUTPUT
else
echo "No breaking changes detected"
echo "breaking=false" >> $GITHUB_OUTPUT
fi
- name: Add tag to PR
if: steps.breaking_changes.outputs.breaking == 'true'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["breaking change"]
})
30 changes: 30 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/CSBonusManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace FFXIVClientStructs.FFXIV.Client.Game;

[StructLayout(LayoutKind.Explicit, Size = 0x178)]
public unsafe partial struct CSBonusManager {
[StaticAddress("48 8B 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 63 D0", 3, true)]
public static partial CSBonusManager* Instance();

[FieldOffset(0x08)] public ushort State; // 1 = Pending, 2 = Underway, 3 = Finished

[FieldOffset(0x0C)] public uint BaseTime;
[FieldOffset(0x10)] public uint SeasonTarget;
[FieldOffset(0x14)] public byte IsOpenShop;
[FieldOffset(0x15)] public byte IsOpenMission;

[FieldOffset(0x18)] public uint SeedBase;

[FieldOffset(0x2C)] public fixed byte WBAchieveFlag[20];
[FieldOffset(0x40)] public fixed byte PMAchieveFlag[20];
[FieldOffset(0x54)] public fixed byte MMAchieveFlag[4];

[FieldOffset(0x7C)] public fixed byte WBReceiveFlag[20];
[FieldOffset(0x90)] public fixed byte PMReceiveFlag[20];
[FieldOffset(0xA4)] public fixed byte MMReceiveFlag[4];

[FieldOffset(0xBA)] public byte WBCount;

[FieldOffset(0xBC)] public byte PMCount;

[FieldOffset(0xBE)] public byte MMCount;
}
57 changes: 57 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/Event/CraftEventHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Component.Excel;

namespace FFXIVClientStructs.FFXIV.Client.Game.Event;

[Flags]
public enum CraftStateFlags : uint {
Unk1 = 1 << 0,
NotFirstStep = 1 << 1,
Unk2 = 1 << 4,
StandardTouchProc = 1 << 27,
AdvancedTouchProc = 1 << 28,
ObservedProc = 1 << 29,
NoMoreCarefulObservation = 1 << 30,
NoMoreHeartAndSoul = 1u << 31
}

[Flags]
public enum CraftFlags : uint {
ExecutingAction2 = 1 << 0,
Unk1 = 1 << 1,
NotTrialSynthesis = 1 << 2,
ExecutingAction1 = 1 << 3,
Unk2 = 1 << 4,
Unk3 = 1 << 5
}

public enum CraftCondition : byte {
Normal = 1,
Good,
Excellent,
Poor,

Centered,
Sturdy,
Pliant,
Malleable,
Primed,
GoodOmen,
}

[StructLayout(LayoutKind.Explicit, Size = 0x4C0)]
public unsafe struct CraftEventHandler {
[FieldOffset(0x0)] public EventHandler EventHandler;
[FieldOffset(0x210)] public fixed byte RecipeExcelRow[106];
[FieldOffset(0x320)] public Utf8String RecipeName;
[FieldOffset(0x388)] public fixed byte RecipeLevelTableExcelRow[20];
[FieldOffset(0x3F0)] public ExcelSheet* RecipeSheet1;
[FieldOffset(0x400)] public ExcelSheet* RecipeSheet2;
[FieldOffset(0x410)] public ExcelSheet* RecipeSheet3;
[FieldOffset(0x418)] public ExcelSheet* ItemSheet;
[FieldOffset(0x448)] public uint DataSource;
[FieldOffset(0x44C)] public CraftStateFlags StateFlags;
[FieldOffset(0x456)] public ushort StepNumber;
[FieldOffset(0x467)] public CraftCondition Condition;
[FieldOffset(0x468)] public CraftFlags CraftFlags;
}
3 changes: 3 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/Event/EventFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@ public unsafe partial struct EventFramework {

public InstanceContentOceanFishing* GetInstanceContentOceanFishing()
=> GetInstanceContentDirector<InstanceContentOceanFishing>(InstanceContentType.OceanFishing);

public CraftEventHandler* GetCraftEventHandler()
=> (CraftEventHandler*)GetEventHandlerById(0xA0001);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ namespace FFXIVClientStructs.FFXIV.Client.Game.Event;
// Client::Game::Event::ModuleBase
// ctor "E8 ?? ?? ?? ?? 48 8B 15 ?? ?? ?? ?? 49 8D 8D ?? ?? ?? ?? 48 81 C2 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8B 15"
[StructLayout(LayoutKind.Explicit, Size = 0xC0)]
public struct EventHandlerModule {
public unsafe struct EventHandlerModule {
[FieldOffset(0x00)] public ModuleBase ModuleBase;
[FieldOffset(0x40)] public StdMap<uint, Pointer<EventHandler>> EventHandlerMap;
[FieldOffset(0x50)] public StdMap<ushort, StdPair<nint, nint>> EventHandlerFactories;
[FieldOffset(0x60)] public CraftEventHandler* CraftEventHandler; // 0xA0001
[FieldOffset(0x68)] public EventHandler* CraftLeveEventHandler; // 0xE0000
[FieldOffset(0x70)] public EventHandler* FishingEventHandler; // 0x150001
[FieldOffset(0x78)] public EventHandler* ExitRangeEventHandler; // 0x140001
[FieldOffset(0x80)] public EventHandler* TripleTriadEventHandler; // 0x230001
[FieldOffset(0x88)] public EventHandler* GroupPoseEventHandler; // 0xB0129
[FieldOffset(0x90)] public EventHandler* IdleCameraEventHandler; // 0xB0130
}
10 changes: 10 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/Event/GoldSaucerDirector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FFXIVClientStructs.FFXIV.Client.Game.Event;

// Client::Game::Event::GoldSaucerDirector
// Client::Game::Event::Director
// Client::Game::Event::LuaEventHandler
// Client::Game::Event::EventHandler
[StructLayout(LayoutKind.Explicit, Size = 0x678)]
public unsafe struct GoldSaucerDirector {
[FieldOffset(0)] public Director Director;
}
48 changes: 48 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/GoldSaucer/GFateDirector.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using FFXIVClientStructs.FFXIV.Client.Game.Event;
using FFXIVClientStructs.FFXIV.Client.System.String;

namespace FFXIVClientStructs.FFXIV.Client.Game.GoldSaucer;

// Client::Game::GoldSaucer::GFateDirector
// Client::Game::Event::GoldSaucerDirector
// Client::Game::Event::Director
// Client::Game::Event::LuaEventHandler
// Client::Game::Event::EventHandler
[StructLayout(LayoutKind.Explicit, Size = 0x808)]
public unsafe partial struct GFateDirector {
[FieldOffset(0)] public GoldSaucerDirector GoldSaucerDirector;
[FieldOffset(0x678)] public Utf8String MapMarkerTooltipText;
[FieldOffset(0x6E0)] public uint MapMarkerLevelId;

[FieldOffset(0x6E8)] public uint MapMarkerIconId;

[FieldOffset(0x760)] public fixed uint ObjectIds[32]; // for what?
[FieldOffset(0x7E0)] public uint EndTimestamp;

[FieldOffset(0x7EC)] public ushort BgmId;

[FieldOffset(0x7F6)] public byte GateType;
[FieldOffset(0x7F7)] public byte GatePositionType;

[FieldOffset(0x7F0)] public ushort ScreenImageId1;
[FieldOffset(0x7F2)] public ushort ScreenImageId2;
[FieldOffset(0x7F4)] public ushort ScreenImageId3;

[FieldOffset(0x7FC)] public GFateDirectorFlag Flags;

[VirtualFunction(3)]
public partial bool IsRunningGate();

[VirtualFunction(294)]
public partial bool IsAcceptingGate();
}

[Flags]
public enum GFateDirectorFlag : uint {
IsJoined = 1 << 0,
IsFinished = 1 << 1,
Unk2 = 1 << 2,
Unk3 = 1 << 3,
Unk4 = 1 << 4,
Unk5 = 1 << 5,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using FFXIVClientStructs.FFXIV.Client.Game.GoldSaucer;

namespace FFXIVClientStructs.FFXIV.Client.Game;

[StructLayout(LayoutKind.Explicit, Size = 0x68)]
public unsafe partial struct GoldSaucerManager {
[StaticAddress("89 43 64 48 89 1D", 6, isPointer: true)]
public static partial GoldSaucerManager* Instance();

[FieldOffset(0x28)] public GFateDirector* CurrentGFateDirector;

[FieldOffset(0x50)] public uint WeeklyLotOffsetTime;

[FieldOffset(0x58)] public GoldSaucerFlag Flags;
}

[Flags]
public enum GoldSaucerFlag : byte {
Unk0 = 1 << 0,
ChocoboRaceTutorialClear = 1 << 1,
Unk2 = 1 << 2,
Unk3 = 1 << 3,
Unk4 = 1 << 4,
ChocoboRaceAllOpen = 1 << 5,
Unk6 = 1 << 6,
Unk7 = 1 << 7,
}
4 changes: 2 additions & 2 deletions FFXIVClientStructs/FFXIV/Client/Game/InventoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public unsafe partial struct InventoryItem : ICreatable {
/// <remarks> Only used if <see cref="IsSymbolic"/> is <c>true</c>. </remarks>
[FieldOffset(0x0A)] public ushort LinkedInventoryType;
[FieldOffset(0x0C)] public uint Quantity;
[FieldOffset(0x10)] public ushort Spiritbond;
[FieldOffset(0x10)] public ushort Spiritbond; // TODO: This field is also used for the collectability value. Not sure if it's the same data type. See also: GetSpiritbond()
[FieldOffset(0x12)] public ushort Condition;
[FieldOffset(0x14)] public ItemFlags Flags;
[FieldOffset(0x18)] public ulong CrafterContentID;
Expand Down Expand Up @@ -169,7 +169,7 @@ public enum ItemFlags : byte {
public partial byte GetStain();

/// <summary>Gets the glamour id from the original InventoryItem or itself if not symbolic.</summary>
[MemberFunction("E9 ?? ?? ?? ?? 8B 43 30")]
[MemberFunction("E8 ?? ?? ?? ?? 39 33 75")]
public partial uint GetGlamourId();

/// <summary>Gets the materia id from the specified slot of the original InventoryItem or itself if not symbolic.</summary>
Expand Down
10 changes: 10 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Graphics/JobSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FFXIVClientStructs.FFXIV.Client.Graphics;

// Client::Graphics::JobSystem<T>
[StructLayout(LayoutKind.Explicit, Size = 0xC0)]
public unsafe partial struct JobSystem {
[FieldOffset(0)] public void* Vtbl;

[FieldOffset(0x20)] public void* CallbackThisArg;
[FieldOffset(0x28)] public delegate* unmanaged<void*, void*, void> CallbackFunction;
}
3 changes: 3 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Graphics/Kernel/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public unsafe partial struct Device {
[StaticAddress("48 8B 0D ?? ?? ?? ?? 48 8D 54 24 ?? F3 0F 10 44 24", 3, isPointer: true)]
public static partial Device* Instance();

[MemberFunction("E8 ?? ?? ?? ?? 48 89 06 8B C3")]
public partial ConstantBuffer* CreateConstantBuffer(int byteSize, uint flags, uint unk);

[MemberFunction("E8 ?? ?? ?? ?? 8B 0F 48 8D 54 24")]
public partial Texture* CreateTexture2D(int* size, byte mipLevel, uint textureFormat, uint flags, uint unk);
}
Loading

0 comments on commit 90d08c8

Please sign in to comment.