diff --git a/apps/docker/Dockerfile b/apps/docker/Dockerfile index e62b6b354..e003ae875 100644 --- a/apps/docker/Dockerfile +++ b/apps/docker/Dockerfile @@ -199,6 +199,9 @@ ENV ACORE_COMPONENT=dbimport COPY --chown=$DOCKER_USER:$DOCKER_USER \ data data +COPY --chown=$DOCKER_USER:$DOCKER_USER \ + modules modules + COPY --chown=$DOCKER_USER:$DOCKER_USER\ --from=build \ /azerothcore/env/dist/bin/dbimport /azerothcore/env/dist/bin/dbimport diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 1edce4cbf..9efea7aae 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -122,6 +122,8 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST}) PUBLIC database PRIVATE + modules + scripts acore-core-interface) # Install config @@ -153,6 +155,8 @@ foreach(TOOL_NAME ${TOOLS_BUILD_LIST}) target_include_directories(${TOOL_PROJECT_NAME} PUBLIC ${TOOL_PUBLIC_INCLUDES} + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/modules PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${TOOL_NAME}) diff --git a/src/tools/dbimport/Main.cpp b/src/tools/dbimport/Main.cpp index 0ab64be72..87371f62a 100644 --- a/src/tools/dbimport/Main.cpp +++ b/src/tools/dbimport/Main.cpp @@ -103,8 +103,15 @@ bool StartDB() { MySQL::Library_Init(); - // Load databases - DatabaseLoader loader("dbimport"); + // Load modules conditionally based on what modules are allowed to auto-update or none + std::string modules = sConfigMgr->GetOption("Updates.AllowedModules", "all"); + LOG_INFO("dbimport", "Loading modules: {}", modules.empty() ? "none" : modules); + + DatabaseLoader loader = + modules.empty() ? DatabaseLoader("dbimport") : + (modules == "all") ? DatabaseLoader("dbimport", DatabaseLoader::DATABASE_NONE, AC_MODULES_LIST) : + DatabaseLoader("dbimport", DatabaseLoader::DATABASE_NONE, modules); + loader .AddDatabase(LoginDatabase, "Login") .AddDatabase(CharacterDatabase, "Character") diff --git a/src/tools/dbimport/dbimport.conf.dist b/src/tools/dbimport/dbimport.conf.dist index 656bdd35b..37ea25e5e 100644 --- a/src/tools/dbimport/dbimport.conf.dist +++ b/src/tools/dbimport/dbimport.conf.dist @@ -159,6 +159,17 @@ CharacterDatabase.SynchThreads = 1 Updates.EnableDatabases = 7 +# +# Updates.AllowedModules +# Description: A list of modules that are allowed to be updated automatically by the DBImport tool. +# If the list is empty, no modules are allowed to automatically update. (current behavior) +# Default: "" - (No modules are allowed) +# +# Example: "mod_name,mod_name2,mod_name3" (selected modules) +# "all" - (All modules are allowed) +# +Updates.AllowedModules = "all" + # # Updates.AutoSetup # Description: Auto populate empty databases.