refactor(Core/Packet): Chat (#9509)

* Chat

* .

* Update GameObject.cpp

* Update Object.cpp

* Update Player.cpp
This commit is contained in:
IntelligentQuantum
2022-01-08 13:41:06 +03:30
committed by GitHub
parent 03efc110a0
commit 725b1266b4
20 changed files with 153 additions and 48 deletions

View File

@@ -19,6 +19,7 @@
#include "CellImpl.h"
#include "ChannelMgr.h"
#include "Chat.h"
#include "ChatPackets.h"
#include "Common.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
@@ -669,23 +670,22 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
}
}
void WorldSession::HandleEmoteOpcode(WorldPacket& recvData)
void WorldSession::HandleEmoteOpcode(WorldPackets::Chat::EmoteClient& packet)
{
if (!GetPlayer()->IsAlive() || GetPlayer()->HasUnitState(UNIT_STATE_DIED))
return;
if (GetPlayer()->IsSpectator())
return;
uint32 emote;
recvData >> emote;
uint32 emoteId = packet.EmoteID;
// restrict to the only emotes hardcoded in client
if (emote != EMOTE_ONESHOT_NONE && emote != EMOTE_ONESHOT_WAVE)
if (emoteId != EMOTE_ONESHOT_NONE && emoteId != EMOTE_ONESHOT_WAVE)
return;
sScriptMgr->OnPlayerEmote(GetPlayer(), emote);
GetPlayer()->HandleEmoteCommand(emote);
if (!_player->IsAlive() || _player->HasUnitState(UNIT_STATE_DIED))
return;
sScriptMgr->OnPlayerEmote(_player, emoteId);
_player->HandleEmoteCommand(emoteId);
}
namespace Acore