From 7c396b90b5da45effc3e45f033337e23d2b88a4e Mon Sep 17 00:00:00 2001 From: pmgr <26606291+pmgr@users.noreply.github.com> Date: Sun, 21 Jun 2020 00:13:27 +0100 Subject: [PATCH 1/3] Add PlaceFieldMarkerPreset ServerZoneIpc and struct --- src/common/Network/PacketDef/Ipcs.h | 1 + .../Network/PacketDef/Zone/ServerZoneDef.h | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index ca042e79..f6dba912 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -336,6 +336,7 @@ namespace Sapphire::Network::Packets ClientTrigger = 0x017D, // updated 5.25 DiscoveryHandler = 0x02C8, // updated 5.25 + PlaceFieldMarkerPreset = 0x23F, // updated 5.25 PlaceFieldMarker = 0x013C, // updated 5.0 SkillHandler = 0x0241, // updated 5.25 GMCommand1 = 0x01EC, // updated 5.25 diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index d3eee984..cf00709c 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -1681,6 +1681,31 @@ namespace Sapphire::Network::Packets::Server uint8_t bitmask; }; + /** + * Structural representation of the packet sent by the server + * to place/remove field marker presets + */ + struct FFXIVIpcPlaceFieldMarkerPreset : FFXIVIpcBasePacket< PlaceFieldMarkerPreset > + { + enum FieldMarkerStatus + { + A = 0x1, + B = 0x2, + C = 0x4, + D = 0x8, + One = 0x10, + Two = 0x20, + Three = 0x40, + Four = 0x80 + }; + /*! which fieldmarks to show */ + enum FieldMarkerStatus status; + /*! A coordinates would be (float)Xints[0]/1000.0, (float)Yints[0]/1000.0, (float)Zints[0]/1000.0 */ + uint32_t Xints[8]; + uint32_t Yints[8]; + uint32_t Zints[8]; + }; + /** * Structural representation of the packet sent by the server * to mount a player From d9777084c55ac686f8027eaa09c7ad93f8c94f88 Mon Sep 17 00:00:00 2001 From: pmgr <26606291+pmgr@users.noreply.github.com> Date: Sun, 21 Jun 2020 01:09:19 +0100 Subject: [PATCH 2/3] At demo's recommendation, stuffed FieldMarkerStatus in Common.h; also added the PlaceFieldMarker struct --- src/common/Common.h | 12 +++++++++ src/common/Network/PacketDef/Ipcs.h | 4 +-- .../Network/PacketDef/Zone/ServerZoneDef.h | 27 ++++++++++--------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/common/Common.h b/src/common/Common.h index 854f9d6f..14be767a 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -566,6 +566,18 @@ namespace Sapphire::Common }; + enum FieldMarkerStatus : uint32_t + { + A = 0x1, + B = 0x2, + C = 0x4, + D = 0x8, + One = 0x10, + Two = 0x20, + Three = 0x40, + Four = 0x80 + }; + enum struct ActionAspect : uint8_t { None = 0, // Doesn't imply unaspected diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index f6dba912..9187be45 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -336,8 +336,8 @@ namespace Sapphire::Network::Packets ClientTrigger = 0x017D, // updated 5.25 DiscoveryHandler = 0x02C8, // updated 5.25 - PlaceFieldMarkerPreset = 0x23F, // updated 5.25 - PlaceFieldMarker = 0x013C, // updated 5.0 + PlaceFieldMarkerPreset = 0x023F, // updated 5.25 + PlaceFieldMarker = 0x01BA, // updated 5.25 SkillHandler = 0x0241, // updated 5.25 GMCommand1 = 0x01EC, // updated 5.25 GMCommand2 = 0x0368, // updated 5.25 diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index cf00709c..6da042a6 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -1687,25 +1687,28 @@ namespace Sapphire::Network::Packets::Server */ struct FFXIVIpcPlaceFieldMarkerPreset : FFXIVIpcBasePacket< PlaceFieldMarkerPreset > { - enum FieldMarkerStatus - { - A = 0x1, - B = 0x2, - C = 0x4, - D = 0x8, - One = 0x10, - Two = 0x20, - Three = 0x40, - Four = 0x80 - }; /*! which fieldmarks to show */ - enum FieldMarkerStatus status; + Common::FieldMarkerStatus status; /*! A coordinates would be (float)Xints[0]/1000.0, (float)Yints[0]/1000.0, (float)Zints[0]/1000.0 */ uint32_t Xints[8]; uint32_t Yints[8]; uint32_t Zints[8]; }; + /** + * Structural representation of the packet sent by the server + * to place/remove a field marker + */ + struct FFXIVIpcPlaceFieldMarker : FFXIVIpcBasePacket< PlaceFieldMarker > + { + uint8_t markerId; + uint8_t status; + uint8_t pad[2]; + uint32_t Xint; + uint32_t Yint; + uint32_t Zint; + }; + /** * Structural representation of the packet sent by the server * to mount a player From 4ae5d6120dc35a25a5b3848473f3c1fbc0d6ed9a Mon Sep 17 00:00:00 2001 From: pmgr <26606291+pmgr@users.noreply.github.com> Date: Sun, 21 Jun 2020 01:26:54 +0100 Subject: [PATCH 3/3] Convert markerId in FFXIVIpcPlaceFieldMarker into an enum --- src/common/Common.h | 12 ++++++++++++ src/common/Network/PacketDef/Zone/ServerZoneDef.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/common/Common.h b/src/common/Common.h index 14be767a..9c3b9bd3 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -577,6 +577,18 @@ namespace Sapphire::Common Three = 0x40, Four = 0x80 }; + // TODO: consolidate these two into one since FieldMarkerStatus == 1 << FieldMarkerId? + enum class FieldMarkerId : uint8_t + { + A, + B, + C, + D, + One, + Two, + Three, + Four + }; enum struct ActionAspect : uint8_t { diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index 6da042a6..a60dad20 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -1701,7 +1701,7 @@ namespace Sapphire::Network::Packets::Server */ struct FFXIVIpcPlaceFieldMarker : FFXIVIpcBasePacket< PlaceFieldMarker > { - uint8_t markerId; + Common::FieldMarkerId markerId; uint8_t status; uint8_t pad[2]; uint32_t Xint;