From a6e9c567ee316dbf2b5b3411e3a1f93c549c9240 Mon Sep 17 00:00:00 2001 From: karashiiro <49822414+karashiiro@users.noreply.github.com> Date: Tue, 15 Sep 2020 11:02:23 -0700 Subject: [PATCH] MiniCactpotInit opcode and documentation; MarketTaxRates tweak --- src/common/Network/PacketDef/Ipcs.h | 2 + .../Network/PacketDef/Zone/ServerZoneDef.h | 57 +++++++++++++++++-- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/common/Network/PacketDef/Ipcs.h b/src/common/Network/PacketDef/Ipcs.h index ff682f2f..b188abeb 100644 --- a/src/common/Network/PacketDef/Ipcs.h +++ b/src/common/Network/PacketDef/Ipcs.h @@ -229,6 +229,8 @@ namespace Sapphire::Network::Packets EquipDisplayFlags = 0x010D, // updated 5.25 + MiniCactpotInit = 0x0286, // added 5.31 + /// Housing ////////////////////////////////////// LandSetInitialize = 0x0234, // updated 5.0 diff --git a/src/common/Network/PacketDef/Zone/ServerZoneDef.h b/src/common/Network/PacketDef/Zone/ServerZoneDef.h index f941f744..92ced6ca 100644 --- a/src/common/Network/PacketDef/Zone/ServerZoneDef.h +++ b/src/common/Network/PacketDef/Zone/ServerZoneDef.h @@ -286,9 +286,11 @@ namespace Sapphire::Network::Packets::Server struct FFFXIVIpcMarketTaxRates : FFXIVIpcBasePacket< MarketTaxRates > { - uint32_t unknown1; - uint16_t padding1; - uint16_t unknown2; + // Same handler as MiniCactpotInit + uint32_t type; + uint16_t category; + uint8_t unknown1; + uint8_t unknown2; uint32_t taxRate[Common::TOWN_COUNT]; // In the order of Common::Town uint64_t unknown3; }; @@ -1552,7 +1554,7 @@ namespace Sapphire::Network::Packets::Server /** * Structural representation of the packet sent by the server - * to send a unviel a map + * to send a unveil a map */ struct FFXIVIpcDiscovery : FFXIVIpcBasePacket< Discovery > { @@ -1681,6 +1683,52 @@ namespace Sapphire::Network::Packets::Server uint8_t bitmask; }; + struct FFXIVIpcMiniCactPotInit : FFXIVIpcBasePacket< MiniCactpotInit > + { + /* + * Looks like this shares a handler with MarketTaxRates and a few + * other packets, so these first fields are most likely discriminators + * or other metadata for the handler itself. + */ + uint32_t type; + uint16_t category; + uint8_t unknown1; + uint8_t unknown2; + /* + * Always 18 for this packet, incidentally the number of payouts plus 1. + * Used similarly for MarketTaxRates => for (auto i = 0; i <= indexEnd; i++) {} + */ + uint8_t indexEnd; + uint8_t unknown3; + uint16_t padding1; + /* + * On clicking a number, the client sends a ClientTrigger (DirectorSync) with an unknown + * param2, param5; param1 session, param3 column, param4 row; zero param6, and the server + * replies with an ActorControlSelf (DirectorUpdate) with an unknown param2; param1 session, + * param3 column, param4 row, param5 digit; zero param6. After a line is selected, + * the server replies with 9 DirectorUpdate packets, in order (column, row), containing every + * number on the board (why tho). Finally, one last DirectorUpdate is sent with parameters + * param1 session, param3 payout index; unknown param2, param4; zero param5, param6. + */ + uint32_t column; // zero-based + uint32_t row; + uint32_t firstDigit; + uint32_t payouts[19]; // In in-game display order + uint32_t unknown4; + /* + * All of the below fields seem to be gibberish, and change completely between + * draws and characters. + */ + uint32_t unknown5; + uint32_t unknown6; + uint32_t unknown7; + uint32_t unknown8; + uint16_t unknown9; + uint16_t unknown10; + uint32_t unknown11; + uint64_t unknown12; + }; + /** * Structural representation of the packet sent by the server * to place/remove field marker presets @@ -2077,7 +2125,6 @@ namespace Sapphire::Network::Packets::Server uint32_t param6; uint32_t param7; }; - } #endif /*_CORE_NETWORK_PACKETS_SERVER_IPC_H*/