Skip to content

Commit

Permalink
migrate to content_db for items_evolving_details
Browse files Browse the repository at this point in the history
migrate to content_db for items_evolving_details
  • Loading branch information
neckkola committed Dec 14, 2024
1 parent a17d490 commit ffc964b
Show file tree
Hide file tree
Showing 7 changed files with 546 additions and 89 deletions.
8 changes: 4 additions & 4 deletions common/eq_packet_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6466,8 +6466,8 @@ struct EvolveXPWindowSend_Struct {
/*012*/ uint64 item2_unique_id;
/*020*/ uint32 compatibility;
/*024*/ uint32 max_transfer_level;
/*028*/ uint8 unknown_028;
/*029*/ uint8 unknown_029;
/*028*/ uint8 item1_present;
/*029*/ uint8 item2_present;
/*030*/ std::string serialize_item_1;
/*034*/ std::string serialize_item_2;

Expand All @@ -6480,8 +6480,8 @@ struct EvolveXPWindowSend_Struct {
CEREAL_NVP(item2_unique_id),
CEREAL_NVP(compatibility),
CEREAL_NVP(max_transfer_level),
CEREAL_NVP(unknown_028),
CEREAL_NVP(unknown_029),
CEREAL_NVP(item1_present),
CEREAL_NVP(item2_present),
CEREAL_NVP(serialize_item_1),
CEREAL_NVP(serialize_item_2)
);
Expand Down
2 changes: 1 addition & 1 deletion common/evolving.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ EvolvingItemsManager::EvolvingItemsManager()

void EvolvingItemsManager::LoadEvolvingItems() const
{
auto const &results = ItemsEvolvingDetailsRepository::All(*m_db);
auto const &results = ItemsEvolvingDetailsRepository::All(*m_content_db);

if (results.empty()) {
return;
Expand Down
4 changes: 2 additions & 2 deletions common/patches/rof2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,8 +1380,8 @@ namespace RoF2
data->max_transfer_level = e.max_transfer_level;
data->item1_unique_id = e.item1_unique_id;
data->item2_unique_id = e.item2_unique_id;
data->unknown_028 = e.unknown_028;
data->unknown_029 = e.unknown_029;
data->item1_present = e.item1_present;
data->item2_present = e.item2_present;

memcpy(data->serialize_data, ob.str().data(), ob.size());
dest->QueuePacket(out.get());
Expand Down
4 changes: 2 additions & 2 deletions common/patches/rof2_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5446,8 +5446,8 @@ struct EvolveXPWindowSendDetails_Struct {
/*012*/ uint64 item2_unique_id;
/*020*/ uint32 compatibility;
/*024*/ uint32 max_transfer_level;
/*028*/ uint8 unknown_028;
/*029*/ uint8 unknown_029;
/*028*/ uint8 item1_present;
/*029*/ uint8 item2_present;
/*030*/ char serialize_data[];
};

Expand Down
4 changes: 3 additions & 1 deletion common/shareddb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ bool SharedDatabase::GetInventory(Client *c)

// Retrieve character inventory
auto results = InventoryRepository::GetWhere(*this, fmt::format("`charid` = '{}' ORDER BY `slotid`", char_id));
auto e_results = CharacterEvolvingItemsRepository::GetWhere(*this, fmt::format("`char_id` = '{}' AND `deleted_at` IS NULL", char_id));
auto e_results = CharacterEvolvingItemsRepository::GetWhere(
*this, fmt::format("`char_id` = '{}' AND `deleted_at` IS NULL", char_id)
);

if (results.empty()) {
LogError("Error loading inventory for char_id {} from the database.", char_id);
Expand Down
452 changes: 452 additions & 0 deletions utils/sql/items_evolving_details.sql

Large diffs are not rendered by default.

Loading

0 comments on commit ffc964b

Please sign in to comment.