feat: add configurable delayed password relogin
This commit is contained in:
@@ -36,7 +36,8 @@ def default_config():
|
||||
# experimental battle simulator. Keep those defaults, not legacy widgets.
|
||||
value["policy"]["manual_eggs"] = True
|
||||
value["progression_policy"]["battle_mode"] = "experimental"
|
||||
return value | {"interval": 30, "overrides": {}, "yield_stars": [1, 2, 3, 4, 5],
|
||||
return value | {"auto_relogin": {"enabled": False, "delay_minutes": 30},
|
||||
"interval": 30, "overrides": {}, "yield_stars": [1, 2, 3, 4, 5],
|
||||
"log_visible": True, "log_sizes": [420, 140]}
|
||||
|
||||
|
||||
@@ -110,6 +111,8 @@ def validate_config(config):
|
||||
result = deepcopy(defaults)
|
||||
for key, cls in POLICY_CLASSES.items():
|
||||
result[key] = _section(config.get(key, {}), defaults[key], key)
|
||||
result["auto_relogin"] = _section(config.get("auto_relogin", {}), defaults["auto_relogin"], "自动重登")
|
||||
_int(result["auto_relogin"]["delay_minutes"], "自动重登等待分钟", 1, 10080)
|
||||
p = result["policy"]
|
||||
# read_policy() in the current desktop always enables per-species rules.
|
||||
# Normalize a validated legacy False so importing hidden old settings can
|
||||
@@ -218,6 +221,8 @@ def apply_config(engine, config):
|
||||
|
||||
|
||||
def export_config(config, snapshot=None):
|
||||
# Login preferences stay local to this account tab; portable strategy
|
||||
# imports cannot opt another account into password authentication.
|
||||
value = policy_io.portable_config(validate_config(config), snapshot)
|
||||
value["assistantVersion"] = __version__
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user