Skip to content

Commit

Permalink
6.58
Browse files Browse the repository at this point in the history
  • Loading branch information
wozaiha committed May 28, 2024
2 parents cc350f1 + 29dfda5 commit 400f8dd
Show file tree
Hide file tree
Showing 130 changed files with 28,183 additions and 7,617 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/pr-breaking-change-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,30 @@ jobs:
echo "No breaking changes detected"
echo "breaking=false" >> $GITHUB_OUTPUT
fi
- name: Add tag to PR
if: steps.breaking_changes.outputs.breaking == 'true'
- name: Handle breaking change label
uses: actions/github-script@v7
env:
IS_BREAKING: ${{ steps.breaking_changes.outputs.breaking }}
with:
script: |
github.rest.issues.addLabels({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["breaking change"]
})
if (process.env.IS_BREAKING == "true") {
github.rest.issues.addLabels({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["breaking change"]
})
}
else {
try {
await github.rest.issues.removeLabel({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: "breaking change"
})
console.log(`Breaking change label removed successfully.`);
} catch (error) {
console.log(`Breaking change label was not found on the issue.`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public string RenderSource() {
StructInfo.RenderStart(builder);

builder.AppendLine();
builder.AppendLine($"public static {StructInfo.Name}* Instance() => ({StructInfo.Name}*)AgentModule.Instance()->GetAgentByInternalID({AgentInfo.AgentId});");
builder.AppendLine($"public static {StructInfo.Name}* Instance() => ({StructInfo.Name}*)AgentModule.Instance()->GetAgentByInternalId((AgentId){AgentInfo.AgentId});");
builder.AppendLine();

StructInfo.RenderEnd(builder);
Expand All @@ -114,7 +114,7 @@ public string GetFileName() {
}

public void RenderAgentGetter(IndentedStringBuilder builder) {
builder.AppendLine($"public {StructInfo.Name}* Get{StructInfo.Name}() => ({StructInfo.Name}*)GetAgentByInternalID({AgentInfo.AgentId});");
builder.AppendLine($"public {StructInfo.Name}* Get{StructInfo.Name}() => ({StructInfo.Name}*)GetAgentByInternalId((AgentId){AgentInfo.AgentId});");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public string RenderSource() {
StructInfo.RenderStart(builder);

builder.AppendLine();
builder.AppendLine($"public static {StructInfo.Name}* Instance() => ({StructInfo.Name}*)InfoModule.Instance()->GetInfoProxyById((uint){InfoProxyInfo.InfoProxyId});");
builder.AppendLine($"public static {StructInfo.Name}* Instance() => ({StructInfo.Name}*)InfoModule.Instance()->GetInfoProxyById((InfoProxyId){InfoProxyInfo.InfoProxyId});");
builder.AppendLine();

StructInfo.RenderEnd(builder);
Expand All @@ -113,7 +113,7 @@ public string GetFileName() {
}

public void RenderInfoProxyGetter(IndentedStringBuilder builder) {
builder.AppendLine($"public {StructInfo.Name}* Get{StructInfo.Name}() => ({StructInfo.Name}*)GetInfoProxyById((uint){InfoProxyInfo.InfoProxyId});");
builder.AppendLine($"public {StructInfo.Name}* Get{StructInfo.Name}() => ({StructInfo.Name}*)GetInfoProxyById((InfoProxyId){InfoProxyInfo.InfoProxyId});");
}
}
}
2 changes: 1 addition & 1 deletion FFXIVClientStructs/FFXIV/Client/Game/CSBonusManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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(0x08)] public ushort State; // 1 = Pending, 2 = Underway, 3 = Finished, 4 = Part 2 Underway, 5 = Part 2 Finished

[FieldOffset(0x0C)] public uint BaseTime;
[FieldOffset(0x10)] public uint SeasonTarget;
Expand Down
8 changes: 8 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/Event/Director.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ public unsafe partial struct Director {
[FieldOffset(0x33C)] public byte ContentFlags; // 1 = Tourism (Explorer Mode)
[FieldOffset(0x340)] public byte Sequence;
[FieldOffset(0x342)] public fixed byte UnionData[10]; // I8A-I8J, UI8A-UI8J, Branch etc.
[FieldOffset(0x350)] public Utf8String Title;
[Obsolete("Renamed to Title")]
[FieldOffset(0x350)] public Utf8String String0;
[FieldOffset(0x3B8)] public Utf8String Description;
[Obsolete("Renamed to Description")]
[FieldOffset(0x3B8)] public Utf8String String1;
[FieldOffset(0x420)] public Utf8String ReliefText;
[Obsolete("Renamed to ReliefText")]
[FieldOffset(0x420)] public Utf8String String2;
[FieldOffset(0x498)] public StdVector<EventHandlerObjective> Objectives; // 10 objectives max
[FieldOffset(0x4B0)] public uint EventItemId;

[VirtualFunction(267)]
public partial void PopulateMapMarkers(ushort territoryTypeId, StdVector<MapMarkerData>* markerVector);
Expand Down
63 changes: 62 additions & 1 deletion FFXIVClientStructs/FFXIV/Client/Game/Event/EventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,38 @@ namespace FFXIVClientStructs.FFXIV.Client.Game.Event;
// Client::Game::Event::EventHandler
// ctor "E8 ?? ?? ?? ?? 45 33 D2 48 8D 05"
[StructLayout(LayoutKind.Explicit, Size = 0x210)]
public unsafe struct EventHandler {
public unsafe partial struct EventHandler {
[FieldOffset(0x08)] public StdSet<Pointer<GameObject>> EventObjects;
[FieldOffset(0x18)] public EventSceneModuleUsualImpl* EventSceneModule;
[FieldOffset(0x20)] public EventHandlerInfo Info;
[FieldOffset(0x5C)] public uint IconId;

[FieldOffset(0xC8)] public Utf8String UnkString0;
[FieldOffset(0x168)] public Utf8String UnkString1;

[VirtualFunction(197)]
public partial void GetTitle(Utf8String* outTitle);

[VirtualFunction(249)]
public partial void GetDescription(Utf8String* outDescription);

[VirtualFunction(250)]
public partial void GetReliefText(Utf8String* outReliefText);

[VirtualFunction(251)]
public partial int GetTimeRemaining(int currentTimestamp);

[VirtualFunction(252)]
public partial bool HasTimer();

[VirtualFunction(254)]
public partial uint GetEventItemId();

[VirtualFunction(256)]
public partial StdVector<EventHandlerObjective>* GetObjectives();

[VirtualFunction(259)]
public partial int GetRecommendedLevel();
}

[StructLayout(LayoutKind.Explicit, Size = 0x38)]
Expand All @@ -21,6 +46,18 @@ public struct EventHandlerInfo {
[FieldOffset(0x04)] public byte Flags;
}

[StructLayout(LayoutKind.Explicit, Size = 0x160)]
public struct EventHandlerObjective {
[FieldOffset(0x00)] public bool Enabled;
[FieldOffset(0x04)] public int DisplayType;
[FieldOffset(0x08)] public Utf8String Label;

[FieldOffset(0x78)] public int CountCurrent;
[FieldOffset(0x7C)] public int CountNeeded;
[FieldOffset(0x80)] public ulong TimeLeft;
[FieldOffset(0x88)] public uint MapRowId;
}

[StructLayout(LayoutKind.Explicit, Size = 0x04)]
public struct EventId {
[FieldOffset(0x00), CExportIgnore] public uint Id;
Expand All @@ -42,6 +79,8 @@ public enum EventHandlerType : ushort {
CustomTalk = 0x000B,
CompanyLeveOfficer = 0x000C,
Array = 0x000D,
CraftLeveClient = 0x000E,
[Obsolete("Use CraftLeveClient")]
CraftLeve = 0x000E,
GimmickAccessor = 0x000F,
GimmickBill = 0x0010,
Expand All @@ -56,6 +95,8 @@ public enum EventHandlerType : ushort {
ContentNpc = 0x0019,
Story = 0x001A,
SpecialShop = 0x001B,
DeepDungeon = 0x001C,
[Obsolete("Use DeepDungeon")]
ContentTalk = 0x001C,
InstanceContentGuide = 0x001D,
HousingAethernet = 0x001E,
Expand All @@ -65,8 +106,28 @@ public enum EventHandlerType : ushort {
DailyQuestSupply = 0x0022,
TripleTriad = 0x0023,
GoldSaucerArcadeMachine = 0x0024,
LotteryDaily = 0x0025, // Mini Cactpot
LotteryWeekly = 0x0026, // Jumbo Cactpot
RaceChocoboRegistrar = 0x0027,

GoldSaucerTalk = 0x0029, // Q'nabyano (responding with GoldSaucerTalk#162) and Reymanaud (responding with GoldSaucerTalk#161) use this
FreeCompanyCreditShop = 0x002A,
AetherCurrent = 0x002B,
ContentEntry = 0x002C,
Verminion = 0x002D, // Verminion Tables and Tournament Recordkeeper
SkyIslandEntrance = 0x002E,
DpsChallengeOfficer = 0x002F, // Stone, Sky, Sea
BeginnerTrainingOfficer = 0x0030,
RetainerBuyback = 0x0031,
TopicSelect = 0x0032,
LotteryExchangeShop = 0x0034,
DisposalShop = 0x0035,
PreHandler = 0x0036, // checks quest completion before handling something, for example opening the Scrip Exchange
TripleTriadCompetition = 0x0037,
Salvage = 0x0039, // Desynthesis (0x390000), Materia Extraction (0x390001), Aetherial Reduction (0x390002)
InclusionShop = 0x003A,
CollectablesShop = 0x003B,
EventPathMove = 0x003D, // Argos in Mare Lamentorum uses this

BattleLeveDirector = 0x8001,
GatheringLeveDirector = 0x8002,
Expand Down
18 changes: 18 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/Event/QuestEventHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using FFXIVClientStructs.FFXIV.Client.Game.Character;
using FFXIVClientStructs.FFXIV.Client.System.String;

namespace FFXIVClientStructs.FFXIV.Client.Game.Event;

[StructLayout(LayoutKind.Explicit, Size = 0x610)]
public unsafe partial struct QuestEventHandler {
[FieldOffset(0x00)] public LuaEventHandler LuaEventHandler;
[FieldOffset(0x338)] public ushort QuestId;

[FieldOffset(0x340)] public Utf8String Title;

[MemberFunction("4C 8B DC 55 57 41 54 41 55 48 81 EC")]
public readonly partial void GetTodoArgs(BattleChara* localPlayer, byte idx, uint* arg0, uint* arg1, uint* arg2);

[MemberFunction("E8 ?? ?? ?? ?? 41 88 07 45 33 D2")]
public readonly partial bool IsTodoChecked(BattleChara* localPlayer, byte idx);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace FFXIVClientStructs.FFXIV.Client.Game.InstanceContent;
public partial struct ContentDirector {
[FieldOffset(0x00)] public Director Director;

[FieldOffset(0x536)] public byte ContentTypeRowId;

[FieldOffset(0xC08)] public float ContentTimeLeft;

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/Object/GameObject.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using FFXIVClientStructs.FFXIV.Client.Game.Event;
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
using FFXIVClientStructs.FFXIV.Common.Math;
using EventHandler = FFXIVClientStructs.FFXIV.Client.Game.Event.EventHandler;

namespace FFXIVClientStructs.FFXIV.Client.Game.Object;

Expand Down Expand Up @@ -40,6 +41,7 @@ public unsafe partial struct GameObject {
[FieldOffset(0x110)] public uint NamePlateIconId;
[FieldOffset(0x114)] public int RenderFlags;
[FieldOffset(0x158)] public LuaActor* LuaActor;
[FieldOffset(0x160)] public EventHandler* EventHandler;

[VirtualFunction(1)]
public partial GameObjectID GetObjectID();
Expand Down
14 changes: 14 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/UI/DirectorTodo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using FFXIVClientStructs.FFXIV.Client.Game.Event;
using FFXIVClientStructs.FFXIV.Client.System.String;

namespace FFXIVClientStructs.FFXIV.Client.Game.UI;

[StructLayout(LayoutKind.Explicit, Size = 0x148)]
public unsafe struct DirectorTodo {
[FieldOffset(0x00)] public Director* Director;
[FieldOffset(0x08)] public Utf8String Title;
[FieldOffset(0x70)] public Utf8String Description;
[FieldOffset(0xD8)] public Utf8String ReliefText;
[FieldOffset(0x140)] public bool IsFullUpdatePending;
[FieldOffset(0x141)] public bool IsShown;
}
2 changes: 1 addition & 1 deletion FFXIVClientStructs/FFXIV/Client/Game/UI/PlayerState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public unsafe partial struct PlayerState {
// Size: (OrnamentSheet.RowCount + 7) >> 3
/// <remarks> Use <see cref="IsOrnamentUnlocked"/> </remarks>
[FieldOffset(0x300)] public fixed byte UnlockedOrnamentsBitmask[(41 + 7) >> 3];
[FieldOffset(0x306)] public byte NumOwnedMounts;
[FieldOffset(0x306)] public byte NumOwnedMounts; // TODO: change to ushort (see "E9 ?? ?? ?? ?? 8B CA 83 E2 07"+0x3E3)

// Ref: "48 8D 0D ?? ?? ?? ?? 41 0F B6 0C 08 41 B0 01 84 D1 0F 95 C1 24 01 02 C0 0A C8 41 0F B6 C4"
// Size: (FishParameterSheet.Count(row => row.IsInLog) + 7) >> 3
Expand Down
2 changes: 2 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/UI/Telepo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public struct TeleportInfo {
[FieldOffset(0x1B)] public byte IsFavourite;

public bool IsSharedHouse => Ward > 0 && Plot > 0;
public bool IsApartment => SubIndex == 128 && !IsSharedHouse;
[Obsolete("Renamed to IsApartment")]
public bool IsAppartment => SubIndex == 128 && !IsSharedHouse;
}

Expand Down
7 changes: 5 additions & 2 deletions FFXIVClientStructs/FFXIV/Client/Game/UI/UIState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public unsafe partial struct UIState {
[FieldOffset(0x15D8)] public Achievement Achievement;
[FieldOffset(0x1B30)] public Buddy Buddy;
[FieldOffset(0x36B4)] public PvPProfile PvPProfile;
[FieldOffset(0x3730)] internal void* Unk3730; // some UI timer for PvP Results?!
[FieldOffset(0x3738)] public ContentsNote ContentsNote;
[FieldOffset(0x37F0)] public RelicNote RelicNote;
[FieldOffset(0x3808)] public TradeMultiple TradeMultiple;
Expand All @@ -39,10 +40,12 @@ public unsafe partial struct UIState {
[FieldOffset(0x9F78)] public QuestUI QuestUI;
[FieldOffset(0xAF48)] public QuestTodoList QuestTodoList;
[FieldOffset(0xB238)] public NpcTrade NpcTrade;
[FieldOffset(0xB560)] public DirectorTodo DirectorTodo;
[Obsolete("Use DirectorTodo.Director")]
[FieldOffset(0xB560)] public Director* ActiveDirector;

[FieldOffset(0xB6A8)] public DirectorTodo FateDirectorTodo;
[Obsolete("Use FateDirectorTodo.Director and cast Director to FateDirector*")]
[FieldOffset(0xB6A8)] public FateDirector* FateDirector;

[FieldOffset(0xB7F0)] public Map Map;
[FieldOffset(0xF7F0)] public MarkingController MarkingController;
[FieldOffset(0xFAD0)] public LimitBreakController LimitBreakController;
Expand Down
70 changes: 70 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/WeatherManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
namespace FFXIVClientStructs.FFXIV.Client.Game;

// Client::Game::WeatherManager
/// <remarks>
/// The weather changes every 8 hours.
/// </remarks>
[StructLayout(LayoutKind.Explicit, Size = 0x70)]
public unsafe partial struct WeatherManager {
[FixedSizeArray<Pointer<ServerWeather>>(3)]
[FieldOffset(0x00)] internal fixed byte WeatherPtr[3 * 0x08];
[FixedSizeArray<ServerWeather>(3)]
[FieldOffset(0x18)] internal fixed byte Weather[3 * 0x18];

[FieldOffset(0x60)] public byte WeatherIndex;
[FieldOffset(0x64)] public byte WeatherId;
[FieldOffset(0x65)] public byte WeatherOverride;
[FieldOffset(0x66)] public byte CurrentDaytimeOffset;
[FieldOffset(0x67)] public byte IndividualWeatherId;

[StaticAddress("48 8D 0D ?? ?? ?? ?? 44 0F B7 45", 3)]
public static partial WeatherManager* Instance();

[MemberFunction("E8 ?? ?? ?? ?? 0F B6 C8 8D 41 ?? A9")]
public partial byte GetCurrentWeather();

/// <summary>
/// Checks if the specified TerritoryType has individual weather.
/// </summary>
[MemberFunction("E8 ?? ?? ?? ?? 44 0F B6 F0 48 8D 73 04")]
public partial bool HasIndividualWeather(ushort territoryTypeId);

/// <summary>
/// Gets the IndividualWeather id for the specified TerritoryType, if it has one.
/// </summary>
[MemberFunction("E8 ?? ?? ?? ?? 0F B6 C0 33 DB")]
public partial byte GetIndividualWeather(ushort territoryTypeId);

/// <summary>
/// Gets the Weather id for the specified TerritoryType and hour.
/// </summary>
/// <param name="territoryTypeId"> The id of the TerritoryType to check the weather for. </param>
/// <param name="hourOffset"> An hour offset. (0 = Now, 8 = some time after the next weather change) </param>
/// <returns> The id of a row in the Weather sheet. </returns>
[MemberFunction("40 57 48 83 EC 20 0F B7 CA")]
public partial byte GetWeatherForHour(ushort territoryTypeId, int hourOffset);

/// <summary>
/// Gets the Weather id for the specified TerritoryType and daytime.
/// </summary>
/// <param name="territoryTypeId"> The id of the TerritoryType to check the weather for. </param>
/// <param name="daytimeOffset">
/// A daytime offset.<br/>
/// 0 = Now<br/>
/// 1 = In 8 hours (some time after the next weather change)<br/>
/// 2 = In 16 hours<br/>
/// 3 = In 24 hours
/// </param>
/// <remarks> All this function does, is to call <see cref="GetWeatherForHour"/> with daytimeIndex * 8 as offset. </remarks>
/// <returns> The id of a row in the Weather sheet. </returns>
[MemberFunction("46 8D 04 C5 ?? ?? ?? ?? E9")]
public partial byte GetWeatherForDaytime(ushort territoryTypeId, int daytimeOffset);

[StructLayout(LayoutKind.Explicit, Size = 0x18)]
public unsafe partial struct ServerWeather {
[FieldOffset(0x08)] public byte NextWeatherId;
[FieldOffset(0x09)] public byte CurrentWeatherId;
[FieldOffset(0x0C)] public float DaytimeFadeTimeLeft;
[FieldOffset(0x10)] public float DaytimeFadeLength;
}
}
1 change: 1 addition & 0 deletions FFXIVClientStructs/FFXIV/Client/Graphics/ByteColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace FFXIVClientStructs.FFXIV.Client.Graphics;
// common class representing colors that are 0-255 fields
[StructLayout(LayoutKind.Explicit, Size = 0x4)]
public struct ByteColor {
[FieldOffset(0x0), CExportIgnore] public uint RGBA;
[FieldOffset(0x0)] public byte R;
[FieldOffset(0x1)] public byte G;
[FieldOffset(0x2)] public byte B;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ public unsafe partial struct NetworkModuleProxy {
[FieldOffset(0x10), Obsolete("Wrongly defined overflows struct size")] public NetworkModulePacketReceiverCallback PacketReceiverCallback;

[MemberFunction("E8 ?? ?? ?? ?? EB ?? 49 8B 85")]
public partial bool IsInCrossWorlDuty();
public partial bool IsInCrossWorldDuty();

[Obsolete("Renamed to IsInCrossWorldDuty")]
public bool IsInCrossWorlDuty() => IsInCrossWorldDuty();

/// <summary>
/// Gets current instance<br/>
Expand Down
Loading

0 comments on commit 400f8dd

Please sign in to comment.