Implement bazaar item identity and offline trading rework

This commit is contained in:
Vayle
2026-03-19 22:18:32 -04:00
90 changed files with 5379 additions and 2165 deletions
+27 -2
View File
@@ -106,8 +106,13 @@ public:
return false;
}
auto buy_lines =
BaseBuyerBuyLinesRepository::GetWhere(db, fmt::format("`buyer_id` = {}", buyer.front().id));
auto buy_lines = BaseBuyerBuyLinesRepository::GetWhere(
db,
fmt::format("`buyer_id` = '{}'", buyer.front().id)
);
if (buy_lines.empty()) {
return false;
}
std::vector<std::string> buy_line_ids{};
for (auto const &bl: buy_lines) {
@@ -175,4 +180,24 @@ public:
return true;
}
static bool UpdateBuyerEntityID(Database &db, uint32 char_id, uint32 old_entity_id, uint32 new_entity_id)
{
if (!char_id || !old_entity_id || !new_entity_id) {
return false;
}
auto results = GetWhere(db, fmt::format("`char_id` = {} AND `char_entity_id` = {} LIMIT 1;", char_id, old_entity_id));
if (results.empty()) {
return false;
}
for (auto &e: results) {
e.char_entity_id = new_entity_id;
}
ReplaceMany(db, results);
return true;
}
};