mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7659] Added several security checks to prevent cheating using facked packets
This commit is contained in:
parent
bd56140537
commit
a0ef77af5b
6 changed files with 68 additions and 19 deletions
|
|
@ -825,10 +825,23 @@ void WorldSession::HandleAutoStoreBagItemOpcode( WorldPacket & recv_data )
|
|||
_player->StoreItem( dest, pItem, true );
|
||||
}
|
||||
|
||||
void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& /*recvPacket*/)
|
||||
void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
CHECK_PACKET_SIZE(recvPacket, 8);
|
||||
|
||||
sLog.outDebug("WORLD: CMSG_BUY_BANK_SLOT");
|
||||
|
||||
uint64 guid;
|
||||
recvPacket >> guid;
|
||||
|
||||
// cheating protection
|
||||
Creature *pCreature = ObjectAccessor::GetNPCIfCanInteractWith(*_player, guid, UNIT_NPC_FLAG_BANKER);
|
||||
if(!pCreature)
|
||||
{
|
||||
sLog.outDebug( "WORLD: HandleBuyBankSlotOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)) );
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 slot = _player->GetByteValue(PLAYER_BYTES_2, 2);
|
||||
|
||||
// next slot
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue