Skip to content

Commit af2c91e

Browse files
Merge pull request #1767 from Haselnussbomber/ZoneInitPacket
2 parents c3923c7 + 4a44216 commit af2c91e

7 files changed

Lines changed: 68 additions & 3 deletions

File tree

FFXIVClientStructs/FFXIV/Client/Game/ContentsReplayManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using FFXIVClientStructs.FFXIV.Client.Game.Network;
2+
13
namespace FFXIVClientStructs.FFXIV.Client.Game;
24

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

23-
// 5D0 InitZonePacket
25+
[FieldOffset(0x5D0)] public ZoneInitPacket ZoneInitPacket;
2426

2527
[FieldOffset(0x724)] public float PositionMs;
2628

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
namespace FFXIVClientStructs.FFXIV.Client.Game.Network;
2+
3+
[GenerateInterop]
4+
[StructLayout(LayoutKind.Explicit, Size = 0x88)]
5+
public partial struct ZoneInitPacket {
6+
[FieldOffset(0x00)] public ushort ServerId;
7+
[FieldOffset(0x02)] public ushort TerritoryTypeId;
8+
[FieldOffset(0x04)] public ushort Instance; // only when IsInstancedArea is true
9+
[FieldOffset(0x06)] public ushort ContentFinderConditionId;
10+
[FieldOffset(0x08)] public uint TransitionTerritoryFilterKey;
11+
[FieldOffset(0x0C)] public uint PopRangeId; // InstanceId in the PlanMap lgb
12+
[FieldOffset(0x10)] public byte WeatherId;
13+
14+
[FieldOffset(0x12)] public ZoneInitFlags Flags;
15+
16+
[FieldOffset(0x15)] private byte UnkInputTimerFlags; // flags set to InputTimerModule+0x4F4
17+
18+
[FieldOffset(0x20)] public uint RankedCrystallineConflictHostingDataCenterId; // WorldDCGroupType RowId
19+
[FieldOffset(0x24)] public bool IsLimitedTimeBonusActive;
20+
21+
// Saved to GameMain, used by various systems like LayoutManager, WeatherManager, EventHandlers etc. for how things should look
22+
[FieldOffset(0x26), FixedSizeArray] internal FixedSizeArray8<ushort> _gameFestivalIds;
23+
[FieldOffset(0x36), FixedSizeArray] internal FixedSizeArray8<ushort> _gameFestivalPhases;
24+
// 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
25+
[FieldOffset(0x46), FixedSizeArray] internal FixedSizeArray8<ushort> _uiFestivalIds;
26+
[FieldOffset(0x56), FixedSizeArray] internal FixedSizeArray8<ushort> _uiFestivalPhases;
27+
28+
// Used for camera and streaming layout
29+
[FieldOffset(0x68)] public float PositionX;
30+
[FieldOffset(0x6C)] public float PositionY;
31+
[FieldOffset(0x70)] public float PositionZ;
32+
[FieldOffset(0x74), FixedSizeArray] internal FixedSizeArray11<byte> _contentRouletteRoleBonuses; // ContentsRouletteRole[11]
33+
[FieldOffset(0x80), FixedSizeArray] internal FixedSizeArray2<int> _penaltyTimestamps;
34+
}
35+
36+
[Flags]
37+
public enum ZoneInitFlags : ushort {
38+
None = 0,
39+
IsInitialLogin = 1 << 0,
40+
Unknown1 = 1 << 1,
41+
Unknown2 = 1 << 2,
42+
IsCrossWorld = 1 << 3,
43+
IsFlyingEnabled = 1 << 4,
44+
Unknown5 = 1 << 5,
45+
Unknown6 = 1 << 6,
46+
IsInstancedArea = 1 << 7,
47+
Unknown8 = 1 << 8,
48+
Unknown9 = 1 << 9,
49+
}

FFXIVClientStructs/FFXIV/Client/Game/UI/InstanceContent.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public unsafe partial struct InstanceContent {
99
[StaticAddress("48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 84 C0 0F 94 C3", 3)]
1010
public static partial InstanceContent* Instance();
1111

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

1415
/// <summary>

FFXIVClientStructs/FFXIV/Client/Network/PacketDispatcher.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public static partial void HandleActorControlPacket(
3333
GameObjectId targetId,
3434
bool isRecorded);
3535

36+
[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")]
37+
public static partial void HandleZoneInitPacket(uint entityId, ZoneInitPacket* packet, byte a3); // a3 has something to do with ContentsReplay
38+
3639
[MemberFunction("48 89 5C 24 ?? 56 48 83 EC ?? 48 8B 0D ?? ?? ?? ?? 48 8B F2")]
3740
public static partial void HandleSocialPacket(uint targetId, nint packet);
3841

FFXIVClientStructs/FFXIV/Client/UI/Info/InfoProxyInterface.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using FFXIVClientStructs.FFXIV.Client.Game.Network;
2+
13
namespace FFXIVClientStructs.FFXIV.Client.UI.Info;
24

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

35+
[VirtualFunction(7)]
36+
public partial void HandleZoneInitPacket(ZoneInitPacket* packet);
37+
3338
/// <summary>
3439
/// Gets called after all data is received from the server.
3540
/// </summary>

FFXIVClientStructs/FFXIV/Client/UI/UIModuleInterface.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public enum UIModulePacketType {
185185
ClassJobChange = 2,
186186
LevelChange = 3,
187187
ShowLogMessage = 4,
188-
InitZone = 5,
188+
ZoneInit = 5,
189189
Login = 6,
190190
Logout = 7,
191191
CloseLogoutDialog = 8,
@@ -221,4 +221,7 @@ public enum UIModulePacketType {
221221
Unknown38 = 38, // Tofu
222222
Unknown39 = 39, // Tofu
223223
Unknown40 = 40, // Tofu
224+
225+
[Obsolete("Renamed to ZoneInit")]
226+
InitZone = 5,
224227
}

ida/data.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5027,6 +5027,7 @@ classes:
50275027
3: RequestData
50285028
4: GetEntryCount
50295029
5: ClearListData
5030+
7: HandleZoneInitPacket
50305031
10: EndRequest
50315032
Client::UI::Info::InfoProxyPageInterface:
50325033
vtbls:
@@ -6236,7 +6237,7 @@ classes:
62366237
0x140B9E8C0: HandleUpdatePartyPacket
62376238
0x140B9F0A0: HandleUpdateAllianceNormalPacket
62386239
0x140B9F0E0: HandleUpdateAllianceSmallPacket
6239-
0x140B9F120: HandleInitZonePacket
6240+
0x140B9F120: HandleZoneInitPacket
62406241
0x140B9F2A0: HandleUpdateHatePacket
62416242
0x140B9F300: HandleUpdateHaterPacket
62426243
0x140B9F3B0: HandleSpawnObjectPacket
@@ -9637,6 +9638,7 @@ classes:
96379638
0x140769250: PropagateLevelChange
96389639
0x1407692A0: PropagateClassJobChange
96399640
0x140761920: ScreenShotCallback
9641+
0x140769410: HandleZoneInitPacket
96409642
Client::UI::Misc::PvpSetModule:
96419643
vtbls:
96429644
- ea: 0x1420BE568

0 commit comments

Comments
 (0)