feat: 区分arch

This commit is contained in:
手瓜一十雪 2024-10-13 14:05:40 +08:00
parent 9df5bee8d3
commit ffba3573ba
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
import { InstanceContext, NapCatCore } from '..'; import { InstanceContext, NapCatCore } from '..';
import { RequestUtil } from '@/common/request'; import * as os from 'os';
import offset from '@/core/external/offset.json'; import offset from '@/core/external/offset.json';
import * as crypto from 'crypto'; import * as crypto from 'crypto';
import { PacketClient } from '../helper/packet'; import { PacketClient } from '../helper/packet';
@ -39,7 +39,7 @@ export class NTQQPacketApi {
this.serverUrl = serverUrl; this.serverUrl = serverUrl;
this.qqversion = qqversion; this.qqversion = qqversion;
let offsetTable: OffsetType = offset; let offsetTable: OffsetType = offset;
if (!offsetTable[qqversion]) return false; if (!offsetTable[qqversion + '-' + os.arch()]) return false;
let url = 'ws://' + this.serverUrl + '/ws'; let url = 'ws://' + this.serverUrl + '/ws';
this.PacketClient = new PacketClient(url, this.core.context.logger); this.PacketClient = new PacketClient(url, this.core.context.logger);
await this.PacketClient.connect(); await this.PacketClient.connect();

View File

@ -1,13 +1,13 @@
{ {
"3.2.12-28418": { "3.2.12-28418-x64": {
"recv": "A0723E0", "recv": "A0723E0",
"send": "A06EAE0" "send": "A06EAE0"
}, },
"9.9.15-28418": { "9.9.15-28418-x64": {
"recv": "37A9004", "recv": "37A9004",
"send": "37A4BD0" "send": "37A4BD0"
}, },
"9.9.15-28498": { "9.9.15-28498-x64": {
"recv": "37A9004", "recv": "37A9004",
"send": "37A4BD0" "send": "37A4BD0"
} }