From 13eb3a079fda8b3586e8741d1a5375a714b618d7 Mon Sep 17 00:00:00 2001 From: 0O0o0oOoO00 <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Mon, 19 May 2025 11:37:17 +0800 Subject: [PATCH] fix: lack of KeepOil setting --- config/template.json | 3 +++ module/campaign/run.py | 2 +- module/config/argument/args.json | 7 +++++++ module/config/argument/task.yaml | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/template.json b/config/template.json index 97ffd0bf6..470d30afb 100644 --- a/config/template.json +++ b/config/template.json @@ -1340,6 +1340,9 @@ "PtLimit": 0, "TimeLimit": "2020-01-01 00:00:00" }, + "KeepOil": { + "TimeLimit": "2020-01-01 00:00:00" + }, "TaskBalancer": { "Enable": false, "CoinLimit": 10000, diff --git a/module/campaign/run.py b/module/campaign/run.py index f84fcb519..4acbbf8d2 100644 --- a/module/campaign/run.py +++ b/module/campaign/run.py @@ -354,7 +354,7 @@ class CampaignRun(CampaignEvent, ShopStatus): def exit_for_keep_oil(self) -> bool: if self.config.task.command in TASK_FOR_KEEP_OIL: - keep_oil_time = deep_get(self.config.data, "EventGeneral.KeepOil.TimeLimit") + keep_oil_time = deep_get(self.config.data, "EventGeneral.KeepOil.TimeLimit", datetime(2020, 1, 1, 0, 0)) if keep_oil_time == datetime(2020, 1, 1, 0, 0): return False else: diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 6de4898cb..a9e5832ea 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -6735,6 +6735,13 @@ "validate": "datetime" } }, + "KeepOil": { + "TimeLimit": { + "type": "datetime", + "value": "2020-01-01 00:00:00", + "validate": "datetime" + } + }, "TaskBalancer": { "Enable": { "type": "checkbox", diff --git a/module/config/argument/task.yaml b/module/config/argument/task.yaml index 9809a409f..a1c69d6f8 100644 --- a/module/config/argument/task.yaml +++ b/module/config/argument/task.yaml @@ -189,6 +189,7 @@ Event: tasks: EventGeneral: - EventGeneral + - KeepOil - TaskBalancer Event: - Scheduler