From cf6f69ba93d292f0e61d1c45bf04d4f22e2ec99e Mon Sep 17 00:00:00 2001 From: Nils Bergmann Date: Wed, 8 Dec 2021 00:40:15 +0100 Subject: [PATCH] WIP: try to fix navmesh load --- .env.example | 2 ++ docker-compose.yml | 1 + docker/Dockerfile | 3 +-- docker/pkextractor.py | 4 ++-- docker/start_server.sh | 11 ++++++++++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 402e52d9..7251fcd1 100644 --- a/.env.example +++ b/.env.example @@ -6,3 +6,5 @@ BUILD_THREADS=1 BUILD_VERSION=171022 # make sure this is a long random string ACCOUNT_MANAGER_SECRET= +# Needs to be set to the actual public ip. See https://github.com/DarkflameUniverse/DarkflameServer/issues/45 +EXTERNAL_IP=0.0.0.0 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 68fa6302..ee13a33d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,7 @@ services: - DATABASE_HOST=database - DATABASE_USER=${MARIADB_USER:-darkflame} - DATABASE_PASSWORD=${MARIADB_PASSWORD:-darkflame} + - EXTERNAL_IP=${EXTERNAL_IP:-localhost} volumes: - ${CLIENT_PATH:?err}:/client depends_on: diff --git a/docker/Dockerfile b/docker/Dockerfile index 4d1ba116..6b2b3712 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -37,8 +37,7 @@ RUN echo "Build server" && \ cmake .. && \ make -j $BUILD_THREADS -RUN mkdir -p /build/build/res/maps/navmeshes/ && \ - unzip /build/resources/navmeshes.zip -d /build/build/res/maps +RUN unzip /build/resources/navmeshes.zip -d /build/build/res/maps FROM gcc:11 as runtime diff --git a/docker/pkextractor.py b/docker/pkextractor.py index 0b77380d..a6747274 100644 --- a/docker/pkextractor.py +++ b/docker/pkextractor.py @@ -113,9 +113,9 @@ class PKExtractor: original_md5 = self.records[path][4] dir, filename = os.path.split(path) - out = os.path.join(outdir, dir) + out = os.path.join(outdir, dir.lower()) os.makedirs(out, exist_ok=True) - out_file_path = os.path.join(out, filename) + out_file_path = os.path.join(out, filename.lower()) if os.path.isfile(out_file_path): with open(out_file_path, "rb") as f: diff --git a/docker/start_server.sh b/docker/start_server.sh index 12ea99ef..fc14a052 100644 --- a/docker/start_server.sh +++ b/docker/start_server.sh @@ -45,6 +45,9 @@ function update_database_ini_values_for() { update_ini $INI_FILE mysql_database $DATABASE update_ini $INI_FILE mysql_username $DATABASE_USER update_ini $INI_FILE mysql_password $DATABASE_PASSWORD + if [[ "$INI_FILE" != "worldconfig.ini" ]]; then + update_ini $INI_FILE external_ip $EXTERNAL_IP + fi } function update_ini_values() { @@ -62,8 +65,14 @@ function symlink_client_files() { ln -s /client/client/res/BrickModels/ /app/res/BrickModels ln -s /client/client/res/chatplus_en_us.txt /app/res/chatplus_en_us.txt ln -s /client/client/res/names/ /app/res/names - ln -s /client/client/res/maps/ /app/res/maps ln -s /client/client/locale/locale.xml /app/locale/locale.xml + ( + cd /client/client/res/maps + readarray -d '' entries < <(printf '%s\0' * | sort -zV) + for entry in "${entries[@]}"; do + ln -s /client/client/res/maps/$entry /app/res/maps/ + done + ) } function fdb_to_sqlite() {