From da97c45702a46f459c61fb4db3ab8638486d4315 Mon Sep 17 00:00:00 2001 From: sindoring Date: Mon, 9 Mar 2026 21:26:55 +0400 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20muthic+=20=D0=B8=20?= =?UTF-8?q?=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 5 ++ import-custom-sql.sh | 169 +++++++++++++++++++++++++++++++++++-------- 2 files changed, 142 insertions(+), 32 deletions(-) diff --git a/.env.example b/.env.example index 4c40499..8fe4826 100644 --- a/.env.example +++ b/.env.example @@ -125,6 +125,11 @@ ACORE_PLAYERBOTS_FORCE=0 # Скрипт импортирует только отсутствующие таблицы и world-объекты, не перезатирая уже созданные данные. ACORE_IMPORT_MYTHICPLUS_SQL=1 +# 1 = импортировать SQL для lua_scripts/Store_System в отдельную базу `store`. +# Скрипт создаст схему `store`, недостающие таблицы и стартовые записи магазина. +# Демонстрационные старые логи покупок из исходного дампа не импортируются. +ACORE_IMPORT_STORE_SQL=1 + # ------------------------------------------------------------------------------ # worldserver.conf: управляемые override-настройки # ------------------------------------------------------------------------------ diff --git a/import-custom-sql.sh b/import-custom-sql.sh index 8a00093..0efc158 100644 --- a/import-custom-sql.sh +++ b/import-custom-sql.sh @@ -13,13 +13,14 @@ if [[ -f "$ENV_FILE" ]]; then fi IMPORT_MYTHICPLUS_SQL="${ACORE_IMPORT_MYTHICPLUS_SQL:-1}" +IMPORT_STORE_SQL="${ACORE_IMPORT_STORE_SQL:-1}" usage() { cat < "$temp_sql" + + log "bootstrapping store database" + mysql_exec "" "$(cat "$temp_sql")" + rm -f "$temp_sql" +} + if (($# > 0)); then case "$1" in -h|--help) @@ -98,6 +231,7 @@ if (($# > 0)); then fi require_integer_flag "ACORE_IMPORT_MYTHICPLUS_SQL" "$IMPORT_MYTHICPLUS_SQL" +require_integer_flag "ACORE_IMPORT_STORE_SQL" "$IMPORT_STORE_SQL" cd "$ROOT_DIR" @@ -106,36 +240,7 @@ if ! docker compose ps --status running --services | grep -qx 'ac-database'; the exit 1 fi -if [[ "$IMPORT_MYTHICPLUS_SQL" == "0" ]]; then - log "MythicPlus SQL import disabled, skipped" - exit 0 -fi - -if [[ ! -d "$ROOT_DIR/sql/Mythic+" ]]; then - log "sql/Mythic+ directory not found, skipped" - exit 0 -fi - -maybe_import_table "acore_characters" "character_mythic_history" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_history.sql" -maybe_import_table "acore_characters" "character_mythic_keys" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_keys.sql" -maybe_import_table "acore_characters" "character_mythic_rating" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_rating.sql" -maybe_import_table "acore_characters" "character_mythic_vault" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_vault.sql" -maybe_import_table "acore_characters" "character_mythic_weekly_affixes" \ - "$ROOT_DIR/sql/Mythic+/characters/character_mythic_weekly_affixes.sql" - -maybe_import_table "acore_world" "world_mythic_loot" \ - "$ROOT_DIR/sql/Mythic+/world/world_mythic_loot.sql" -maybe_import_table "acore_world" "world_vault_loot" \ - "$ROOT_DIR/sql/Mythic+/world/world_vault_loot.sql" - -if [[ "$(mysql_query "acore_world" "SELECT COUNT(*) FROM creature_template WHERE entry = 900001;")" == "0" ]]; then - import_sql_file "acore_world" "$ROOT_DIR/sql/Mythic+/world/creature_and_keystones.sql" -else - log "MythicPlus creature bootstrap already exists, skipping" -fi +import_mythicplus_sql +import_store_sql log "custom SQL bootstrap completed"