diff --git a/common/patches/laurion.cpp b/common/patches/laurion.cpp index b7ebebf4e..1905ee880 100644 --- a/common/patches/laurion.cpp +++ b/common/patches/laurion.cpp @@ -2859,19 +2859,40 @@ namespace Laurion uchar* __emu_buffer = in->pBuffer; ItemPacket_Struct* old_item_pkt = (ItemPacket_Struct*)__emu_buffer; - switch (old_item_pkt->PacketType) + auto type = ServerToLaurionItemPacketType(old_item_pkt->PacketType); + if (type == structs::ItemPacketInvalid) { + delete in; + return; + } + + switch (type) { - case ItemPacketParcel: { - //parcels are significantly changed so we will need to figure this out + case structs::ItemPacketType::ItemPacketParcel: { + ParcelMessaging_Struct pms{}; + EQ::Util::MemoryStreamReader ss(reinterpret_cast(in->pBuffer), in->size); + cereal::BinaryInputArchive ar(ss); + ar(pms); + + uint32 player_name_length = pms.player_name.length(); + uint32 note_length = pms.note.length(); + + auto* int_struct = (EQ::InternalSerializedItem_Struct*)pms.serialized_item.data(); + + SerializeBuffer buffer; + buffer.WriteInt32((int32_t)type); + SerializeItem(buffer, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType); + + buffer.WriteUInt32(pms.sent_time); + buffer.WriteLengthString(pms.player_name); + buffer.WriteLengthString(pms.note); + + auto outapp = new EQApplicationPacket(OP_ItemPacket, buffer.size()); + outapp->WriteData(buffer.buffer(), buffer.size()); + dest->FastQueuePacket(&outapp, ack_req); + break; } default: { EQ::InternalSerializedItem_Struct* int_struct = (EQ::InternalSerializedItem_Struct*)(&__emu_buffer[4]); - - auto type = ServerToLaurionItemPacketType(old_item_pkt->PacketType); - if (type == structs::ItemPacketInvalid) { - break; - } - SerializeBuffer buffer; buffer.WriteInt32((int32_t)type); SerializeItem(buffer, (const EQ::ItemInstance*)int_struct->inst, int_struct->slot_id, 0, old_item_pkt->PacketType); @@ -4444,6 +4465,14 @@ namespace Laurion return structs::ItemPacketType::ItemPacketCharInventory; case ItemPacketType::ItemPacketLimbo: return structs::ItemPacketType::ItemPacketLimbo; + case ItemPacketType::ItemPacketWorldContainer: + return structs::ItemPacketType::ItemPacketWorldContainer; + case ItemPacketType::ItemPacketTributeItem: + return structs::ItemPacketType::ItemPacketTributeItem; + case ItemPacketType::ItemPacketGuildTribute: + return structs::ItemPacketType::ItemPacketGuildTribute; + case ItemPacketType::ItemPacketCharmUpdate: + return structs::ItemPacketType::ItemPacketCharmUpdate; default: return structs::ItemPacketType::ItemPacketInvalid; } diff --git a/common/patches/laurion_structs.h b/common/patches/laurion_structs.h index 69dc4c387..5546c4a57 100644 --- a/common/patches/laurion_structs.h +++ b/common/patches/laurion_structs.h @@ -609,32 +609,24 @@ namespace Laurion { ItemPacketTradeView = 0x65, ItemPacketLoot = 0x66, ItemPacketTrade = 0x67, + //looks like they added something at 0x68 that didn't exist before and shifted everything after it up by 1 + ItemPacketUnknown068 = 0x68, //Not sure but it seems to deal with the cursor somehow. ItemPacketCharInventory = 0x6A, //Rof 0x69 -> Larion 0x6a (requires translation) ItemPacketLimbo = 0x6B, //0x6A -> 0x6B - //ItemPacketWorldContainer = 0x6B, //These aren't found yet - //ItemPacketTributeItem = 0x6C, - //ItemPacketGuildTribute = 0x6D, - //ItemPacketCharmUpdate = 0x6E, // Larion has a specific packet for this - //ItemPacketRecovery = 0x71, - //ItemPacketParcel = 0x73, + ItemPacketWorldContainer = 0x6C, + ItemPacketTributeItem = 0x6D, + ItemPacketGuildTribute = 0x6E, + ItemPacketCharmUpdate = 0x6f, + ItemPacketRecovery = 0x72, + ItemPacketParcel = 0x74, + ItemPacketUnknown075 = 0x75, //Not sure but uses a lot of the same logic as the trade and char inventory types + ItemPacketOverflow = 0x76, + ItemPacketDragonHoard = 0x77, + ItemPacketTradeskill = 0x78, + ItemPacketTradeskillDepot = 0x79, ItemPacketInvalid = 0xFF }; - /* - enum ItemPacketType - { - ItemPacketViewLink = 0x00, - ItemPacketTradeView = 0x65, - ItemPacketLoot = 0x66, - ItemPacketTrade = 0x67, - ItemPacketCharInventory = 0x69, - ItemPacketSummonItem = 0x6A, - ItemPacketTributeItem = 0x6C, - ItemPacketMerchant = 0x64, - ItemPacketWorldContainer = 0x6B - }; - */ - #pragma pack() }; //end namespace structs