feat: version hint

This commit is contained in:
手瓜一十雪 2024-10-26 21:24:24 +08:00
parent 0000ec8b5b
commit 0d99d30b2d

View File

@ -62,7 +62,10 @@ export class NTQQPacketApi {
this.qqVersion = qqversion; this.qqVersion = qqversion;
const offsetTable: OffsetType = offset; const offsetTable: OffsetType = offset;
const table = offsetTable[qqversion + '-' + os.arch()]; const table = offsetTable[qqversion + '-' + os.arch()];
if (!table) return false; if (!table) {
this.logger.logError('PacketServer Offset table not found for QQVersion: ', qqversion + '-' + os.arch());
return false;
}
const url = 'ws://' + this.serverUrl + '/ws'; const url = 'ws://' + this.serverUrl + '/ws';
this.packetSession = new PacketSession(this.core.context.logger, new PacketClient(url, this.core)); this.packetSession = new PacketSession(this.core.context.logger, new PacketClient(url, this.core));
const cb = () => { const cb = () => {
@ -103,7 +106,7 @@ export class NTQQPacketApi {
let status = 0; let status = 0;
try { try {
const packet = this.packetSession?.packer.packStatusPacket(uin); const packet = this.packetSession?.packer.packStatusPacket(uin);
const ret = await this.sendOidbPacket( packet!, true); const ret = await this.sendOidbPacket(packet!, true);
const data = Buffer.from(ret.hex_data, 'hex'); const data = Buffer.from(ret.hex_data, 'hex');
const ext = new NapProtoMsg(OidbSvcTrpcTcp0XFE1_2RSP).decode(new NapProtoMsg(OidbSvcTrpcTcpBase).decode(data).body).data.status.value; const ext = new NapProtoMsg(OidbSvcTrpcTcp0XFE1_2RSP).decode(new NapProtoMsg(OidbSvcTrpcTcpBase).decode(data).body).data.status.value;
// ext & 0xff00 + ext >> 16 & 0xff // ext & 0xff00 + ext >> 16 & 0xff
@ -146,7 +149,7 @@ export class NTQQPacketApi {
peerUid: groupUin ? String(groupUin) : this.core.selfInfo.uid peerUid: groupUin ? String(groupUin) : this.core.selfInfo.uid
}, e)); }, e));
} }
if (e instanceof PacketMsgFileElement){ if (e instanceof PacketMsgFileElement) {
reqList.push(this.packetSession?.highwaySession.uploadFile({ reqList.push(this.packetSession?.highwaySession.uploadFile({
chatType: groupUin ? ChatType.KCHATTYPEGROUP : ChatType.KCHATTYPEC2C, chatType: groupUin ? ChatType.KCHATTYPEGROUP : ChatType.KCHATTYPEC2C,
peerUid: groupUin ? String(groupUin) : this.core.selfInfo.uid peerUid: groupUin ? String(groupUin) : this.core.selfInfo.uid