diff options
author | megamage <none@none> | 2009-08-19 17:07:21 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-19 17:07:21 -0500 |
commit | c9117721255b24d86f00b3f94c6f112fefa5bfdd (patch) | |
tree | 8daf9665b3142c4974c90e38414ae7669db694cc /src/game/ItemHandler.cpp | |
parent | f5085b2f39c91ed0103c79d95f8d18a4ef2a6371 (diff) |
[8389] Implement check really read received packet size and warning it not all data read. Author: VladimirMangos
* This let more easy catch packet structure chnages at client switch.
* Fixed structure CMSG_GUILD_BANK_SWAP_ITEMS
* Fixed structure CMSG_SPLIT_ITEM, CMSG_SELL_ITEM
* Added read data amount fixes for some other packets.
Thanks to TOM_RUS in help check correct packets structure.
Note: not all packets possible fixed. Please report for not fixed cases at errors:
"opcode %s (0x%.4X) have unprocessed tail data (read stop at %u from %u)"
--HG--
branch : trunk
Diffstat (limited to 'src/game/ItemHandler.cpp')
-rw-r--r-- | src/game/ItemHandler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 602e007c7f3..e79f16acfc8 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -32,7 +32,8 @@ void WorldSession::HandleSplitItemOpcode( WorldPacket & recv_data ) { //sLog.outDebug("WORLD: CMSG_SPLIT_ITEM"); - uint8 srcbag, srcslot, dstbag, dstslot, count; + uint8 srcbag, srcslot, dstbag, dstslot; + uint32 count; recv_data >> srcbag >> srcslot >> dstbag >> dstslot >> count; //sLog.outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); @@ -490,12 +491,9 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data ) { sLog.outDebug( "WORLD: Received CMSG_SELL_ITEM" ); uint64 vendorguid, itemguid; - uint8 _count; + uint32 count; - recv_data >> vendorguid >> itemguid >> _count; - - // prevent possible overflow, as Trinity uses uint32 for item count - uint32 count = _count; + recv_data >> vendorguid >> itemguid >> count; if(!itemguid) return; @@ -971,6 +969,8 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) { uint32 itemid; recv_data >> itemid; + recv_data.read_skip<uint64>(); // guid + sLog.outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); ItemPrototype const *pProto = objmgr.GetItemPrototype( itemid ); if( pProto ) |