diff --git a/src/core/packet/client/nativeClient.ts b/src/core/packet/client/nativeClient.ts index 173ec597..0401e0f3 100644 --- a/src/core/packet/client/nativeClient.ts +++ b/src/core/packet/client/nativeClient.ts @@ -29,7 +29,7 @@ export class NativePacketClient extends PacketClient { logger.logError(`[NativePacketClient] Unsupported platform: ${platform}`); return 0; } - const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/moehoo.' + platform + '.node'); + const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/MoeHoo.' + platform + '.node'); if (!fs.existsSync(moehoo_path)) { logger.logError(`[NativePacketClient] Missing moehoo binary: ${moehoo_path}`); return 0; @@ -43,7 +43,7 @@ export class NativePacketClient extends PacketClient { async init(pid: number, recv: string, send: string): Promise { const platform = process.platform + '.' + process.arch; - const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/moehoo.' + platform + '.node'); + 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')); diff --git a/src/native/packet/MoeHoo.win32.node b/src/native/packet/MoeHoo.win32.node new file mode 100644 index 00000000..2beecff7 Binary files /dev/null and b/src/native/packet/MoeHoo.win32.node differ diff --git a/vite.config.ts b/vite.config.ts index d52133c2..b74c214c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -26,6 +26,7 @@ const FrameworkBaseConfigPlugin: PluginOption[] = [ targets: [ { src: './manifest.json', dest: 'dist' }, { src: './src/core/external/napcat.json', dest: 'dist/config/' }, + { src: './src/native/packet', dest: 'dist/moehoo', flatten: false }, { src: './static/', dest: 'dist/static/', flatten: false }, { src: './src/onebot/config/onebot11.json', dest: 'dist/config/' }, { src: './src/framework/liteloader.cjs', dest: 'dist' }, @@ -42,6 +43,7 @@ const ShellBaseConfigPlugin: PluginOption[] = [ cp({ targets: [ { src: './src/native/external', dest: 'dist/native', flatten: false }, + { src: './src/native/packet', dest: 'dist/moehoo', flatten: false }, { src: './static/', dest: 'dist/static/', flatten: false }, { src: './src/core/external/napcat.json', dest: 'dist/config/' }, { src: './src/onebot/config/onebot11.json', dest: 'dist/config/' },