From e1ac0f02b4b9a89c5c20931ef8a49093ea9ccf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 5 Nov 2024 10:22:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=90=9E=E7=82=B8=E4=BA=86=20=E8=AE=A9?= =?UTF-8?q?=E6=88=91=E6=80=9D=E8=80=83=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/packet/client/nativeClient.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/core/packet/client/nativeClient.ts b/src/core/packet/client/nativeClient.ts index f91aaf48..9399d133 100644 --- a/src/core/packet/client/nativeClient.ts +++ b/src/core/packet/client/nativeClient.ts @@ -45,15 +45,16 @@ export class NativePacketClient extends PacketClient { const platform = process.platform + '.' + process.arch; const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + '.node'); process.dlopen(this.MoeHooExport, moehoo_path, constants.dlopen.RTLD_LAZY); - this.MoeHooExport.exports.InitHook?.(recv, send, (type: number, uin: string, seq: number, cmd: string, hex_data: string) => { - const callback = this.cb.get(createHash('md5').update(Buffer.from(hex_data, 'hex')).digest('hex') + (type === 0 ? 'send' : 'recv')); - if (callback) { - callback({ seq, cmd, hex_data }); - } else { - this.logger.logError(`Callback not found for hex_data: ${hex_data}`); - } - console.log('type:', type, 'uin:', uin, 'seq:', seq, 'cmd:', cmd, 'hex_data:', hex_data); - }); + console.log('MoeHooExport:', this.MoeHooExport); + // this.MoeHooExport.exports.InitHook?.(recv, send, (type: number, uin: string, seq: number, cmd: string, hex_data: string) => { + // const callback = this.cb.get(createHash('md5').update(Buffer.from(hex_data, 'hex')).digest('hex') + (type === 0 ? 'send' : 'recv')); + // if (callback) { + // callback({ seq, cmd, hex_data }); + // } else { + // this.logger.logError(`Callback not found for hex_data: ${hex_data}`); + // } + // console.log('type:', type, 'uin:', uin, 'seq:', seq, 'cmd:', cmd, 'hex_data:', hex_data); + // }); this.isAvailable = true; }