From 3d654791b90befdc4b38b45164a65aea4ee083ec 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: Wed, 12 Nov 2025 12:00:36 +0800 Subject: [PATCH] Add platform and arch to native module path Prepends process.platform and process.arch to the native MoeHoo module filename, ensuring the correct binary is loaded for the current environment. --- src/core/packet/handler/client.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/packet/handler/client.ts b/src/core/packet/handler/client.ts index b1bc7609..fe48d66f 100644 --- a/src/core/packet/handler/client.ts +++ b/src/core/packet/handler/client.ts @@ -37,6 +37,7 @@ export class NativePacketHandler { constructor ({ logger }: { logger: LogWrapper; }) { this.logger = logger; try { + const platform = process.platform + '.' + process.arch; const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './native/packet/MoeHoo.' + platform + '.node'); if (!fs.existsSync(moehoo_path)) { this.logger.logWarn(`NativePacketClient: 缺失运行时文件: ${moehoo_path}`);