From 0f600f7b5290f112ec1475c5fcd5eaadfc8a2e00 Mon Sep 17 00:00:00 2001 From: LA-DI-DA <11174151+0O0o0oOoO00@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:20:04 +0800 Subject: [PATCH] Add: timeout setting of changing ship's type and attribute --- config/template.json | 4 +++- module/config/argument/args.json | 10 +++++++++- module/config/argument/argument.yaml | 4 +++- module/config/argument/override.yaml | 8 +++++++- module/config/config_generated.py | 4 +++- module/config/i18n/en-US.json | 8 ++++++++ module/config/i18n/ja-JP.json | 8 ++++++++ module/config/i18n/zh-CN.json | 8 ++++++++ module/config/i18n/zh-TW.json | 8 ++++++++ module/gg_handler/change_attribute.py | 2 +- module/gg_handler/change_ship.py | 2 +- 11 files changed, 59 insertions(+), 7 deletions(-) diff --git a/config/template.json b/config/template.json index 7ff614cc3..86befa980 100644 --- a/config/template.json +++ b/config/template.json @@ -1959,7 +1959,7 @@ "RestartEverytime": true, "RepushLua": true, "GGMultiplyingFactor": 200, - "Timeout": 120, + "Timeout": 1200, "DisabledTask": "disable_all_dangerous_task" }, "PowerLimit": { @@ -1970,12 +1970,14 @@ "ChangeShip": { "Enable": false, "PushLua": false, + "Timeout": 90, "TargetType": "BB", "ShipData": "106021;1;6\n107041;1;6\n206011;1;6\n107011;1;6\n" }, "ChangeAttribute": { "Enable": false, "PushLua": false, + "Timeout": 600, "ShipData": null }, "Storage": { diff --git a/module/config/argument/args.json b/module/config/argument/args.json index d960b5fe0..912e84481 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -9410,7 +9410,7 @@ }, "Timeout": { "type": "input", - "value": 120 + "value": 1200 }, "DisabledTask": { "type": "select", @@ -9446,6 +9446,10 @@ "type": "checkbox", "value": false }, + "Timeout": { + "type": "input", + "value": 90 + }, "TargetType": { "type": "select", "value": "BB", @@ -9468,6 +9472,10 @@ "type": "checkbox", "value": false }, + "Timeout": { + "type": "input", + "value": 600 + }, "ShipData": { "type": "textarea", "value": "" diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index f832ac51f..99f0dc927 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -716,7 +716,7 @@ GGHandler: # display: disabled RepushLua: true GGMultiplyingFactor: 200 - Timeout: 120 + Timeout: 1200 DisabledTask: value: disable_all_dangerous_task option: [ @@ -732,6 +732,7 @@ PowerLimit: ChangeShip: Enable: false PushLua: false + Timeout: 90 TargetType: value: BB option: @@ -747,6 +748,7 @@ ChangeShip: ChangeAttribute: Enable: false PushLua: false + Timeout: 600 ShipData: type: textarea value: '' diff --git a/module/config/argument/override.yaml b/module/config/argument/override.yaml index a147ec81f..46aabeb6a 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -429,7 +429,13 @@ OpsiHazard1Leveling: # ==================== GGHandler ==================== GGHandler: Timeout: - value: 120 + value: 1200 +ChangeShip: + Timeout: + value: 90 +ChangeAttribute: + Timeout: + value: 600 # ==================== Dashboard ==================== Dashboard: diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 570f8a262..787f190a6 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -444,7 +444,7 @@ class GeneratedConfig: GGHandler_RestartEverytime = True GGHandler_RepushLua = True GGHandler_GGMultiplyingFactor = 200 - GGHandler_Timeout = 120 + GGHandler_Timeout = 1200 GGHandler_DisabledTask = 'disable_all_dangerous_task' # disable_all_dangerous_task, disable_guild_and_dangerous, disable_exercise, enable_all # Group `PowerLimit` @@ -455,12 +455,14 @@ class GeneratedConfig: # Group `ChangeShip` ChangeShip_Enable = False ChangeShip_PushLua = False + ChangeShip_Timeout = 90 ChangeShip_TargetType = 'BB' # CV, BB ChangeShip_ShipData = '106021;1;6\n107041;1;6\n206011;1;6\n107011;1;6\n' # Group `ChangeAttribute` ChangeAttribute_Enable = False ChangeAttribute_PushLua = False + ChangeAttribute_Timeout = 600 ChangeAttribute_ShipData = None # Group `InfiniteDelay` diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 9b1261540..4e1551372 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -2544,6 +2544,10 @@ "name": "ChangeShip.PushLua.name", "help": "ChangeShip.PushLua.help" }, + "Timeout": { + "name": "ChangeShip.Timeout.name", + "help": "ChangeShip.Timeout.help" + }, "TargetType": { "name": "ChangeShip.TargetType.name", "help": "ChangeShip.TargetType.help", @@ -2568,6 +2572,10 @@ "name": "ChangeAttribute.PushLua.name", "help": "ChangeAttribute.PushLua.help" }, + "Timeout": { + "name": "ChangeAttribute.Timeout.name", + "help": "ChangeAttribute.Timeout.help" + }, "ShipData": { "name": "ChangeAttribute.ShipData.name", "help": "ChangeAttribute.ShipData.help" diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 9dec8d3ae..e52da5ce1 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -2544,6 +2544,10 @@ "name": "ChangeShip.PushLua.name", "help": "ChangeShip.PushLua.help" }, + "Timeout": { + "name": "ChangeShip.Timeout.name", + "help": "ChangeShip.Timeout.help" + }, "TargetType": { "name": "ChangeShip.TargetType.name", "help": "ChangeShip.TargetType.help", @@ -2568,6 +2572,10 @@ "name": "ChangeAttribute.PushLua.name", "help": "ChangeAttribute.PushLua.help" }, + "Timeout": { + "name": "ChangeAttribute.Timeout.name", + "help": "ChangeAttribute.Timeout.help" + }, "ShipData": { "name": "ChangeAttribute.ShipData.name", "help": "ChangeAttribute.ShipData.help" diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index d7ee8975c..5e2180871 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -2544,6 +2544,10 @@ "name": "始终推送Lua", "help": "有时推送时会失败,视情况开启或者关闭" }, + "Timeout": { + "name": "时限(秒)", + "help": "该项目的时限,修改较多时需要调大" + }, "TargetType": { "name": "目标舰种", "help": "困难图中后排锁定的舰种", @@ -2568,6 +2572,10 @@ "name": "始终推送Lua", "help": "有时推送时会失败,视情况开启或者关闭" }, + "Timeout": { + "name": "时限(秒)", + "help": "该项目的时限,修改较多时需要调大" + }, "ShipData": { "name": "舰船数据", "help": "格式为\"舰船Id;舰船星级;类型Id:属性>目标值[;属性>目标值...]\"\n参考https://github.com/0O0o0oOoO00/SmallKai中的数据" diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 243dd086b..f0e21143e 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -2544,6 +2544,10 @@ "name": "ChangeShip.PushLua.name", "help": "ChangeShip.PushLua.help" }, + "Timeout": { + "name": "ChangeShip.Timeout.name", + "help": "ChangeShip.Timeout.help" + }, "TargetType": { "name": "ChangeShip.TargetType.name", "help": "ChangeShip.TargetType.help", @@ -2568,6 +2572,10 @@ "name": "ChangeAttribute.PushLua.name", "help": "ChangeAttribute.PushLua.help" }, + "Timeout": { + "name": "ChangeAttribute.Timeout.name", + "help": "ChangeAttribute.Timeout.help" + }, "ShipData": { "name": "ChangeAttribute.ShipData.name", "help": "ChangeAttribute.ShipData.help" diff --git a/module/gg_handler/change_attribute.py b/module/gg_handler/change_attribute.py index c1d00df9d..ff1a93798 100644 --- a/module/gg_handler/change_attribute.py +++ b/module/gg_handler/change_attribute.py @@ -59,7 +59,7 @@ class ChangeAttribute(ModuleBase): logger.info("Click confirm") self.device.sleep(0.5) _confirmed = True - self.d.wait_timeout = 90.0 + self.d.wait_timeout = deep_get(self.config.data, "GameManager.ChangeAttribute.Timeout") if _set and _confirmed: try: diff --git a/module/gg_handler/change_ship.py b/module/gg_handler/change_ship.py index a25ce9127..b331e3cc1 100644 --- a/module/gg_handler/change_ship.py +++ b/module/gg_handler/change_ship.py @@ -90,7 +90,7 @@ class ChangeShip(ModuleBase): logger.info("Click confirm") self.device.sleep(0.5) _confirmed = True - self.d.wait_timeout = 90.0 + self.d.wait_timeout = deep_get(self.config.data, "GameManager.ChangeShip.Timeout") if _set and _confirmed: try: