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
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using FFXIVClientStructs.FFXIV.Client.Game.Network;

namespace FFXIVClientStructs.FFXIV.Client.Game;

[GenerateInterop]
Expand All @@ -20,7 +22,7 @@ public unsafe partial struct ContentsReplayManager {
[FieldOffset(0x4C8)] public Utf8String ReplayTitle;
[FieldOffset(0x530)] private Utf8String Unk530;

// 5D0 InitZonePacket
[FieldOffset(0x5D0)] public ZoneInitPacket ZoneInitPacket;

[FieldOffset(0x724)] public float PositionMs;

Expand Down
49 changes: 49 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/Network/ZoneInitPacket.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
namespace FFXIVClientStructs.FFXIV.Client.Game.Network;

[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 0x88)]
public partial struct ZoneInitPacket {
[FieldOffset(0x00)] public ushort ServerId;
[FieldOffset(0x02)] public ushort TerritoryTypeId;
[FieldOffset(0x04)] public ushort Instance; // only when IsInstancedArea is true
[FieldOffset(0x06)] public ushort ContentFinderConditionId;
[FieldOffset(0x08)] public uint TransitionTerritoryFilterKey;
[FieldOffset(0x0C)] public uint PopRangeId; // InstanceId in the PlanMap lgb
[FieldOffset(0x10)] public byte WeatherId;

[FieldOffset(0x12)] public ZoneInitFlags Flags;

[FieldOffset(0x15)] private byte UnkInputTimerFlags; // flags set to InputTimerModule+0x4F4

[FieldOffset(0x20)] public uint RankedCrystallineConflictHostingDataCenterId; // WorldDCGroupType RowId
[FieldOffset(0x24)] public bool IsLimitedTimeBonusActive;

// Saved to GameMain, used by various systems like LayoutManager, WeatherManager, EventHandlers etc. for how things should look
[FieldOffset(0x26), FixedSizeArray] internal FixedSizeArray8<ushort> _gameFestivalIds;
[FieldOffset(0x36), FixedSizeArray] internal FixedSizeArray8<ushort> _gameFestivalPhases;
// Saved to PlayerState, used by UI systems like ContentsFinder, AgentHalloweenNpcSelect, AgentFriendlist (for "Invite Friend to Return") and lua scripts for what options should be displayed
[FieldOffset(0x46), FixedSizeArray] internal FixedSizeArray8<ushort> _uiFestivalIds;
[FieldOffset(0x56), FixedSizeArray] internal FixedSizeArray8<ushort> _uiFestivalPhases;

// Used for camera and streaming layout
[FieldOffset(0x68)] public float PositionX;
[FieldOffset(0x6C)] public float PositionY;
[FieldOffset(0x70)] public float PositionZ;
[FieldOffset(0x74), FixedSizeArray] internal FixedSizeArray11<byte> _contentRouletteRoleBonuses; // ContentsRouletteRole[11]
[FieldOffset(0x80), FixedSizeArray] internal FixedSizeArray2<int> _penaltyTimestamps;
}

[Flags]
public enum ZoneInitFlags : ushort {
None = 0,
IsInitialLogin = 1 << 0,
Unknown1 = 1 << 1,
Unknown2 = 1 << 2,
IsCrossWorld = 1 << 3,
IsFlyingEnabled = 1 << 4,
Unknown5 = 1 << 5,
Unknown6 = 1 << 6,
IsInstancedArea = 1 << 7,
Unknown8 = 1 << 8,
Unknown9 = 1 << 9,
}
1 change: 1 addition & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/UI/InstanceContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public unsafe partial struct InstanceContent {
[StaticAddress("48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 84 C0 0F 94 C3", 3)]
public static partial InstanceContent* Instance();

[FieldOffset(0x6C)] public byte RankedCrystallineConflictHostingDataCenterId; // saved as uint, used as byte? checks against 0xFF too
[FieldOffset(0x70)] public bool IsLimitedTimeBonusActive;

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Network/PacketDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public static partial void HandleActorControlPacket(
GameObjectId targetId,
bool isRecorded);

[MemberFunction("4C 8B DC 55 56 41 56 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 84 24 ?? ?? ?? ?? 41 0F B6 F0")]
public static partial void HandleZoneInitPacket(uint entityId, ZoneInitPacket* packet, byte a3); // a3 has something to do with ContentsReplay
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly like the other ones where it is only set to true if it is replay and false if not?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a boolean. Has values 0-3. I don't know what it is.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From looking into it a bit seems to be tied to if it has to handle Instance from the ZoneInitPacket (value 3) and what ever sets field_734 in ContentsReplayManager to < 0x40 (value 2) and >= 0x40 (value 1)


[MemberFunction("48 89 5C 24 ?? 56 48 83 EC ?? 48 8B 0D ?? ?? ?? ?? 48 8B F2")]
public static partial void HandleSocialPacket(uint targetId, nint packet);

Expand Down
5 changes: 5 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/UI/Info/InfoProxyInterface.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using FFXIVClientStructs.FFXIV.Client.Game.Network;

namespace FFXIVClientStructs.FFXIV.Client.UI.Info;

// Client::UI::Info::InfoProxyInterface
Expand Down Expand Up @@ -30,6 +32,9 @@ public unsafe partial struct InfoProxyInterface {
[VirtualFunction(5)]
public partial void ClearListData();

[VirtualFunction(7)]
public partial void HandleZoneInitPacket(ZoneInitPacket* packet);

/// <summary>
/// Gets called after all data is received from the server.
/// </summary>
Expand Down
5 changes: 4 additions & 1 deletion FFXIVClientStructs/FFXIV/Client/UI/UIModuleInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public enum UIModulePacketType {
ClassJobChange = 2,
LevelChange = 3,
ShowLogMessage = 4,
InitZone = 5,
ZoneInit = 5,
Login = 6,
Logout = 7,
CloseLogoutDialog = 8,
Expand Down Expand Up @@ -221,4 +221,7 @@ public enum UIModulePacketType {
Unknown38 = 38, // Tofu
Unknown39 = 39, // Tofu
Unknown40 = 40, // Tofu

[Obsolete("Renamed to ZoneInit")]
InitZone = 5,
}
4 changes: 3 additions & 1 deletion ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5024,6 +5024,7 @@ classes:
3: RequestData
4: GetEntryCount
5: ClearListData
7: HandleZoneInitPacket
10: EndRequest
Client::UI::Info::InfoProxyPageInterface:
vtbls:
Expand Down Expand Up @@ -6233,7 +6234,7 @@ classes:
0x140B9E8C0: HandleUpdatePartyPacket
0x140B9F0A0: HandleUpdateAllianceNormalPacket
0x140B9F0E0: HandleUpdateAllianceSmallPacket
0x140B9F120: HandleInitZonePacket
0x140B9F120: HandleZoneInitPacket
0x140B9F2A0: HandleUpdateHatePacket
0x140B9F300: HandleUpdateHaterPacket
0x140B9F3B0: HandleSpawnObjectPacket
Expand Down Expand Up @@ -9634,6 +9635,7 @@ classes:
0x140769250: PropagateLevelChange
0x1407692A0: PropagateClassJobChange
0x140761920: ScreenShotCallback
0x140769410: HandleZoneInitPacket
Client::UI::Misc::PvpSetModule:
vtbls:
- ea: 0x1420BE568
Expand Down
Loading