Skip to content

Commit

Permalink
0.11.31,修正NapCat自动托管时上报地址锁死问题
Browse files Browse the repository at this point in the history
  • Loading branch information
MetaLe0 committed May 29, 2024
1 parent 9be8fb6 commit 3c4bd4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion OlivOS/core/boot/bootDataAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
4 changes: 2 additions & 2 deletions OlivOS/core/info/infoAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions OlivOS/libBooter/libNapCatEXEModelAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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 = {}
Expand All @@ -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": {
Expand Down

0 comments on commit 3c4bd4d

Please sign in to comment.