mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-10-11 09:04:27 +08:00
Fix inability to set some options
This commit is contained in:
Generated
+1
-1
@@ -1085,7 +1085,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ew"
|
name = "ew"
|
||||||
version = "1.1.0"
|
version = "2.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-multipart",
|
"actix-multipart",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
|||||||
@@ -32,7 +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
|
#FORCE_UPDATES: "true" # 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"
|
||||||
|
|||||||
+17
-5
@@ -254,11 +254,15 @@ pub fn overlay_args(args: &mut crate::options::Args) {
|
|||||||
if cfg.arcade_session_ttl != 0 {
|
if cfg.arcade_session_ttl != 0 {
|
||||||
args.arcade_session_ttl = cfg.arcade_session_ttl;
|
args.arcade_session_ttl = cfg.arcade_session_ttl;
|
||||||
}
|
}
|
||||||
args.owner = cfg.owner.clone();
|
// An embedding app may supply these options, but its default values must
|
||||||
args.hidden = cfg.hidden;
|
// not erase flags passed by the standalone server (including Docker).
|
||||||
args.force_updates = cfg.force_updates;
|
if !cfg.owner.is_empty() {
|
||||||
args.disable_imports = cfg.disable_imports;
|
args.owner = cfg.owner.clone();
|
||||||
args.disable_exports = cfg.disable_exports;
|
}
|
||||||
|
args.hidden |= cfg.hidden;
|
||||||
|
args.force_updates |= cfg.force_updates;
|
||||||
|
args.disable_imports |= cfg.disable_imports;
|
||||||
|
args.disable_exports |= cfg.disable_exports;
|
||||||
// Overlay only ever enables the features; a command-line --enable-custom-*
|
// Overlay only ever enables the features; a command-line --enable-custom-*
|
||||||
// flag is never overridden back to off
|
// flag is never overridden back to off
|
||||||
if cfg.enable_custom_songs {
|
if cfg.enable_custom_songs {
|
||||||
@@ -330,4 +334,12 @@ fn android_host_config_updates_owner_and_feature_options() {
|
|||||||
assert!(!reset.enable_custom_songs);
|
assert!(!reset.enable_custom_songs);
|
||||||
assert!(!reset.hidden);
|
assert!(!reset.hidden);
|
||||||
assert!(!get_nerf_custom_cards());
|
assert!(!get_nerf_custom_cards());
|
||||||
|
|
||||||
|
let mut cli = crate::options::Args::parse_from([
|
||||||
|
"ew", "--force-updates", "--hidden", "--disable-imports",
|
||||||
|
"--disable-exports", "--owner", "123",
|
||||||
|
]);
|
||||||
|
overlay_args(&mut cli);
|
||||||
|
assert!(cli.force_updates && cli.hidden && cli.disable_imports && cli.disable_exports);
|
||||||
|
assert_eq!(cli.owner, vec![123]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user