Add ability to force updates for outdated asset versions

This commit is contained in:
Ethan O'Brien
2026-09-27 11:39:31 -05:00
parent f1c8e96fbe
commit 99ba099d1b
4 changed files with 9 additions and 1 deletions
+1
View File
@@ -32,6 +32,7 @@ services:
#EN_ANDROID_ASSET_HASH: ""
#EN_IOS_ASSET_HASH: ""
#WINDOWS_ASSET_HASH: "" # Windows asset hash (JP only; GL Windows is unused)
#FORCE_UPDATES: false # Force outdated clients to update
# Everything below is for the "Help" page
#ANDROID_GLOBAL: "link.to/patched/android/global.apk"
+1
View File
@@ -18,6 +18,7 @@ args=(
[ "${NERF_CUSTOM_CARDS:-}" = "true" ] && args+=(--nerf-custom-cards)
[ "${ENABLE_CUSTOM_3DMV:-}" = "true" ] && args+=(--enable-custom-3dmv)
[ "${ENABLE_ARCADE:-}" = "true" ] && args+=(--enable-arcade)
[ "${FORCE_UPDATES:-}" = "true" ] && args+=(--force-updates)
add_opt() {
local value="$1" flag="$2"
+3
View File
@@ -89,6 +89,9 @@ pub struct Args {
#[arg(long, default_value = "", help = "Asset version for overridden asset hashes.")]
pub asset_version: String,
#[arg(long, default_value_t = false, help = "Force an application update for asset versions not marked as latest")]
pub force_updates: bool,
#[arg(long, default_value = "", help = "Asset hash for windows client.")]
pub windows_asset_hash: String,
+3
View File
@@ -100,14 +100,17 @@ impl AssetVersion {
}
fn valid_hashes(asset_version: &str, platform: &str) -> Vec<String> {
let args = crate::get_args();
let mut out = Vec::new();
for entry in ASSET_VERSIONS {
if entry.platform != platform {
continue;
}
if entry.version == asset_version && !entry.hash.is_empty() {
if entry.latest || !args.force_updates {
out.push(entry.stock_hash());
}
}
if entry.latest {
if let Some((ov, oh)) = entry.override_pair() {
if ov == asset_version {