diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-07-28 00:08:24 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-07-28 00:08:24 +0200 |
commit | 7f845294874a9cccfa0f13a6c7dbc9e88f5d3091 (patch) | |
tree | 0d3cb5c5e29b24999ebf05ceccbe639e58fadf76 | |
parent | e773d46f0654741e2df3c9de70402aeee5ed9301 (diff) |
Core/PacketIO: Updated and enabled SMSG_ITEM_PUSH_RESULT
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 17 | ||||
-rw-r--r-- | src/server/game/Server/Packets/ItemPackets.cpp | 22 | ||||
-rw-r--r-- | src/server/game/Server/Packets/ItemPackets.h | 14 | ||||
-rw-r--r-- | src/server/game/Server/Protocol/Opcodes.cpp | 2 |
4 files changed, 34 insertions, 21 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 362a3e98136..3e89952c2e4 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13682,7 +13682,6 @@ void Player::SendNewItem(Item* item, uint32 quantity, bool pushed, bool created, if (!item) // prevent crash return; - /// @todo: fix 6.x implementation WorldPackets::Item::ItemPushResult packet; packet.PlayerGUID = GetGUID(); @@ -13692,20 +13691,22 @@ void Player::SendNewItem(Item* item, uint32 quantity, bool pushed, bool created, packet.Item.Initialize(item); - //packet.ReadUInt32("WodUnk"); + //packet.QuestLogItemID; packet.Quantity = quantity; packet.QuantityInInventory = GetItemCount(item->GetEntry()); - //packet.ReadUInt32("BattlePetBreedID"); - //packet.ReadUInt32("BattlePetBreedQuality"); - //packet.ReadUInt32("BattlePetSpeciesID"); - //packet.ReadUInt32("BattlePetLevel"); + //packet.DungeonEncounterID; + //packet.BattlePetBreedID; + //packet.BattlePetBreedQuality; + //packet.BattlePetSpeciesID; + //packet.BattlePetLevel; packet.ItemGUID = item->GetGUID(); packet.Pushed = pushed; - packet.DisplayText = true; + packet.DisplayText = WorldPackets::Item::ItemPushResult::DISPLAY_TYPE_NORMAL; packet.Created = created; - //packet.ReadBit("IsBonusRoll"); + //packet.IsBonusRoll; + //packet.IsEncounterLoot; if (broadcast && GetGroup()) GetGroup()->BroadcastPacket(packet.Write(), true); diff --git a/src/server/game/Server/Packets/ItemPackets.cpp b/src/server/game/Server/Packets/ItemPackets.cpp index 8b0bec535b3..6d7fdffc73b 100644 --- a/src/server/game/Server/Packets/ItemPackets.cpp +++ b/src/server/game/Server/Packets/ItemPackets.cpp @@ -316,25 +316,27 @@ WorldPacket const* WorldPackets::Item::ItemPushResult::Write() { _worldPacket << PlayerGUID; - _worldPacket << Slot; - _worldPacket << SlotInBag; + _worldPacket << uint8(Slot); + _worldPacket << int32(SlotInBag); _worldPacket << Item; - _worldPacket << WodUnk; - _worldPacket << Quantity; - _worldPacket << QuantityInInventory; - _worldPacket << BattlePetBreedID; - _worldPacket << BattlePetBreedQuality; - _worldPacket << BattlePetSpeciesID; - _worldPacket << BattlePetLevel; + _worldPacket << uint32(QuestLogItemID); + _worldPacket << int32(Quantity); + _worldPacket << int32(QuantityInInventory); + _worldPacket << uint32(DungeonEncounterID); + _worldPacket << int32(BattlePetBreedID); + _worldPacket << int32(BattlePetBreedQuality); + _worldPacket << int32(BattlePetSpeciesID); + _worldPacket << int32(BattlePetLevel); _worldPacket << ItemGUID; _worldPacket.WriteBit(Pushed); _worldPacket.WriteBit(Created); - _worldPacket.WriteBit(DisplayText); + _worldPacket.WriteBits(DisplayText, 2); _worldPacket.WriteBit(IsBonusRoll); + _worldPacket.WriteBit(IsEncounterLoot); _worldPacket.FlushBits(); diff --git a/src/server/game/Server/Packets/ItemPackets.h b/src/server/game/Server/Packets/ItemPackets.h index e73f42bcaf2..69a6c5ab997 100644 --- a/src/server/game/Server/Packets/ItemPackets.h +++ b/src/server/game/Server/Packets/ItemPackets.h @@ -288,6 +288,13 @@ namespace WorldPackets class ItemPushResult final : public ServerPacket { public: + enum DisplayType + { + DISPLAY_TYPE_ENCOUNTER_LOOT = 1, + DISPLAY_TYPE_NORMAL = 2, + DISPLAY_TYPE_HIDDEN = 3 + }; + ItemPushResult() : ServerPacket(SMSG_ITEM_PUSH_RESULT, 16 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 16 + 1 + 1 + 1 + 1) { } WorldPacket const* Write() override; @@ -296,18 +303,21 @@ namespace WorldPackets uint8 Slot = 0; int32 SlotInBag = 0; ItemInstance Item; - uint32 WodUnk = 0; + uint32 QuestLogItemID = 0; // Item ID used for updating quest progress + // only set if different than real ID (similar to CreatureTemplate.KillCredit) int32 Quantity = 0; int32 QuantityInInventory = 0; + uint32 DungeonEncounterID = 0; int32 BattlePetBreedID = 0; uint32 BattlePetBreedQuality = 0; int32 BattlePetSpeciesID = 0; int32 BattlePetLevel = 0; ObjectGuid ItemGUID; bool Pushed = false; - bool DisplayText = false; + DisplayType DisplayText = DISPLAY_TYPE_HIDDEN; bool Created = false; bool IsBonusRoll = false; + bool IsEncounterLoot = false; }; class ReadItem final : public ClientPacket diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index eea26626fcc..fd7b00301b2 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1257,7 +1257,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_ITEM_ENCHANT_TIME_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ITEM_EXPIRE_PURCHASE_REFUND, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ITEM_PURCHASE_REFUND_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_ITEM_PUSH_RESULT, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ITEM_TIME_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEARNED_SPELLS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); |