mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[10810] More ObjectGuids specially in petition code.
Some uint64<->uin32 bugs fixed at read guids from DB in petition code. Still exist 29 GUID_LOPART uses in code.
This commit is contained in:
parent
1fbc09e1fd
commit
c6d3c5e0d6
9 changed files with 130 additions and 135 deletions
|
|
@ -649,11 +649,12 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
|||
void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DEBUG_LOG( "WORLD: Received CMSG_BUY_ITEM_IN_SLOT" );
|
||||
uint64 vendorguid, bagguid;
|
||||
ObjectGuid vendorGuid;
|
||||
ObjectGuid bagGuid;
|
||||
uint32 item, slot, count;
|
||||
uint8 bagslot;
|
||||
|
||||
recv_data >> vendorguid >> item >> slot >> bagguid >> bagslot >> count;
|
||||
recv_data >> vendorGuid >> item >> slot >> bagGuid >> bagslot >> count;
|
||||
|
||||
// client side expected counting from 1, and we send to client vendorslot+1 already
|
||||
if (slot > 0)
|
||||
|
|
@ -664,7 +665,7 @@ void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
|||
uint8 bag = NULL_BAG; // init for case invalid bagGUID
|
||||
|
||||
// find bag slot by bag guid
|
||||
if (bagguid == _player->GetGUID())
|
||||
if (bagGuid == _player->GetObjectGuid())
|
||||
bag = INVENTORY_SLOT_BAG_0;
|
||||
else
|
||||
{
|
||||
|
|
@ -672,7 +673,7 @@ void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
|||
{
|
||||
if (Bag *pBag = (Bag*)_player->GetItemByPos(INVENTORY_SLOT_BAG_0,i))
|
||||
{
|
||||
if (bagguid == pBag->GetGUID())
|
||||
if (bagGuid == pBag->GetObjectGuid())
|
||||
{
|
||||
bag = i;
|
||||
break;
|
||||
|
|
@ -685,17 +686,17 @@ void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
|||
if (bag == NULL_BAG)
|
||||
return;
|
||||
|
||||
GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagslot);
|
||||
GetPlayer()->BuyItemFromVendorSlot(vendorGuid, slot, item, count, bag, bagslot);
|
||||
}
|
||||
|
||||
void WorldSession::HandleBuyItemOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DEBUG_LOG( "WORLD: Received CMSG_BUY_ITEM" );
|
||||
uint64 vendorguid;
|
||||
ObjectGuid vendorGuid;
|
||||
uint32 item, slot, count;
|
||||
uint8 unk1;
|
||||
|
||||
recv_data >> vendorguid >> item >> slot >> count >> unk1;
|
||||
recv_data >> vendorGuid >> item >> slot >> count >> unk1;
|
||||
|
||||
// client side expected counting from 1, and we send to client vendorslot+1 already
|
||||
if (slot > 0)
|
||||
|
|
@ -703,7 +704,7 @@ void WorldSession::HandleBuyItemOpcode( WorldPacket & recv_data )
|
|||
else
|
||||
return; // cheating
|
||||
|
||||
GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, NULL_BAG, NULL_SLOT);
|
||||
GetPlayer()->BuyItemFromVendorSlot(vendorGuid, slot, item, count, NULL_BAG, NULL_SLOT);
|
||||
}
|
||||
|
||||
void WorldSession::HandleListInventoryOpcode( WorldPacket & recv_data )
|
||||
|
|
@ -1474,22 +1475,22 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data)
|
|||
*/
|
||||
void WorldSession::HandleItemTextQuery(WorldPacket & recv_data )
|
||||
{
|
||||
uint64 itemGuid;
|
||||
ObjectGuid itemGuid;
|
||||
recv_data >> itemGuid;
|
||||
|
||||
DEBUG_LOG("CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid));
|
||||
DEBUG_LOG("CMSG_ITEM_TEXT_QUERY item guid: %u", itemGuid.GetCounter());
|
||||
|
||||
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size
|
||||
WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10));// guess size
|
||||
|
||||
if(Item *item = _player->GetItemByGuid(itemGuid))
|
||||
{
|
||||
data << uint8(0); // has text
|
||||
data << uint64(itemGuid); // item guid
|
||||
data << uint8(0); // has text
|
||||
data << ObjectGuid(itemGuid); // item guid
|
||||
data << item->GetText();
|
||||
}
|
||||
else
|
||||
{
|
||||
data << uint8(1); // no text
|
||||
data << uint8(1); // no text
|
||||
}
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue