mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
refactor(Core/Packets): Rewrite MSG_MINIMAP_PING to modern packet class. (#22696)
This commit is contained in:
@@ -67,6 +67,21 @@ WorldPacket const* WorldPackets::Misc::Playsound::Write()
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Misc::MinimapPingClient::Read()
|
||||
{
|
||||
_worldPacket >> MapX;
|
||||
_worldPacket >> MapY;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Misc::MinimapPing::Write()
|
||||
{
|
||||
_worldPacket << SourceGuid;
|
||||
_worldPacket << float(MapX);
|
||||
_worldPacket << float(MapY);
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
void WorldPackets::Misc::RandomRollClient::Read()
|
||||
{
|
||||
_worldPacket >> Min;
|
||||
|
||||
@@ -93,6 +93,29 @@ namespace WorldPackets
|
||||
uint32 SoundKitID = 0;
|
||||
};
|
||||
|
||||
class MinimapPingClient final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
MinimapPingClient(WorldPacket&& packet) : ClientPacket(MSG_MINIMAP_PING, std::move(packet)) {}
|
||||
|
||||
void Read() override;
|
||||
|
||||
float MapX = 0.0f; // Raw position coordinates
|
||||
float MapY = 0.0f;
|
||||
};
|
||||
|
||||
class MinimapPing final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
MinimapPing() : ServerPacket(MSG_MINIMAP_PING, 8 + 4 + 4) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid SourceGuid;
|
||||
float MapX = 0.0f;
|
||||
float MapY = 0.0f;
|
||||
};
|
||||
|
||||
class RandomRollClient final : public ClientPacket
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -148,6 +148,7 @@ namespace WorldPackets
|
||||
|
||||
namespace Misc
|
||||
{
|
||||
class MinimapPingClient;
|
||||
class RandomRollClient;
|
||||
}
|
||||
|
||||
@@ -933,7 +934,7 @@ public: // opcodes handlers
|
||||
|
||||
void HandleWardenDataOpcode(WorldPacket& recvData);
|
||||
void HandleWorldTeleportOpcode(WorldPacket& recvData);
|
||||
void HandleMinimapPingOpcode(WorldPacket& recvData);
|
||||
void HandleMinimapPingOpcode(WorldPackets::Misc::MinimapPingClient& packet);
|
||||
void HandleRandomRollOpcode(WorldPackets::Misc::RandomRollClient& packet);
|
||||
void HandleFarSightOpcode(WorldPacket& recvData);
|
||||
void HandleSetDungeonDifficultyOpcode(WorldPacket& recvData);
|
||||
|
||||
Reference in New Issue
Block a user