diff --git a/config/template.json b/config/template.json index d5d391f2c..1269b88b5 100644 --- a/config/template.json +++ b/config/template.json @@ -1959,6 +1959,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 389efdcec..4547fbd14 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -9408,6 +9408,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 cc3a52975..5293d5931 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 5b00f5530..a147ec81f 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 1382909b3..322c86a30 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 a8470f296..e9e8bc82b 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2500,6 +2500,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 280a9c5cb..b3a871bd8 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2500,6 +2500,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 d6db3fa6e..d446c8bb1 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2500,6 +2500,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 b3da0225f..ce3b3aece 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2500,6 +2500,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 8f4f437ce..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=300, 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