diff --git a/common/database.cpp b/common/database.cpp index 141ce1fee..9cf5239c4 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2057,12 +2057,18 @@ void Database::PurgeCharacterParcels() pel.event_type_name = PlayerEvent::EventName[pel.event_type_id]; std::stringstream ss; for (auto const &r: results) { - pd.from_name = r.from_name; - pd.item_id = r.item_id; - pd.note = r.note; - pd.quantity = r.quantity; - pd.sent_date = r.sent_date; - pd.char_id = r.char_id; + pd.from_name = r.from_name; + pd.item_id = r.item_id; + pd.aug_slot_1 = r.aug_slot_1; + pd.aug_slot_2 = r.aug_slot_2; + pd.aug_slot_3 = r.aug_slot_3; + pd.aug_slot_4 = r.aug_slot_4; + pd.aug_slot_5 = r.aug_slot_5; + pd.aug_slot_6 = r.aug_slot_6; + pd.note = r.note; + pd.quantity = r.quantity; + pd.sent_date = r.sent_date; + pd.char_id = r.char_id; { cereal::JSONOutputArchiveSingleLine ar(ss); pd.serialize(ar); diff --git a/common/database/database_update_manifest.cpp b/common/database/database_update_manifest.cpp index 52d453b1d..f596bef98 100644 --- a/common/database/database_update_manifest.cpp +++ b/common/database/database_update_manifest.cpp @@ -5520,6 +5520,22 @@ ALTER TABLE `lootdrop_entries` ADD `content_flags_disabled` varchar(100) NULL; ALTER TABLE `npc_types` ADD COLUMN `is_parcel_merchant` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `keeps_sold_items`; )" + }, + ManifestEntry{ + .version = 9272, + .description = "2024_04_23_add_parcel_support_for_augmented_items.sql", + .check = "SHOW COLUMNS FROM `character_parcels` LIKE 'aug_slot_1'", + .condition = "empty", + .match = "", + .sql = R"( +ALTER TABLE `character_parcels` + ADD COLUMN `aug_slot_1` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `item_id`, + ADD COLUMN `aug_slot_2` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_1`, + ADD COLUMN `aug_slot_3` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_2`, + ADD COLUMN `aug_slot_4` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_3`, + ADD COLUMN `aug_slot_5` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_4`, + ADD COLUMN `aug_slot_6` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `aug_slot_5`; +)" } // -- template; copy/paste this when you need to create a new entry // ManifestEntry{ diff --git a/common/events/player_events.h b/common/events/player_events.h index a7d5e0c10..16440ad9a 100644 --- a/common/events/player_events.h +++ b/common/events/player_events.h @@ -988,6 +988,12 @@ namespace PlayerEvent { uint32 quantity; std::string from_player_name; uint32 sent_date; + uint32 aug_slot_1; + uint32 aug_slot_2; + uint32 aug_slot_3; + uint32 aug_slot_4; + uint32 aug_slot_5; + uint32 aug_slot_6; // cereal template @@ -997,7 +1003,13 @@ namespace PlayerEvent { CEREAL_NVP(item_id), CEREAL_NVP(quantity), CEREAL_NVP(from_player_name), - CEREAL_NVP(sent_date) + CEREAL_NVP(sent_date), + CEREAL_NVP(aug_slot_1), + CEREAL_NVP(aug_slot_2), + CEREAL_NVP(aug_slot_3), + CEREAL_NVP(aug_slot_4), + CEREAL_NVP(aug_slot_5), + CEREAL_NVP(aug_slot_6) ); } }; @@ -1008,6 +1020,12 @@ namespace PlayerEvent { std::string from_player_name; std::string to_player_name; uint32 sent_date; + uint32 aug_slot_1; + uint32 aug_slot_2; + uint32 aug_slot_3; + uint32 aug_slot_4; + uint32 aug_slot_5; + uint32 aug_slot_6; // cereal template @@ -1018,7 +1036,13 @@ namespace PlayerEvent { CEREAL_NVP(quantity), CEREAL_NVP(from_player_name), CEREAL_NVP(to_player_name), - CEREAL_NVP(sent_date) + CEREAL_NVP(sent_date), + CEREAL_NVP(aug_slot_1), + CEREAL_NVP(aug_slot_2), + CEREAL_NVP(aug_slot_3), + CEREAL_NVP(aug_slot_4), + CEREAL_NVP(aug_slot_5), + CEREAL_NVP(aug_slot_6) ); } }; @@ -1030,6 +1054,12 @@ namespace PlayerEvent { std::string from_name; std::string note; uint32 sent_date; + uint32 aug_slot_1; + uint32 aug_slot_2; + uint32 aug_slot_3; + uint32 aug_slot_4; + uint32 aug_slot_5; + uint32 aug_slot_6; // cereal template @@ -1041,7 +1071,14 @@ namespace PlayerEvent { CEREAL_NVP(char_id), CEREAL_NVP(from_name), CEREAL_NVP(note), - CEREAL_NVP(sent_date)); + CEREAL_NVP(sent_date), + CEREAL_NVP(aug_slot_1), + CEREAL_NVP(aug_slot_2), + CEREAL_NVP(aug_slot_3), + CEREAL_NVP(aug_slot_4), + CEREAL_NVP(aug_slot_5), + CEREAL_NVP(aug_slot_6) + ); } }; } diff --git a/common/repositories/base/base_character_parcels_repository.h b/common/repositories/base/base_character_parcels_repository.h index 8bb6c6b3c..9263f307b 100644 --- a/common/repositories/base/base_character_parcels_repository.h +++ b/common/repositories/base/base_character_parcels_repository.h @@ -22,6 +22,12 @@ public: uint32_t id; uint32_t char_id; uint32_t item_id; + uint32_t aug_slot_1; + uint32_t aug_slot_2; + uint32_t aug_slot_3; + uint32_t aug_slot_4; + uint32_t aug_slot_5; + uint32_t aug_slot_6; uint32_t slot_id; uint32_t quantity; std::string from_name; @@ -40,6 +46,12 @@ public: "id", "char_id", "item_id", + "aug_slot_1", + "aug_slot_2", + "aug_slot_3", + "aug_slot_4", + "aug_slot_5", + "aug_slot_6", "slot_id", "quantity", "from_name", @@ -54,6 +66,12 @@ public: "id", "char_id", "item_id", + "aug_slot_1", + "aug_slot_2", + "aug_slot_3", + "aug_slot_4", + "aug_slot_5", + "aug_slot_6", "slot_id", "quantity", "from_name", @@ -99,14 +117,20 @@ public: { CharacterParcels e{}; - e.id = 0; - e.char_id = 0; - e.item_id = 0; - e.slot_id = 0; - e.quantity = 0; - e.from_name = ""; - e.note = ""; - e.sent_date = 0; + e.id = 0; + e.char_id = 0; + e.item_id = 0; + e.aug_slot_1 = 0; + e.aug_slot_2 = 0; + e.aug_slot_3 = 0; + e.aug_slot_4 = 0; + e.aug_slot_5 = 0; + e.aug_slot_6 = 0; + e.slot_id = 0; + e.quantity = 0; + e.from_name = ""; + e.note = ""; + e.sent_date = 0; return e; } @@ -143,14 +167,20 @@ public: if (results.RowCount() == 1) { CharacterParcels e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.slot_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.quantity = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.from_name = row[5] ? row[5] : ""; - e.note = row[6] ? row[6] : ""; - e.sent_date = strtoll(row[7] ? row[7] : "-1", nullptr, 10); + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.from_name = row[11] ? row[11] : ""; + e.note = row[12] ? row[12] : ""; + e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10); return e; } @@ -186,11 +216,17 @@ public: v.push_back(columns[1] + " = " + std::to_string(e.char_id)); v.push_back(columns[2] + " = " + std::to_string(e.item_id)); - v.push_back(columns[3] + " = " + std::to_string(e.slot_id)); - v.push_back(columns[4] + " = " + std::to_string(e.quantity)); - v.push_back(columns[5] + " = '" + Strings::Escape(e.from_name) + "'"); - v.push_back(columns[6] + " = '" + Strings::Escape(e.note) + "'"); - v.push_back(columns[7] + " = FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); + v.push_back(columns[3] + " = " + std::to_string(e.aug_slot_1)); + v.push_back(columns[4] + " = " + std::to_string(e.aug_slot_2)); + v.push_back(columns[5] + " = " + std::to_string(e.aug_slot_3)); + v.push_back(columns[6] + " = " + std::to_string(e.aug_slot_4)); + v.push_back(columns[7] + " = " + std::to_string(e.aug_slot_5)); + v.push_back(columns[8] + " = " + std::to_string(e.aug_slot_6)); + v.push_back(columns[9] + " = " + std::to_string(e.slot_id)); + v.push_back(columns[10] + " = " + std::to_string(e.quantity)); + v.push_back(columns[11] + " = '" + Strings::Escape(e.from_name) + "'"); + v.push_back(columns[12] + " = '" + Strings::Escape(e.note) + "'"); + v.push_back(columns[13] + " = FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")"); auto results = db.QueryDatabase( fmt::format( @@ -215,6 +251,12 @@ public: v.push_back(std::to_string(e.id)); v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.item_id)); + v.push_back(std::to_string(e.aug_slot_1)); + v.push_back(std::to_string(e.aug_slot_2)); + v.push_back(std::to_string(e.aug_slot_3)); + v.push_back(std::to_string(e.aug_slot_4)); + v.push_back(std::to_string(e.aug_slot_5)); + v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); @@ -252,6 +294,12 @@ public: v.push_back(std::to_string(e.id)); v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.item_id)); + v.push_back(std::to_string(e.aug_slot_1)); + v.push_back(std::to_string(e.aug_slot_2)); + v.push_back(std::to_string(e.aug_slot_3)); + v.push_back(std::to_string(e.aug_slot_4)); + v.push_back(std::to_string(e.aug_slot_5)); + v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); @@ -290,14 +338,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterParcels e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.slot_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.quantity = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.from_name = row[5] ? row[5] : ""; - e.note = row[6] ? row[6] : ""; - e.sent_date = strtoll(row[7] ? row[7] : "-1", nullptr, 10); + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.from_name = row[11] ? row[11] : ""; + e.note = row[12] ? row[12] : ""; + e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10); all_entries.push_back(e); } @@ -322,14 +376,20 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { CharacterParcels e{}; - e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; - e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; - e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; - e.slot_id = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; - e.quantity = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; - e.from_name = row[5] ? row[5] : ""; - e.note = row[6] ? row[6] : ""; - e.sent_date = strtoll(row[7] ? row[7] : "-1", nullptr, 10); + e.id = row[0] ? static_cast(strtoul(row[0], nullptr, 10)) : 0; + e.char_id = row[1] ? static_cast(strtoul(row[1], nullptr, 10)) : 0; + e.item_id = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; + e.aug_slot_1 = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; + e.aug_slot_2 = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 0; + e.aug_slot_3 = row[5] ? static_cast(strtoul(row[5], nullptr, 10)) : 0; + e.aug_slot_4 = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; + e.aug_slot_5 = row[7] ? static_cast(strtoul(row[7], nullptr, 10)) : 0; + e.aug_slot_6 = row[8] ? static_cast(strtoul(row[8], nullptr, 10)) : 0; + e.slot_id = row[9] ? static_cast(strtoul(row[9], nullptr, 10)) : 0; + e.quantity = row[10] ? static_cast(strtoul(row[10], nullptr, 10)) : 0; + e.from_name = row[11] ? row[11] : ""; + e.note = row[12] ? row[12] : ""; + e.sent_date = strtoll(row[13] ? row[13] : "-1", nullptr, 10); all_entries.push_back(e); } @@ -407,6 +467,12 @@ public: v.push_back(std::to_string(e.id)); v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.item_id)); + v.push_back(std::to_string(e.aug_slot_1)); + v.push_back(std::to_string(e.aug_slot_2)); + v.push_back(std::to_string(e.aug_slot_3)); + v.push_back(std::to_string(e.aug_slot_4)); + v.push_back(std::to_string(e.aug_slot_5)); + v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); @@ -437,6 +503,12 @@ public: v.push_back(std::to_string(e.id)); v.push_back(std::to_string(e.char_id)); v.push_back(std::to_string(e.item_id)); + v.push_back(std::to_string(e.aug_slot_1)); + v.push_back(std::to_string(e.aug_slot_2)); + v.push_back(std::to_string(e.aug_slot_3)); + v.push_back(std::to_string(e.aug_slot_4)); + v.push_back(std::to_string(e.aug_slot_5)); + v.push_back(std::to_string(e.aug_slot_6)); v.push_back(std::to_string(e.slot_id)); v.push_back(std::to_string(e.quantity)); v.push_back("'" + Strings::Escape(e.from_name) + "'"); diff --git a/common/version.h b/common/version.h index 3f885bfdc..d70abf7d9 100644 --- a/common/version.h +++ b/common/version.h @@ -42,7 +42,7 @@ * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt */ -#define CURRENT_BINARY_DATABASE_VERSION 9271 +#define CURRENT_BINARY_DATABASE_VERSION 9272 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9043 #endif diff --git a/zone/parcels.cpp b/zone/parcels.cpp index dc92a9d92..6304a1951 100644 --- a/zone/parcels.cpp +++ b/zone/parcels.cpp @@ -45,7 +45,16 @@ void Client::SendBulkParcels() for (auto &p: m_parcels) { auto item = database.GetItem(p.second.item_id); if (item) { - std::unique_ptr inst(database.CreateItem(item, p.second.quantity)); + std::unique_ptr inst(database.CreateItem( + item, + p.second.quantity, + p.second.aug_slot_1, + p.second.aug_slot_2, + p.second.aug_slot_3, + p.second.aug_slot_4, + p.second.aug_slot_5, + p.second.aug_slot_6 + )); if (inst) { inst->SetCharges(p.second.quantity > 0 ? p.second.quantity : 1); inst->SetMerchantCount(1); @@ -112,43 +121,61 @@ void Client::SendParcel(const Parcel_Struct &parcel_in) return; } + const auto& r = results.front(); + ParcelMessaging_Struct pms{}; pms.packet_type = ItemPacketParcel; std::stringstream ss; cereal::BinaryOutputArchive ar(ss); - CharacterParcelsRepository::CharacterParcels parcel{}; - parcel.from_name = results[0].from_name; - parcel.id = results[0].id; - parcel.note = results[0].note; - parcel.quantity = results[0].quantity; - parcel.sent_date = results[0].sent_date; - parcel.item_id = results[0].item_id; - parcel.slot_id = results[0].slot_id; - parcel.char_id = results[0].char_id; + CharacterParcelsRepository::CharacterParcels p{}; - auto item = database.GetItem(parcel.item_id); + p.from_name = r.from_name; + p.id = r.id; + p.note = r.note; + p.quantity = r.quantity; + p.sent_date = r.sent_date; + p.item_id = r.item_id; + p.aug_slot_1 = r.aug_slot_1; + p.aug_slot_2 = r.aug_slot_2; + p.aug_slot_3 = r.aug_slot_3; + p.aug_slot_4 = r.aug_slot_4; + p.aug_slot_5 = r.aug_slot_5; + p.aug_slot_6 = r.aug_slot_6; + p.slot_id = r.slot_id; + p.char_id = r.char_id; + + auto item = database.GetItem(p.item_id); if (item) { - std::unique_ptr inst(database.CreateItem(item, parcel.quantity)); + std::unique_ptr inst(database.CreateItem( + item, + p.quantity, + p.aug_slot_1, + p.aug_slot_2, + p.aug_slot_3, + p.aug_slot_4, + p.aug_slot_5, + p.aug_slot_6 + )); if (inst) { - inst->SetCharges(parcel.quantity > 0 ? parcel.quantity : 1); + inst->SetCharges(p.quantity > 0 ? p.quantity : 1); inst->SetMerchantCount(1); - inst->SetMerchantSlot(parcel.slot_id); + inst->SetMerchantSlot(p.slot_id); if (inst->IsStackable()) { - inst->SetCharges(parcel.quantity); + inst->SetCharges(p.quantity); } if (item->ID == PARCEL_MONEY_ITEM_ID) { - inst->SetPrice(parcel.quantity); + inst->SetPrice(p.quantity); inst->SetCharges(1); } - pms.player_name = parcel.from_name; - pms.sent_time = parcel.sent_date; - pms.note = parcel.note; - pms.serialized_item = inst->Serialize(parcel.slot_id); - pms.slot_id = parcel.slot_id; + pms.player_name = p.from_name; + pms.sent_time = p.sent_date; + pms.note = p.note; + pms.serialized_item = inst->Serialize(p.slot_id); + pms.slot_id = p.slot_id; ar(pms); uint32 packet_size = ss.str().length(); @@ -168,7 +195,7 @@ void Client::SendParcel(const Parcel_Struct &parcel_in) ss.str(""); ss.clear(); - m_parcels.emplace(parcel.slot_id, parcel); + m_parcels.emplace(p.slot_id, p); } } } @@ -343,7 +370,7 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in) quantity = inst->GetCharges() > 0 ? inst->GetCharges() : parcel_in->quantity; } - CharacterParcelsRepository::CharacterParcels parcel_out; + CharacterParcelsRepository::CharacterParcels parcel_out{}; parcel_out.from_name = GetName(); parcel_out.note = parcel_in->note; parcel_out.sent_date = time(nullptr); @@ -353,6 +380,16 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in) parcel_out.slot_id = next_slot; parcel_out.id = 0; + if (inst->IsAugmented()) { + auto augs = inst->GetAugmentIDs(); + parcel_out.aug_slot_1 = augs.at(0); + parcel_out.aug_slot_2 = augs.at(1); + parcel_out.aug_slot_3 = augs.at(2); + parcel_out.aug_slot_4 = augs.at(3); + parcel_out.aug_slot_5 = augs.at(4); + parcel_out.aug_slot_6 = augs.at(5); + } + auto result = CharacterParcelsRepository::InsertOne(database, parcel_out); if (!result.id) { LogError( @@ -388,6 +425,12 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in) e.from_player_name = parcel_out.from_name; e.to_player_name = send_to_client.at(0).character_name; e.item_id = parcel_out.item_id; + e.aug_slot_1 = parcel_out.aug_slot_1; + e.aug_slot_2 = parcel_out.aug_slot_2; + e.aug_slot_3 = parcel_out.aug_slot_3; + e.aug_slot_4 = parcel_out.aug_slot_4; + e.aug_slot_5 = parcel_out.aug_slot_5; + e.aug_slot_6 = parcel_out.aug_slot_6; e.quantity = parcel_out.quantity; e.sent_date = parcel_out.sent_date; @@ -430,7 +473,7 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in) return; } - CharacterParcelsRepository::CharacterParcels parcel_out; + CharacterParcelsRepository::CharacterParcels parcel_out{}; parcel_out.from_name = GetName(); parcel_out.note = parcel_in->note; parcel_out.sent_date = time(nullptr); @@ -548,7 +591,17 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in) return; } - std::unique_ptr inst(database.CreateItem(item_id, item_quantity)); + std::unique_ptr inst(database.CreateItem( + item_id, + item_quantity, + p->second.aug_slot_1, + p->second.aug_slot_2, + p->second.aug_slot_3, + p->second.aug_slot_4, + p->second.aug_slot_5, + p->second.aug_slot_6 + ) + ); if (!inst) { SendParcelRetrieveAck(); return; @@ -561,7 +614,7 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in) Chat::Yellow, PARCEL_DELIVERED, merchant->GetCleanName(), - "Money", //inst->DetermineMoneyStringForParcels(p->second.quantity).c_str(), + "Money", p->second.from_name.c_str() ); break; @@ -638,6 +691,12 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in) PlayerEvent::ParcelRetrieve e{}; e.from_player_name = p->second.from_name; e.item_id = p->second.item_id; + e.aug_slot_1 = p->second.aug_slot_1; + e.aug_slot_2 = p->second.aug_slot_2; + e.aug_slot_3 = p->second.aug_slot_3; + e.aug_slot_4 = p->second.aug_slot_4; + e.aug_slot_5 = p->second.aug_slot_5; + e.aug_slot_6 = p->second.aug_slot_6; e.quantity = p->second.quantity; e.sent_date = p->second.sent_date;