Browse Source

Added SDK support to set_game_branch.sh, clean_builds.sh, map_builds.sh

Added sdk_mirrors
Added sdk_mirrors support to update_mirrors.sh
master
Jessica James 4 years ago
parent
commit
768d384064
  1. 10
      clean_builds.sh
  2. 12
      map_builds.sh
  3. 18
      sdk_mirrors
  4. 20
      set_game_branch.sh
  5. 9
      update_mirrors.sh

10
clean_builds.sh

@ -84,12 +84,22 @@ function clean_builds() {
referenced_builds=()
for version_file in $version_path/*; do
version_data=$(cat "$version_file")
# Read in game build
build=$(echo "$version_data" | jq -r ".game.patch_path")
build_path="$patches_path/$build"
if [[ ! "${referenced_builds[@]}" =~ "$build_path" ]]; then
referenced_builds+=("$build_path")
fi
# Read in SDK build
build=$(echo "$version_data" | jq -r ".sdk.patch_path")
build_path="$patches_path/$build"
if [[ ! "${referenced_builds[@]}" =~ "$build_path" ]]; then
referenced_builds+=("$build_path")
fi
done
if $verbose; then

12
map_builds.sh

@ -76,6 +76,8 @@ function map_builds() {
referenced_builds=()
for version_file in $version_path/*; do
version_data=$(cat "$version_file")
# Read in game build
build=$(echo "$version_data" | jq -r ".game.patch_path")
build_path="$patches_path/$build"
@ -83,7 +85,15 @@ function map_builds() {
referenced_builds+=("$build_path")
fi
echo "$(basename $version_file) -> $build"
# Read in SDK build
sdk_build=$(echo "$version_data" | jq -r ".sdk.patch_path")
sdk_build_path="$patches_path/$sdk_build"
if [[ ! "${referenced_builds[@]}" =~ "$sdk_build_path" ]]; then
referenced_builds+=("$sdk_build_path")
fi
echo "$(basename $version_file) -> Game: ${build}; SDK: ${sdk_build}"
done
if $verbose; then

18
sdk_mirrors

@ -0,0 +1,18 @@
[
{
"name": "CnCFPS.com (Los Angeles, CA, USA)",
"url": "http://rxp-lax2.cncfps.com"
},
{
"name": "TotemArts (Las Vegas, Nevada, USA)",
"url": "http://us-lv.buyvm.renegade-x.com/"
},
{
"name": "TotemArts (New York, New York, USA)",
"url": "http://us-ny.buyvm.renegade-x.com/"
},
{
"name": "TotemArts (Roost, Luxembourg, EU)",
"url": "http://eu-lux.buyvm.renegade-x.com/"
}
]

20
set_game_branch.sh

@ -6,6 +6,7 @@ patches_path="${patches_data_path}"
echo_output=false
minify=false
verbose=false
product_key=game
function print_help() {
echo "Sets the patch path for a given branch."
@ -49,6 +50,11 @@ do
shift
shift
;;
--product-key)
product_key="$2"
shift
shift
;;
esac
done
@ -71,6 +77,7 @@ then
echo " version_path: $version_path"
echo " patch_path: $patch_path"
echo " version_file: $version_file"
echo " product_key: $product_key"
echo ""
fi
@ -83,6 +90,7 @@ function set_branch() {
version_file="$1"
patch_path="$2"
patches_path="$3"
product_key="$4"
metadata_file="${patches_path}/${patch_path}/metadata.json"
# Verify version branch exists
@ -118,14 +126,14 @@ function set_branch() {
version_data=$(cat "${version_file}")
# Set the patch_path
version_data=$(echo "${version_data}" | jq ".game.patch_path = \"${patch_path}\"")
version_data=$(echo "${version_data}" | jq ".${product_key}.patch_path = \"${patch_path}\"")
# Set the metadata hash; this is unused for now
version_data=$(echo "${version_data}" | jq ".game.metadata_hash = \"${metadata_hash}\"")
version_data=$(echo "${version_data}" | jq ".${product_key}.metadata_hash = \"${metadata_hash}\"")
# Merge in metadata into game
game_version_data=$(echo "${version_data}" | jq ".game * ${patch_metadata}")
version_data=$(echo "${version_data}" | jq ".game = ${game_version_data}")
# Merge in metadata into product
product_version_data=$(echo "${version_data}" | jq ".${product_key} * ${patch_metadata}")
version_data=$(echo "${version_data}" | jq ".${product_key} = ${product_version_data}")
# Minify final JSON if specified
if $minify
@ -142,4 +150,4 @@ function set_branch() {
fi
}
set_branch "${version_file}" "${patch_path}" "${patches_path}"
set_branch "${version_file}" "${patch_path}" "${patches_path}" "${product_key}"

9
update_mirrors.sh

@ -1,11 +1,18 @@
game_mirrors_file=game_mirrors
sdk_mirrors_file=sdk_mirrors
static_path="/home/renx/static.renegade-x.com/"
version_path="${static_path}/data/launcher_data/version"
update_mirrors() {
version_file=${version_path}/$1
# Update game mirrors
game_mirrors=$(cat "${game_mirrors_file}")
version_file=${version_path}/$1
jq ".game.mirrors = ${game_mirrors}" "${version_file}" > "$version_file.tmp" && mv "${version_file}.tmp" "${version_file}"
# Update SDK mirrors
sdk_mirrors=$(cat "${sdk_mirrors_file}")
jq ".sdk.mirrors = ${sdk_mirrors}" "${version_file}" > "$version_file.tmp" && mv "${version_file}.tmp" "${version_file}"
}
# Release branches

Loading…
Cancel
Save