mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Packets: update & enable CMSG_RANDOM_ROLL, SMSG_RANDOM_ROLL, CMSG_EMOTE, CMSG_TEXT_EMOTE and SMSG_TEXT_EMOTE
Documentation used: - Enabled CMSG_TEXT_EMOTE and SMSG_TEXT_EMOTE to 6.1 - Changed CMSG_EMOTE from "0x0B2B" to "0x0B2C". It sends an empty packet but it's meant to stop the current emote as per @Zedron's sniffs. - Updated structure and enabled CMSG_RANDOM_ROLL and SMSG_RANDOM_ROLL. Thanks @rocverde for providing sniffs. Cleaning up last commit
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "MiscPackets.h"
|
||||
|
||||
class Aura;
|
||||
|
||||
@@ -648,13 +649,13 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData)
|
||||
GetPlayer()->GetGroup()->BroadcastPacket(&data, true, -1, GetPlayer()->GetGUID());
|
||||
}
|
||||
|
||||
void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
|
||||
void WorldSession::HandleRandomRollOpcode(WorldPackets::Misc::RandomRollClient& packet)
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: Received CMSG_RANDOM_ROLL");
|
||||
|
||||
uint32 minimum, maximum, roll;
|
||||
recvData >> minimum;
|
||||
recvData >> maximum;
|
||||
minimum = packet.Min;
|
||||
maximum = packet.Max;
|
||||
|
||||
/** error handling **/
|
||||
if (minimum > maximum || maximum > 10000) // < 32768 for urand call
|
||||
@@ -666,15 +667,16 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData)
|
||||
|
||||
//TC_LOG_DEBUG("misc", "ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll);
|
||||
|
||||
WorldPacket data(SMSG_RANDOM_ROLL, 4+4+4+8);
|
||||
data << uint32(minimum);
|
||||
data << uint32(maximum);
|
||||
data << uint32(roll);
|
||||
data << GetPlayer()->GetGUID();
|
||||
WorldPackets::Misc::RandomRoll randomRoll;
|
||||
randomRoll.Min = minimum;
|
||||
randomRoll.Max = maximum;
|
||||
randomRoll.Result = roll;
|
||||
randomRoll.Roller = GetPlayer()->GetGUID();
|
||||
randomRoll.RollerWowAccount = GetAccountGUID();
|
||||
if (GetPlayer()->GetGroup())
|
||||
GetPlayer()->GetGroup()->BroadcastPacket(&data, false);
|
||||
GetPlayer()->GetGroup()->BroadcastPacket(randomRoll.Write(), false);
|
||||
else
|
||||
SendPacket(&data);
|
||||
SendPacket(randomRoll.Write());
|
||||
}
|
||||
|
||||
void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData)
|
||||
|
||||
Reference in New Issue
Block a user