From 40e04500f6f836d6cdef147813ca5415cb5bdfe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Sat, 28 Oct 2023 17:52:45 +0000 Subject: [PATCH] scripts: fetch yapb graphs for official maps from database --- .github/workflows/build.yml | 4 +++- scripts/official_maps.lst | 25 +++++++++++++++++++++++++ scripts/yapb_graph_dl.sh | 21 +++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 scripts/official_maps.lst create mode 100755 scripts/yapb_graph_dl.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e5bf9be..cc3a5332 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,8 @@ jobs: with: fetch-depth: 0 submodules: recursive + - name: Fetch YaPB Graphs from DB + run: scripts/yapb_graph_dl.sh - name: Setup Java uses: actions/setup-java@v3 with: @@ -197,4 +199,4 @@ jobs: tag: continuous overwrite: true prerelease: true - release_name: CS16Client development build \ No newline at end of file + release_name: CS16Client development build diff --git a/scripts/official_maps.lst b/scripts/official_maps.lst new file mode 100644 index 00000000..b8c315f0 --- /dev/null +++ b/scripts/official_maps.lst @@ -0,0 +1,25 @@ +as_oilrig +cs_747 +cs_assault +cs_backalley +cs_estate +cs_havana +cs_italy +cs_militia +cs_office +cs_siege +de_airstrip +de_aztec +de_cbble +de_chateau +de_dust +de_dust2 +de_inferno +de_nuke +de_piranesi +de_prodigy +de_storm +de_survivor +de_torn +de_train +de_vertigo diff --git a/scripts/yapb_graph_dl.sh b/scripts/yapb_graph_dl.sh new file mode 100755 index 00000000..1b198334 --- /dev/null +++ b/scripts/yapb_graph_dl.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Specify the YaPB Graph Database URL +DATABASE_URL="https://yapb.jeefo.net/graph/" + +# Specify the path to the file with the maps list +LIST_FILE="scripts/official_maps.lst" + +# Checking the presence of the list file +if [ ! -f $LIST_FILE ]; then + echo "File $LIST_FILE not found." + exit 1 +fi + +# Read the map list line by line and download graphs for them +while IFS= read -r graph_name; do + file_url="${DATABASE_URL}${graph_name}.graph" + wget "$file_url" -P "3rdparty/cs16client-extras/addons/yapb/data/graph" +done < "$LIST_FILE" + +echo "YaPB Graphs have been downloaded for the maps specified in the list."