From 2b6e2f12fb97adae8201db98a9c7f5556678ce67 Mon Sep 17 00:00:00 2001 From: sindoring Date: Sun, 13 Sep 2026 12:45:55 +0400 Subject: [PATCH] fix --- .env.example | 1 + .env.production.example | 1 + compose.yaml | 1 + docker/entrypoint.sh | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/.env.example b/.env.example index 3af7c65..650cf87 100644 --- a/.env.example +++ b/.env.example @@ -5,6 +5,7 @@ EXTERNAL_ADDRESS=127.0.0.1 REALM_NAME=Sylvania Solo REALM_ADDRESS=127.0.0.1 REALM_PORT=8086 +DBC_LOCALE=8 BUILD_JOBS=2 BUILD_TYPE=Release IMAGE_TAG=local diff --git a/.env.production.example b/.env.production.example index a239db0..a4e9d37 100644 --- a/.env.production.example +++ b/.env.production.example @@ -6,6 +6,7 @@ DB_PASSWORD=GENERATE_A_DIFFERENT_LONG_RANDOM_DB_PASSWORD REALM_NAME=FelWell REALM_ADDRESS=legion.moon-well.online REALM_PORT=8086 +DBC_LOCALE=8 EXTERNAL_ADDRESS=legion.moon-well.online BUILD_JOBS=8 diff --git a/compose.yaml b/compose.yaml index 3fd82d9..4cadc3f 100644 --- a/compose.yaml +++ b/compose.yaml @@ -20,6 +20,7 @@ x-core: &core REALM_NAME: ${REALM_NAME:-Sylvania Solo} REALM_ADDRESS: ${REALM_ADDRESS:-127.0.0.1} REALM_PORT: ${REALM_PORT:-8086} + DBC_LOCALE: ${DBC_LOCALE:-8} volumes: - ./data:/opt/sylvania/data:ro - ./sql:/src/sql:ro diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 7cacbdb..de7872c 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -15,6 +15,7 @@ external_address="${EXTERNAL_ADDRESS:-127.0.0.1}" realm_name="${REALM_NAME:-Sylvania Solo}" realm_address="${REALM_ADDRESS:-127.0.0.1}" realm_port="${REALM_PORT:-8086}" +dbc_locale="${DBC_LOCALE:-8}" if [[ ! "${realm_name}" =~ ^[[:alnum:]А-Яа-яЁё._[:space:]-]{1,32}$ ]]; then echo "REALM_NAME contains unsupported characters or is longer than 32 characters" >&2 @@ -28,6 +29,10 @@ if [[ ! "${realm_port}" =~ ^[0-9]+$ ]] || (( realm_port < 1 || realm_port > 6553 echo "REALM_PORT must be an integer between 1 and 65535" >&2 exit 1 fi +if [[ ! "${dbc_locale}" =~ ^[0-9]+$ ]] || (( dbc_locale > 11 || dbc_locale == 9 )); then + echo "DBC_LOCALE must be a valid locale index (ruRU is 8)" >&2 + exit 1 +fi config_dir=/opt/sylvania/etc template="${config_dir}/${server}.conf.dist" @@ -63,6 +68,7 @@ if [[ "${server}" == worldserver ]]; then -e "s#^(HotfixDatabaseInfo[[:space:]]*=).*#\\1 \"${db_host};${db_port};${db_user};${db_password};hotfixes\"#" \ -e "s#^(ShopDatabaseInfo[[:space:]]*=).*#\\1 \"${db_host};${db_port};${db_user};${db_password};shop\"#" \ -e 's#^DataDir[[:space:]]*=.*#DataDir = "/opt/sylvania/data"#' \ + -e "s#^DBC.Locale[[:space:]]*=.*#DBC.Locale = ${dbc_locale}#" \ -e 's#^LogsDir[[:space:]]*=.*#LogsDir = "/opt/sylvania/logs"#' \ "${config}" else