diff --git a/config/template.json b/config/template.json index 075e66ec8..36ce9596a 100644 --- a/config/template.json +++ b/config/template.json @@ -1954,6 +1954,7 @@ "RestartEverytime": true, "RepushLua": true, "GGMultiplyingFactor": 200, + "Timeout": 120, "DisabledTask": "disable_all_dangerous_task" }, "PowerLimit": { diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 6ce31c811..aa0ab1c82 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -9398,6 +9398,10 @@ "type": "input", "value": 200 }, + "Timeout": { + "type": "input", + "value": 120 + }, "DisabledTask": { "type": "select", "value": "disable_all_dangerous_task", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 66d490018..4970f7914 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -716,6 +716,7 @@ GGHandler: display: disabled RepushLua: true GGMultiplyingFactor: 200 + Timeout: 120 DisabledTask: value: disable_all_dangerous_task option: [ diff --git a/module/config/argument/override.yaml b/module/config/argument/override.yaml index 5543ea9e1..171c0066b 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -426,6 +426,11 @@ OpsiHazard1Leveling: OpsiFleet: Submarine: false +# ==================== GGHandler ==================== +GGHandler: + Timeout: + value: 120 + # ==================== Dashboard ==================== Dashboard: Oil: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index b893dd1a7..96f23b944 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -444,6 +444,7 @@ class GeneratedConfig: GGHandler_RestartEverytime = True GGHandler_RepushLua = True GGHandler_GGMultiplyingFactor = 200 + GGHandler_Timeout = 120 GGHandler_DisabledTask = 'disable_all_dangerous_task' # disable_all_dangerous_task, disable_guild_and_dangerous, disable_exercise, enable_all # Group `PowerLimit` diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index ef4b70d13..6358c2306 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2496,6 +2496,10 @@ "name": "GG Multiplying Factor", "help": "1 - 9999 Recommended" }, + "Timeout": { + "name": "GGHandler.Timeout.name", + "help": "GGHandler.Timeout.help" + }, "DisabledTask": { "name": "Disabled Tasks", "help": "", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 51352da0e..ca6516de9 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2496,6 +2496,10 @@ "name": "GGHandler.GGMultiplyingFactor.name", "help": "GGHandler.GGMultiplyingFactor.help" }, + "Timeout": { + "name": "GGHandler.Timeout.name", + "help": "GGHandler.Timeout.help" + }, "DisabledTask": { "name": "GGHandler.DisabledTask.name", "help": "GGHandler.DisabledTask.help", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index bf2eff1ba..e53809d8d 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2496,6 +2496,10 @@ "name": "倍率", "help": "建议数值1-9999,没做数字检查,乱输后果自负" }, + "Timeout": { + "name": "启动时限(秒)", + "help": "启动GG的时间限制,若设备运行慢则需要适当调大" + }, "DisabledTask": { "name": "禁用倍率的项目", "help": "会关闭倍率的项目,建议敏感项目全关。打开的项目导致封号后果自负。\n敏感项目:共斗,Meta与演习\n注意:战力限制依旧生效,但大舰队没有这个玩意无法检测\n(虽然大舰队无所谓,只是一直有人问才加的)。", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 7f2ed4fef..f0ed6a005 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2496,6 +2496,10 @@ "name": "倍率", "help": "建議數值1-9999,沒做數位檢查,亂輸入後果自負" }, + "Timeout": { + "name": "GGHandler.Timeout.name", + "help": "GGHandler.Timeout.help" + }, "DisabledTask": { "name": "禁用倍率的項目", "help": "會關閉倍率的項目,建議全關。 打開的項目導致封號後果自負。\n所有,指演習,共鬥,Meta信標\n注意:戰力限制依舊生效。", diff --git a/module/gg_handler/gg_handler.py b/module/gg_handler/gg_handler.py index 490e78848..2e87a92aa 100644 --- a/module/gg_handler/gg_handler.py +++ b/module/gg_handler/gg_handler.py @@ -60,7 +60,7 @@ class GGHandler: # GGU2(config=self.config, device=self.device) \ # .set_on(factor=self.factor) self.handle_u2_restart() - success = timeout(GGU2(config=self.config, device=self.device).set_on, timeout_sec=120, factor=self.factor) + success = timeout(GGU2(config=self.config, device=self.device).set_on, timeout_sec=deep_get(self.config.data, "GameManager.GGHandler.Timeout"), factor=self.factor) if success: from module.exception import GameStuckError raise GameStuckError