diff options
author | Ben Carter <110695027+ben-of-codecraft@users.noreply.github.com> | 2024-09-06 11:37:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 12:37:00 -0300 |
commit | 6e5cd04591f3e5ef9034a49bcb45562744dfbbaa (patch) | |
tree | eba00169fb1c009106dfceff208faa19fca243af /src | |
parent | 9dae87595dc2f0f14d06ce7984250535630f54df (diff) |
fix(docker): Modules SQL do not get updated or populated for docker set ups (#19870)
* Added modules to dbimport so sql cab accessed by loader
* updated dbimport tools config option to enable module sql to be updated and populated
* Updated casting around GetOption and changed default to all
Diffstat (limited to 'src')
-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 |
3 files changed, 24 insertions, 2 deletions
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) |