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:
Viste
2019-11-15 12:28:54 +03:00
committed by Kargatum
parent ab637800e7
commit 7a1ac8245b
2 changed files with 16 additions and 4 deletions

View File

@@ -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);
}