From 0d19c9d5cf5beb2ad0dfd2d1d03599c2f4d32ff6 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Fri, 13 Jun 2025 02:03:00 -0500 Subject: [PATCH] Fix linking issue --- common/CMakeLists.txt | 2 -- common/data_bucket.cpp | 10 +++++++++- world/CMakeLists.txt | 2 ++ zone/CMakeLists.txt | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 761346362..0350cb6d4 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -13,7 +13,6 @@ SET(common_sources crash.cpp crc16.cpp crc32.cpp - data_bucket.cpp database/database_dump_service.cpp database.cpp database_instances.cpp @@ -551,7 +550,6 @@ SET(common_headers cli/eqemu_command_handler.h cli/terminal_color.hpp cron/croncpp.h - data_bucket.h database/database_dump_service.h data_verification.h database.h diff --git a/common/data_bucket.cpp b/common/data_bucket.cpp index 53d9150de..d0ad01b7e 100644 --- a/common/data_bucket.cpp +++ b/common/data_bucket.cpp @@ -9,7 +9,15 @@ using json = nlohmann::json; const std::string NESTED_KEY_DELIMITER = "."; std::vector g_data_bucket_cache = {}; -extern Database database; +#if defined(ZONE) +#include "../zone/zonedb.h" +extern ZoneDatabase database; +#elif defined(WORLD) +#include "../world/worlddb.h" +extern WorldDatabase database; +#else +#error "You must define either ZONE or WORLD" +#endif void DataBucket::SetData(const std::string &bucket_key, const std::string &bucket_value, std::string expires_time) { diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt index 1b85ad1ed..0eed74b9b 100644 --- a/world/CMakeLists.txt +++ b/world/CMakeLists.txt @@ -7,6 +7,7 @@ SET(world_sources cliententry.cpp clientlist.cpp console.cpp + ../common/data_bucket.cpp dynamic_zone.cpp dynamic_zone_manager.cpp eql_config.cpp @@ -42,6 +43,7 @@ SET(world_headers cliententry.h clientlist.h console.h + ../common/data_bucket.h dynamic_zone.h dynamic_zone_manager.h eql_config.h diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 8849eec90..56dcf29fe 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -25,6 +25,7 @@ SET(zone_sources combat_record.cpp command.cpp corpse.cpp + ../common/data_bucket.cpp doors.cpp dialogue_window.cpp dynamic_zone.cpp @@ -194,6 +195,7 @@ SET(zone_headers command.h common.h corpse.h + ../common/data_bucket.h doors.h dialogue_window.h dynamic_zone.h