Skip to content

Commit

Permalink
[Core/Packet] Split SMSG_BINDER_CONFIRM to MiscPackets (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
leelf00 authored Oct 9, 2024
1 parent 8d05761 commit fb43d6a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/server/game/Entities/Player/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10599,26 +10599,8 @@ uint32 Player::GetXPRestBonus(uint32 xp)

void Player::SetBindPoint(ObjectGuid guid)
{
WorldPacket data(SMSG_BINDER_CONFIRM, 9);
data.WriteBit(guid[4]);
data.WriteBit(guid[6]);
data.WriteBit(guid[2]);
data.WriteBit(guid[1]);
data.WriteBit(guid[5]);
data.WriteBit(guid[3]);
data.WriteBit(guid[0]);
data.WriteBit(guid[7]);
data.FlushBits();

data.WriteByteSeq(guid[6]);
data.WriteByteSeq(guid[2]);
data.WriteByteSeq(guid[5]);
data.WriteByteSeq(guid[0]);
data.WriteByteSeq(guid[4]);
data.WriteByteSeq(guid[7]);
data.WriteByteSeq(guid[1]);
data.WriteByteSeq(guid[3]);
GetSession()->SendPacket(&data);
WorldPackets::Misc::BinderConfirm packet(guid);
SendDirectMessage(packet.Write());
}

void Player::SendTalentWipeConfirm(ObjectGuid guid, bool resetType)
Expand Down
23 changes: 23 additions & 0 deletions src/server/game/Server/Packets/MiscPackets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,35 @@

#include "MiscPackets.h"

WorldPacket const* WorldPackets::Misc::BinderConfirm::Write()
{
_worldPacket.WriteBit(Unit[4]);
_worldPacket.WriteBit(Unit[6]);
_worldPacket.WriteBit(Unit[2]);
_worldPacket.WriteBit(Unit[1]);
_worldPacket.WriteBit(Unit[5]);
_worldPacket.WriteBit(Unit[3]);
_worldPacket.WriteBit(Unit[0]);
_worldPacket.WriteBit(Unit[7]);

_worldPacket.WriteByteSeq(Unit[6]);
_worldPacket.WriteByteSeq(Unit[2]);
_worldPacket.WriteByteSeq(Unit[5]);
_worldPacket.WriteByteSeq(Unit[0]);
_worldPacket.WriteByteSeq(Unit[4]);
_worldPacket.WriteByteSeq(Unit[7]);
_worldPacket.WriteByteSeq(Unit[1]);
_worldPacket.WriteByteSeq(Unit[3]);
return &_worldPacket;
}

WorldPacket const* WorldPackets::Misc::TriggerCinematic::Write()
{
_worldPacket << uint32(CinematicID);

return &_worldPacket;
}

WorldPacket const* WorldPackets::Misc::TriggerMovie::Write()
{
_worldPacket << uint32(MovieID);
Expand Down
11 changes: 11 additions & 0 deletions src/server/game/Server/Packets/MiscPackets.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ namespace WorldPackets
{
namespace Misc
{
class BinderConfirm final : public ServerPacket
{
public:
BinderConfirm() : ServerPacket(SMSG_BINDER_CONFIRM, 8) { }
BinderConfirm(ObjectGuid unit) : ServerPacket(SMSG_BINDER_CONFIRM, 8), Unit(unit) { }

WorldPacket const* Write() override;

ObjectGuid Unit;
};

class TriggerCinematic final : public ServerPacket
{
public:
Expand Down

0 comments on commit fb43d6a

Please sign in to comment.