diff --git a/config/template.json b/config/template.json index 26abcf66d..fffd04270 100644 --- a/config/template.json +++ b/config/template.json @@ -3305,6 +3305,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 e89217994..aa9152d19 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -16679,6 +16679,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 2753689ea..e6c6a7010 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -720,6 +720,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 5c848b86c..660d0b6aa 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -523,6 +523,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 c34cb3fbb..d5b9e640e 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -448,6 +448,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 47e9d581c..b2c6354d5 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2607,6 +2607,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 f720fc4ec..baf8c889f 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2607,6 +2607,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 0c0f959b3..e7f9ff5d7 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2607,6 +2607,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 19ec48f35..e4b7e19e0 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2607,6 +2607,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 89a7167be..23dbd3394 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