mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-10-12 01:24:27 +08:00
Add ability to force updates for outdated asset versions
This commit is contained in:
@@ -32,6 +32,7 @@ services:
|
|||||||
#EN_ANDROID_ASSET_HASH: ""
|
#EN_ANDROID_ASSET_HASH: ""
|
||||||
#EN_IOS_ASSET_HASH: ""
|
#EN_IOS_ASSET_HASH: ""
|
||||||
#WINDOWS_ASSET_HASH: "" # Windows asset hash (JP only; GL Windows is unused)
|
#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
|
# Everything below is for the "Help" page
|
||||||
#ANDROID_GLOBAL: "link.to/patched/android/global.apk"
|
#ANDROID_GLOBAL: "link.to/patched/android/global.apk"
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ args=(
|
|||||||
[ "${NERF_CUSTOM_CARDS:-}" = "true" ] && args+=(--nerf-custom-cards)
|
[ "${NERF_CUSTOM_CARDS:-}" = "true" ] && args+=(--nerf-custom-cards)
|
||||||
[ "${ENABLE_CUSTOM_3DMV:-}" = "true" ] && args+=(--enable-custom-3dmv)
|
[ "${ENABLE_CUSTOM_3DMV:-}" = "true" ] && args+=(--enable-custom-3dmv)
|
||||||
[ "${ENABLE_ARCADE:-}" = "true" ] && args+=(--enable-arcade)
|
[ "${ENABLE_ARCADE:-}" = "true" ] && args+=(--enable-arcade)
|
||||||
|
[ "${FORCE_UPDATES:-}" = "true" ] && args+=(--force-updates)
|
||||||
|
|
||||||
add_opt() {
|
add_opt() {
|
||||||
local value="$1" flag="$2"
|
local value="$1" flag="$2"
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ pub struct Args {
|
|||||||
#[arg(long, default_value = "", help = "Asset version for overridden asset hashes.")]
|
#[arg(long, default_value = "", help = "Asset version for overridden asset hashes.")]
|
||||||
pub asset_version: String,
|
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.")]
|
#[arg(long, default_value = "", help = "Asset hash for windows client.")]
|
||||||
pub windows_asset_hash: String,
|
pub windows_asset_hash: String,
|
||||||
|
|
||||||
|
|||||||
@@ -100,13 +100,16 @@ impl AssetVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn valid_hashes(asset_version: &str, platform: &str) -> Vec<String> {
|
fn valid_hashes(asset_version: &str, platform: &str) -> Vec<String> {
|
||||||
|
let args = crate::get_args();
|
||||||
let mut out = Vec::new();
|
let mut out = Vec::new();
|
||||||
for entry in ASSET_VERSIONS {
|
for entry in ASSET_VERSIONS {
|
||||||
if entry.platform != platform {
|
if entry.platform != platform {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if entry.version == asset_version && !entry.hash.is_empty() {
|
if entry.version == asset_version && !entry.hash.is_empty() {
|
||||||
out.push(entry.stock_hash());
|
if entry.latest || !args.force_updates {
|
||||||
|
out.push(entry.stock_hash());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if entry.latest {
|
if entry.latest {
|
||||||
if let Some((ov, oh)) = entry.override_pair() {
|
if let Some((ov, oh)) = entry.override_pair() {
|
||||||
|
|||||||
Reference in New Issue
Block a user