feat(Core/PacketIO): restrict CMSG_EMOTE/CMSG_STANDSTATECHANGE to only allow emotes/stand states that client can send by itself (#2412)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
parent
ab637800e7
commit
7a1ac8245b
2 changed files with 16 additions and 4 deletions
|
|
@ -642,6 +642,11 @@ void WorldSession::HandleEmoteOpcode(WorldPacket & recvData)
|
|||
|
||||
uint32 emote;
|
||||
recvData >> emote;
|
||||
|
||||
// restrict to the only emotes hardcoded in client
|
||||
if (emote != EMOTE_ONESHOT_NONE && emote != EMOTE_ONESHOT_WAVE)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerEmote(GetPlayer(), emote);
|
||||
GetPlayer()->HandleEmoteCommand(emote);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -549,13 +549,20 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data)
|
|||
|
||||
void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
// too many spam in log at lags/debug stop
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_STANDSTATECHANGE");
|
||||
#endif
|
||||
uint32 animstate;
|
||||
recv_data >> animstate;
|
||||
|
||||
switch (animstate)
|
||||
{
|
||||
case UNIT_STAND_STATE_STAND:
|
||||
case UNIT_STAND_STATE_SIT:
|
||||
case UNIT_STAND_STATE_SLEEP:
|
||||
case UNIT_STAND_STATE_KNEEL:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
_player->SetStandState(animstate);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue