From 30e594ae5f04ea883afd75ac770c833956f8f991 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: Sun, 13 Oct 2024 14:07:04 +0800 Subject: [PATCH] fix: arch --- src/core/apis/packet.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/apis/packet.ts b/src/core/apis/packet.ts index 3a9ee689..12990499 100644 --- a/src/core/apis/packet.ts +++ b/src/core/apis/packet.ts @@ -39,11 +39,12 @@ export class NTQQPacketApi { this.serverUrl = serverUrl; this.qqversion = qqversion; let offsetTable: OffsetType = offset; - if (!offsetTable[qqversion + '-' + os.arch()]) return false; + let table = offsetTable[qqversion + '-' + os.arch()]; + if (!table) return false; let url = 'ws://' + this.serverUrl + '/ws'; this.PacketClient = new PacketClient(url, this.core.context.logger); await this.PacketClient.connect(); - await this.PacketClient.init(process.pid, offsetTable[qqversion].recv, offsetTable[qqversion].send); + await this.PacketClient.init(process.pid, table.recv, table.send); this.isInit = true; return this.isInit; }