mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[Feature] Add Augmentation Support for Parcels (#4285)
* Add Augmentation Support for Parcels Add Augmentation Support for Parcels * Formatting Updates * Move augment columns. --------- Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
parent
99612ba7b3
commit
1e0373a3e3
@ -2059,6 +2059,12 @@ void Database::PurgeCharacterParcels()
|
|||||||
for (auto const &r: results) {
|
for (auto const &r: results) {
|
||||||
pd.from_name = r.from_name;
|
pd.from_name = r.from_name;
|
||||||
pd.item_id = r.item_id;
|
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.note = r.note;
|
||||||
pd.quantity = r.quantity;
|
pd.quantity = r.quantity;
|
||||||
pd.sent_date = r.sent_date;
|
pd.sent_date = r.sent_date;
|
||||||
|
|||||||
@ -5520,6 +5520,22 @@ ALTER TABLE `lootdrop_entries` ADD `content_flags_disabled` varchar(100) NULL;
|
|||||||
ALTER TABLE `npc_types`
|
ALTER TABLE `npc_types`
|
||||||
ADD COLUMN `is_parcel_merchant` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `keeps_sold_items`;
|
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
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
// ManifestEntry{
|
// ManifestEntry{
|
||||||
|
|||||||
@ -988,6 +988,12 @@ namespace PlayerEvent {
|
|||||||
uint32 quantity;
|
uint32 quantity;
|
||||||
std::string from_player_name;
|
std::string from_player_name;
|
||||||
uint32 sent_date;
|
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
|
// cereal
|
||||||
template<class Archive>
|
template<class Archive>
|
||||||
@ -997,7 +1003,13 @@ namespace PlayerEvent {
|
|||||||
CEREAL_NVP(item_id),
|
CEREAL_NVP(item_id),
|
||||||
CEREAL_NVP(quantity),
|
CEREAL_NVP(quantity),
|
||||||
CEREAL_NVP(from_player_name),
|
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 from_player_name;
|
||||||
std::string to_player_name;
|
std::string to_player_name;
|
||||||
uint32 sent_date;
|
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
|
// cereal
|
||||||
template<class Archive>
|
template<class Archive>
|
||||||
@ -1018,7 +1036,13 @@ namespace PlayerEvent {
|
|||||||
CEREAL_NVP(quantity),
|
CEREAL_NVP(quantity),
|
||||||
CEREAL_NVP(from_player_name),
|
CEREAL_NVP(from_player_name),
|
||||||
CEREAL_NVP(to_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 from_name;
|
||||||
std::string note;
|
std::string note;
|
||||||
uint32 sent_date;
|
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
|
// cereal
|
||||||
template<class Archive>
|
template<class Archive>
|
||||||
@ -1041,7 +1071,14 @@ namespace PlayerEvent {
|
|||||||
CEREAL_NVP(char_id),
|
CEREAL_NVP(char_id),
|
||||||
CEREAL_NVP(from_name),
|
CEREAL_NVP(from_name),
|
||||||
CEREAL_NVP(note),
|
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)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,12 @@ public:
|
|||||||
uint32_t id;
|
uint32_t id;
|
||||||
uint32_t char_id;
|
uint32_t char_id;
|
||||||
uint32_t item_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 slot_id;
|
||||||
uint32_t quantity;
|
uint32_t quantity;
|
||||||
std::string from_name;
|
std::string from_name;
|
||||||
@ -40,6 +46,12 @@ public:
|
|||||||
"id",
|
"id",
|
||||||
"char_id",
|
"char_id",
|
||||||
"item_id",
|
"item_id",
|
||||||
|
"aug_slot_1",
|
||||||
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
"slot_id",
|
"slot_id",
|
||||||
"quantity",
|
"quantity",
|
||||||
"from_name",
|
"from_name",
|
||||||
@ -54,6 +66,12 @@ public:
|
|||||||
"id",
|
"id",
|
||||||
"char_id",
|
"char_id",
|
||||||
"item_id",
|
"item_id",
|
||||||
|
"aug_slot_1",
|
||||||
|
"aug_slot_2",
|
||||||
|
"aug_slot_3",
|
||||||
|
"aug_slot_4",
|
||||||
|
"aug_slot_5",
|
||||||
|
"aug_slot_6",
|
||||||
"slot_id",
|
"slot_id",
|
||||||
"quantity",
|
"quantity",
|
||||||
"from_name",
|
"from_name",
|
||||||
@ -102,6 +120,12 @@ public:
|
|||||||
e.id = 0;
|
e.id = 0;
|
||||||
e.char_id = 0;
|
e.char_id = 0;
|
||||||
e.item_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.slot_id = 0;
|
||||||
e.quantity = 0;
|
e.quantity = 0;
|
||||||
e.from_name = "";
|
e.from_name = "";
|
||||||
@ -146,11 +170,17 @@ public:
|
|||||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.quantity = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.from_name = row[5] ? row[5] : "";
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.note = row[6] ? row[6] : "";
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.sent_date = strtoll(row[7] ? row[7] : "-1", nullptr, 10);
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(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;
|
return e;
|
||||||
}
|
}
|
||||||
@ -186,11 +216,17 @@ public:
|
|||||||
|
|
||||||
v.push_back(columns[1] + " = " + std::to_string(e.char_id));
|
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[2] + " = " + std::to_string(e.item_id));
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.slot_id));
|
v.push_back(columns[3] + " = " + std::to_string(e.aug_slot_1));
|
||||||
v.push_back(columns[4] + " = " + std::to_string(e.quantity));
|
v.push_back(columns[4] + " = " + std::to_string(e.aug_slot_2));
|
||||||
v.push_back(columns[5] + " = '" + Strings::Escape(e.from_name) + "'");
|
v.push_back(columns[5] + " = " + std::to_string(e.aug_slot_3));
|
||||||
v.push_back(columns[6] + " = '" + Strings::Escape(e.note) + "'");
|
v.push_back(columns[6] + " = " + std::to_string(e.aug_slot_4));
|
||||||
v.push_back(columns[7] + " = FROM_UNIXTIME(" + (e.sent_date > 0 ? std::to_string(e.sent_date) : "null") + ")");
|
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(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@ -215,6 +251,12 @@ public:
|
|||||||
v.push_back(std::to_string(e.id));
|
v.push_back(std::to_string(e.id));
|
||||||
v.push_back(std::to_string(e.char_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.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.slot_id));
|
||||||
v.push_back(std::to_string(e.quantity));
|
v.push_back(std::to_string(e.quantity));
|
||||||
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
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.id));
|
||||||
v.push_back(std::to_string(e.char_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.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.slot_id));
|
||||||
v.push_back(std::to_string(e.quantity));
|
v.push_back(std::to_string(e.quantity));
|
||||||
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
||||||
@ -293,11 +341,17 @@ public:
|
|||||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.quantity = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.from_name = row[5] ? row[5] : "";
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.note = row[6] ? row[6] : "";
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.sent_date = strtoll(row[7] ? row[7] : "-1", nullptr, 10);
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(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);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@ -325,11 +379,17 @@ public:
|
|||||||
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
e.id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
|
||||||
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
e.char_id = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
|
||||||
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.item_id = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.aug_slot_1 = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.quantity = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
e.aug_slot_2 = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
|
||||||
e.from_name = row[5] ? row[5] : "";
|
e.aug_slot_3 = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.note = row[6] ? row[6] : "";
|
e.aug_slot_4 = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.sent_date = strtoll(row[7] ? row[7] : "-1", nullptr, 10);
|
e.aug_slot_5 = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
|
e.aug_slot_6 = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
|
e.quantity = row[10] ? static_cast<uint32_t>(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);
|
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.id));
|
||||||
v.push_back(std::to_string(e.char_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.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.slot_id));
|
||||||
v.push_back(std::to_string(e.quantity));
|
v.push_back(std::to_string(e.quantity));
|
||||||
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
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.id));
|
||||||
v.push_back(std::to_string(e.char_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.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.slot_id));
|
||||||
v.push_back(std::to_string(e.quantity));
|
v.push_back(std::to_string(e.quantity));
|
||||||
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
v.push_back("'" + Strings::Escape(e.from_name) + "'");
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
* 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
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9043
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
111
zone/parcels.cpp
111
zone/parcels.cpp
@ -45,7 +45,16 @@ void Client::SendBulkParcels()
|
|||||||
for (auto &p: m_parcels) {
|
for (auto &p: m_parcels) {
|
||||||
auto item = database.GetItem(p.second.item_id);
|
auto item = database.GetItem(p.second.item_id);
|
||||||
if (item) {
|
if (item) {
|
||||||
std::unique_ptr<EQ::ItemInstance> inst(database.CreateItem(item, p.second.quantity));
|
std::unique_ptr<EQ::ItemInstance> 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) {
|
if (inst) {
|
||||||
inst->SetCharges(p.second.quantity > 0 ? p.second.quantity : 1);
|
inst->SetCharges(p.second.quantity > 0 ? p.second.quantity : 1);
|
||||||
inst->SetMerchantCount(1);
|
inst->SetMerchantCount(1);
|
||||||
@ -112,43 +121,61 @@ void Client::SendParcel(const Parcel_Struct &parcel_in)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto& r = results.front();
|
||||||
|
|
||||||
ParcelMessaging_Struct pms{};
|
ParcelMessaging_Struct pms{};
|
||||||
pms.packet_type = ItemPacketParcel;
|
pms.packet_type = ItemPacketParcel;
|
||||||
|
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
cereal::BinaryOutputArchive ar(ss);
|
cereal::BinaryOutputArchive ar(ss);
|
||||||
|
|
||||||
CharacterParcelsRepository::CharacterParcels parcel{};
|
CharacterParcelsRepository::CharacterParcels p{};
|
||||||
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;
|
|
||||||
|
|
||||||
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) {
|
if (item) {
|
||||||
std::unique_ptr<EQ::ItemInstance> inst(database.CreateItem(item, parcel.quantity));
|
std::unique_ptr<EQ::ItemInstance> 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) {
|
if (inst) {
|
||||||
inst->SetCharges(parcel.quantity > 0 ? parcel.quantity : 1);
|
inst->SetCharges(p.quantity > 0 ? p.quantity : 1);
|
||||||
inst->SetMerchantCount(1);
|
inst->SetMerchantCount(1);
|
||||||
inst->SetMerchantSlot(parcel.slot_id);
|
inst->SetMerchantSlot(p.slot_id);
|
||||||
if (inst->IsStackable()) {
|
if (inst->IsStackable()) {
|
||||||
inst->SetCharges(parcel.quantity);
|
inst->SetCharges(p.quantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->ID == PARCEL_MONEY_ITEM_ID) {
|
if (item->ID == PARCEL_MONEY_ITEM_ID) {
|
||||||
inst->SetPrice(parcel.quantity);
|
inst->SetPrice(p.quantity);
|
||||||
inst->SetCharges(1);
|
inst->SetCharges(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
pms.player_name = parcel.from_name;
|
pms.player_name = p.from_name;
|
||||||
pms.sent_time = parcel.sent_date;
|
pms.sent_time = p.sent_date;
|
||||||
pms.note = parcel.note;
|
pms.note = p.note;
|
||||||
pms.serialized_item = inst->Serialize(parcel.slot_id);
|
pms.serialized_item = inst->Serialize(p.slot_id);
|
||||||
pms.slot_id = parcel.slot_id;
|
pms.slot_id = p.slot_id;
|
||||||
ar(pms);
|
ar(pms);
|
||||||
|
|
||||||
uint32 packet_size = ss.str().length();
|
uint32 packet_size = ss.str().length();
|
||||||
@ -168,7 +195,7 @@ void Client::SendParcel(const Parcel_Struct &parcel_in)
|
|||||||
ss.str("");
|
ss.str("");
|
||||||
ss.clear();
|
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;
|
quantity = inst->GetCharges() > 0 ? inst->GetCharges() : parcel_in->quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterParcelsRepository::CharacterParcels parcel_out;
|
CharacterParcelsRepository::CharacterParcels parcel_out{};
|
||||||
parcel_out.from_name = GetName();
|
parcel_out.from_name = GetName();
|
||||||
parcel_out.note = parcel_in->note;
|
parcel_out.note = parcel_in->note;
|
||||||
parcel_out.sent_date = time(nullptr);
|
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.slot_id = next_slot;
|
||||||
parcel_out.id = 0;
|
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);
|
auto result = CharacterParcelsRepository::InsertOne(database, parcel_out);
|
||||||
if (!result.id) {
|
if (!result.id) {
|
||||||
LogError(
|
LogError(
|
||||||
@ -388,6 +425,12 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in)
|
|||||||
e.from_player_name = parcel_out.from_name;
|
e.from_player_name = parcel_out.from_name;
|
||||||
e.to_player_name = send_to_client.at(0).character_name;
|
e.to_player_name = send_to_client.at(0).character_name;
|
||||||
e.item_id = parcel_out.item_id;
|
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.quantity = parcel_out.quantity;
|
||||||
e.sent_date = parcel_out.sent_date;
|
e.sent_date = parcel_out.sent_date;
|
||||||
|
|
||||||
@ -430,7 +473,7 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterParcelsRepository::CharacterParcels parcel_out;
|
CharacterParcelsRepository::CharacterParcels parcel_out{};
|
||||||
parcel_out.from_name = GetName();
|
parcel_out.from_name = GetName();
|
||||||
parcel_out.note = parcel_in->note;
|
parcel_out.note = parcel_in->note;
|
||||||
parcel_out.sent_date = time(nullptr);
|
parcel_out.sent_date = time(nullptr);
|
||||||
@ -548,7 +591,17 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<EQ::ItemInstance> inst(database.CreateItem(item_id, item_quantity));
|
std::unique_ptr<EQ::ItemInstance> 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) {
|
if (!inst) {
|
||||||
SendParcelRetrieveAck();
|
SendParcelRetrieveAck();
|
||||||
return;
|
return;
|
||||||
@ -561,7 +614,7 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in)
|
|||||||
Chat::Yellow,
|
Chat::Yellow,
|
||||||
PARCEL_DELIVERED,
|
PARCEL_DELIVERED,
|
||||||
merchant->GetCleanName(),
|
merchant->GetCleanName(),
|
||||||
"Money", //inst->DetermineMoneyStringForParcels(p->second.quantity).c_str(),
|
"Money",
|
||||||
p->second.from_name.c_str()
|
p->second.from_name.c_str()
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@ -638,6 +691,12 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in)
|
|||||||
PlayerEvent::ParcelRetrieve e{};
|
PlayerEvent::ParcelRetrieve e{};
|
||||||
e.from_player_name = p->second.from_name;
|
e.from_player_name = p->second.from_name;
|
||||||
e.item_id = p->second.item_id;
|
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.quantity = p->second.quantity;
|
||||||
e.sent_date = p->second.sent_date;
|
e.sent_date = p->second.sent_date;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user