This commit is contained in:
@@ -40,6 +40,8 @@ def checked_progression_policy(data):
|
||||
if not isinstance(data, dict):
|
||||
raise ValueError("主线策略必须是对象")
|
||||
raw = asdict(ProgressionPolicy()) | data
|
||||
if type(raw["loss_retry_hours"]) is not int or not 1 <= raw["loss_retry_hours"] <= 168:
|
||||
raise ValueError("战败冷却时间须为1至168小时")
|
||||
for key in ("reserve_ti", "max_money"):
|
||||
if type(raw[key]) is not int or not 0 <= raw[key] <= 1_000_000_000:
|
||||
raise ValueError("主线策略数量超出范围:" + key)
|
||||
|
||||
Reference in New Issue
Block a user