Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/MapDiscoveryManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace FFXIVClientStructs.FFXIV.Client.Game;

// Client::Game::MapDiscoveryManager
[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 0x1024)]
public unsafe partial struct MapDiscoveryManager {
[StaticAddress("48 8D 0D ?? ?? ?? ?? 0F B6 87 ?? ?? ?? ?? 88 05", 3)]
public static partial MapDiscoveryManager* Instance();

/// <summary> Maps with up to 16 discoverable regions </summary>
/// <remarks> Index is DiscoveryIndex, used when DiscoveryArrayByte is true (from Map sheet) </remarks>
[FieldOffset(0x000), FixedSizeArray] internal FixedSizeArray162<DiscoveryTable16> _mapsWithUpTo16Regions;
/// <summary> Maps with up to 32 discoverable regions </summary>
/// <remarks> Index is DiscoveryIndex, used when DiscoveryArrayByte is false (from Map sheet) </remarks>
[FieldOffset(0xA20), FixedSizeArray] internal FixedSizeArray48<DiscoveryTable32> _mapsWithUpTo32Regions;
[FieldOffset(0x1020)] public float ReportCooldown;

[MemberFunction("48 89 5C 24 ?? 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 8B FA")]
public partial bool IsDiscoveryEnabledForMap(uint mapId);

/// <summary>
/// Checks if a map region was discovered.<br/>
/// This runs an internal Map sheet lookup!
/// </summary>
/// <param name="mapId">The Map RowId</param>
/// <param name="regionIndex">The region index</param>
/// <returns><see langword="true"/> if discovered, <see langword="false"/> otherwise.</returns>
[MemberFunction("E8 ?? ?? ?? ?? 84 C0 74 ?? 44 0B F7")]
public partial bool IsMapRegionDiscovered(uint mapId, byte regionIndex);

/// <summary>
/// Checks if a map region was discovered, without Map sheet lookup.
/// </summary>
/// <param name="discoveryIndex">DiscoveryIndex from the Map sheet</param>
/// <param name="regionIndex">The region index</param>
/// <param name="isMapWithUpTo16Regions">DiscoveryArrayByte from the Map sheet</param>
/// <returns><see langword="true"/> if discovered, <see langword="false"/> otherwise.</returns>
[MemberFunction("33 C0 4C 8B D1 66 3B C2 7F ?? 45 84 C9 74 ?? B8 ?? ?? ?? ?? 66 3B D0 73 ?? 48 0F BF C2")]
public partial bool IsRegionDiscovered(ushort discoveryIndex, byte regionIndex, bool isMapWithUpTo16Regions);

[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 16)]
public partial struct DiscoveryTable16 {
[FieldOffset(0x00), FixedSizeArray] internal FixedSizeArray16<bool> _discoveries;
}

[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 32)]
public partial struct DiscoveryTable32 {
[FieldOffset(0x00), FixedSizeArray] internal FixedSizeArray32<bool> _discoveries;
}
}
12 changes: 12 additions & 0 deletions ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,17 @@ classes:
0x140833D90: ResetBGM
0x140833DE0: SetBGMPlayState # static
0x140833E10: ctor
Client::Game::MapDiscoveryManager:
instances:
- ea: 0x1429BFFF0
funcs:
0x140835C00: ReadDiscoveryListPacket
0x140835D30: ReadDiscoveryPacket
0x140835F40: IsMapRegionDiscovered
0x140836290: IsRegionDiscovered
0x140836010: SendMapRangeEntered
0x140836190: Update
0x1408366A0: IsDiscoveryEnabledForMap
Client::Game::Control::InputManager:
instances:
- ea: 0x1427AC640
Expand Down Expand Up @@ -5957,6 +5968,7 @@ classes:
0x140B9F380: HandleTreasureFadeOutPacket
0x140B9F410: HandleWeatherChangePacket
0x140B9F430: HandleDiscoveryPacket
0x140B9F450: HandleDiscoveryListPacket
0x140B9F470: HandlePlayerTitleListPacket
0x140B9F4C0: HandleUpdatePartyPositionsPacket
0x140B9F4F0: HandleUpdateAllianceNormalPositionsPacket
Expand Down