From 3c4bd4d804b07730f56a17d88d7a7ed7cedbb767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=91=E8=B4=A8?= Date: Wed, 29 May 2024 16:12:19 +0800 Subject: [PATCH] =?UTF-8?q?0.11.31=EF=BC=8C=E4=BF=AE=E6=AD=A3NapCat?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=98=E7=AE=A1=E6=97=B6=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E9=94=81=E6=AD=BB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OlivOS/core/boot/bootDataAPI.py | 2 +- OlivOS/core/info/infoAPI.py | 4 ++-- OlivOS/libBooter/libNapCatEXEModelAPI.py | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/OlivOS/core/boot/bootDataAPI.py b/OlivOS/core/boot/bootDataAPI.py index 0103e701..1fd4ab69 100644 --- a/OlivOS/core/boot/bootDataAPI.py +++ b/OlivOS/core/boot/bootDataAPI.py @@ -529,7 +529,7 @@ "rx_queue": "OlivOS_napcat_lib_rx_queue", "tx_queue": "OlivOS_rx_queue", "logger_proc": "OlivOS_logger", - "target_proc": None, + "target_proc": "OlivOS_flask_post_rx", "control_queue": "OlivOS_control_queue", "debug": False }, diff --git a/OlivOS/core/info/infoAPI.py b/OlivOS/core/info/infoAPI.py index 942c3ed2..715a6db3 100644 --- a/OlivOS/core/info/infoAPI.py +++ b/OlivOS/core/info/infoAPI.py @@ -17,8 +17,8 @@ import OlivOS -OlivOS_Version = '0.11.30' -OlivOS_SVN = 150 +OlivOS_Version = '0.11.31' +OlivOS_SVN = 151 # Compatible <= Plugin[compatible_svn] : Compatible # OldCompatible <= Plugin[compatible_svn] < Compatible : OldCompatible Warn diff --git a/OlivOS/libBooter/libNapCatEXEModelAPI.py b/OlivOS/libBooter/libNapCatEXEModelAPI.py index 191d0214..afa7b46f 100644 --- a/OlivOS/libBooter/libNapCatEXEModelAPI.py +++ b/OlivOS/libBooter/libNapCatEXEModelAPI.py @@ -81,7 +81,7 @@ def startNapCatLibExeModel( control_queue=multiprocessing_dict[basic_conf_models_this['control_queue']], logger_proc=Proc_dict[basic_conf_models_this['logger_proc']], bot_info_dict=plugin_bot_info_dict[bot_info_key], - target_proc=None, + target_proc=basic_conf_models[basic_conf_models_this['target_proc']], debug_mode=False ) Proc_Proc_dict[tmp_Proc_name] = Proc_dict[tmp_Proc_name].start_unity(tmp_proc_mode) @@ -127,7 +127,7 @@ def run(self): releaseDir(f"./conf/napcat/{self.Proc_data['bot_info_dict'].hash}") releaseDir(f"./conf/napcat/{self.Proc_data['bot_info_dict'].hash}/config") unzip('./lib/NapCat.zip', f"./conf/napcat/{self.Proc_data['bot_info_dict'].hash}") - napcatTypeConfig(self.Proc_data['bot_info_dict']).setConfig() + napcatTypeConfig(self.Proc_data['bot_info_dict'], self.Proc_config['target_proc']).setConfig() if self.Proc_data['bot_info_dict'].platform['model'] in [ 'napcat', 'napcat_show' @@ -317,8 +317,9 @@ def sendControlEventSend(self, action, data): class napcatTypeConfig(object): - def __init__(self, bot_info_dict:OlivOS.API.bot_info_T): + def __init__(self, bot_info_dict:OlivOS.API.bot_info_T, target_proc): self.bot_info_dict = bot_info_dict + self.target_proc = target_proc self.config_file_str = '' self.config_file_data = '' self.config_file_format = {} @@ -327,7 +328,7 @@ def setConfig(self): self.config_file_format['uin'] = str(self.bot_info_dict.id) self.config_file_format['token'] = self.bot_info_dict.post_info.access_token self.config_file_format['port'] = str(self.bot_info_dict.post_info.port) - self.config_file_format['postUrls'] = 'http://127.0.0.1:55001/OlivOSMsgApi/qq/onebot/default' + self.config_file_format['postUrls'] = f"http://127.0.0.1:{self.target_proc['server']['port']}/OlivOSMsgApi/qq/onebot/default" self.config_file_data = { "http": {