diff options
-rw-r--r-- | apps/docker/Dockerfile | 3 | ||||
-rw-r--r-- | src/tools/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/tools/dbimport/Main.cpp | 11 | ||||
-rw-r--r-- | src/tools/dbimport/dbimport.conf.dist | 11 |
4 files changed, 27 insertions, 2 deletions
diff --git a/apps/docker/Dockerfile b/apps/docker/Dockerfile index e62b6b354b..e003ae875d 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 1edce4cbfa..9efea7aaec 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 0ab64be724..87371f62a3 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<std::string>("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 656bdd35b8..37ea25e5e7 100644 --- a/src/tools/dbimport/dbimport.conf.dist +++ b/src/tools/dbimport/dbimport.conf.dist @@ -160,6 +160,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. # Default: 1 - (Enabled) |