Skip to content

Commit

Permalink
Merge pull request aers#846 from Haselnussbomber/add-dc-world-helper
Browse files Browse the repository at this point in the history
Add DataCenterHelper and WorldHelper
  • Loading branch information
pohky authored Apr 24, 2024
2 parents c8e0ee6 + a7d96d2 commit 7dabba5
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 8 deletions.
22 changes: 22 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/UI/Misc/DataCenterHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using FFXIVClientStructs.FFXIV.Client.System.Framework;

namespace FFXIVClientStructs.FFXIV.Client.UI.Misc;

// Client::UI::Misc::DataCenterHelper
[StructLayout(LayoutKind.Explicit, Size = 0x20)]
public unsafe partial struct DataCenterHelper {
public static DataCenterHelper* Instance() => Framework.Instance()->GetUiModule()->GetDataCenterHelper();

/// <summary>
/// Contains all data centers of the current region.
/// </summary>
[FieldOffset(0x08)] public StdVector<DataCenter> DataCenters;

[StructLayout(LayoutKind.Explicit, Size = 0x22)]
public partial struct DataCenter {
[FieldOffset(0x00)] public ushort Region;
/// <remarks> RowId of sheet WorldDCGroupType </remarks>
[FieldOffset(0x02)] public uint RowId;
[FieldOffset(0x06), FixedString("Name")] public fixed byte NameData[32];
}
}
22 changes: 22 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/UI/Misc/WorldHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using FFXIVClientStructs.FFXIV.Client.System.Framework;

namespace FFXIVClientStructs.FFXIV.Client.UI.Misc;

// Client::UI::Misc::WorldHelper
[StructLayout(LayoutKind.Explicit, Size = 0x40)]
public unsafe partial struct WorldHelper {
public static WorldHelper* Instance() => Framework.Instance()->GetUiModule()->GetWorldHelper();

[FieldOffset(0x08)] public StdMap<ushort, World> AllWorlds;
/// <summary> Contains all worlds of the current data center. </summary>
[FieldOffset(0x18)] public StdMap<ushort, World> DataCenterWorlds;
// [FieldOffset(0x28)] public ClassThatLoadsWorlds WorldLoader; // size: 0x10
[FieldOffset(0x38)] public bool IsLoaded;

[StructLayout(LayoutKind.Explicit, Size = 0x22)]
public partial struct World {
[FieldOffset(0x00)] public byte DataCenter;
[FieldOffset(0x01)] public bool IsPublic;
[FieldOffset(0x02), FixedString("Name")] public fixed byte NameData[32];
}
}
13 changes: 6 additions & 7 deletions FFXIVClientStructs/FFXIV/Client/UI/UIModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ and so on...
[FieldOffset(0x8DFA0)] internal RecipeFavoriteModule RecipeFavoriteModule;
// [FieldOffset(0x8E128)] internal CraftModule CraftModule;
[FieldOffset(0x8E180)] internal RaptureUiDataModule RaptureUiDataModule;
// [FieldOffset(0x93C68)] internal Vf27Struct;
// [FieldOffset(0x93C88)] internal Vf28Struct;
// [FieldOffset(0x93CB0)] internal UnkStruct93CB0;
[FieldOffset(0x93C68)] internal DataCenterHelper DataCenterHelper;
[FieldOffset(0x93C88)] internal WorldHelper WorldHelper;
[FieldOffset(0x93CC8)] internal GoldSaucerModule GoldSaucerModule;
[FieldOffset(0x93F90)] internal RaptureTeleportHistory RaptureTeleportHistory;
[FieldOffset(0x94050)] internal ItemContextCustomizeModule ItemContextCustomizeModule;
Expand Down Expand Up @@ -178,11 +177,11 @@ and so on...
[VirtualFunction(26)]
public partial RaptureUiDataModule* GetRaptureUiDataModule();

// [VirtualFunction(27)]
// public partial Vf27Struct* GetVf27Struct();
[VirtualFunction(27)]
public partial DataCenterHelper* GetDataCenterHelper();

// [VirtualFunction(28)]
// public partial Vf28Struct* GetVf28Struct();
[VirtualFunction(28)]
public partial WorldHelper* GetWorldHelper();

[VirtualFunction(29)]
public partial GoldSaucerModule* GetGoldSaucerModule();
Expand Down
30 changes: 29 additions & 1 deletion ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,12 @@ classes:
- ea: 0x141A1A668
vfuncs:
0: dtor
1: GetGlobalParameters
3: FormatUtf8String
7: EncodeString
8: EncodeMacro
9: ProcessMacroCode
16: FormatString # using byte* as input
Component::Text::Localize::Localize:
vtbls:
- ea: 0x141A1A6F0
Expand Down Expand Up @@ -5770,7 +5773,8 @@ classes:
24: GetRecipeFavoriteModule
25: GetCraftModule
26: GetRaptureUiDataModule
27: GetAfterAgentsPtr # points to the field right after the last Agent in AgentModule
27: GetDataCenterHelper
28: GetWorldHelper
29: GetGoldSaucerModule
30: GetRaptureTeleportHistory
31: GetItemContextCustomizeModule
Expand Down Expand Up @@ -6403,6 +6407,30 @@ classes:
0x1406A8A50: Update
0x1406A6FF0: Finalize
0x1406A8E40: SearchForItem
Client::UI::Misc::DataCenterHelper:
vtbls:
- ea: 0x141A1EEB0
vfuncs:
0: dtor
funcs:
0x1406B1D40: ctor
0x1406B1D80: Finalize
0x1406B1E90: PopulateForRegion # a2 is a pointer to the region id (byte)
0x1406B2260: GetDataCenterByIndex # unused
0x1406B22E0: GetDataCenterByRowId # unused
0x1406B22E0: GetDataCenterNameByRowId # unused
Client::UI::Misc::WorldHelper:
vtbls:
- ea: 0x141A1EEC8
vfuncs:
0: dtor
funcs:
0x1406B2560: ctor
0x1406B2630: Finalize
0x1406B26C0: Populate
0x1406B2B50: GetWorldById
0x1406B2BD0: GetWorldNameById
0x1406B2C30: GetWorldIdByName
Client::UI::Misc::GoldSaucerModule:
vtbls:
- ea: 0x141A1EED0
Expand Down

0 comments on commit 7dabba5

Please sign in to comment.