feat: update type define in packet
This commit is contained in:
6 files changed
+28
-26
No files matched your search
@@ -13,16 +13,6 @@ import {isNumeric, solveAsyncProblem} from '@/common/helper';
|
||||
import {LimitedHashTable} from '@/common/message-unique';
|
||||
import {NTEventWrapper} from '@/common/event';
|
||||
|
||||
interface recvPacket {
|
||||
type: string,//仅recv
|
||||
trace_id_md5?: string,
|
||||
data: {
|
||||
seq: number,
|
||||
hex_data: string,
|
||||
cmd: string
|
||||
}
|
||||
}
|
||||
|
||||
export class NTQQGroupApi {
|
||||
context: InstanceContext;
|
||||
core: NapCatCore;
|
||||
|
||||
@@ -2,8 +2,8 @@ import * as os from 'os';
|
||||
import * as crypto from 'crypto';
|
||||
import {InstanceContext, NapCatCore} from '..';
|
||||
import offset from '@/core/external/offset.json';
|
||||
import {PacketClient} from '@/core/packet/packetClient';
|
||||
import {PacketHexStr, PacketPacker} from "@/core/packet/packetPacker";
|
||||
import {PacketClient, RecvPacketData} from '@/core/packet/client';
|
||||
import {PacketHexStr, PacketPacker} from "@/core/packet/packer";
|
||||
import {NapProtoMsg} from '@/core/packet/proto/NapProto';
|
||||
import {OidbSvcTrpcTcp0X9067_202_Rsp_Body} from '@/core/packet/proto/oidb/Oidb.0x9067_202';
|
||||
import {OidbSvcTrpcTcpBase, OidbSvcTrpcTcpBaseRsp} from '@/core/packet/proto/oidb/OidbBase';
|
||||
@@ -65,12 +65,12 @@ export class NTQQPacketApi {
|
||||
return text;
|
||||
}
|
||||
|
||||
async sendPacket(cmd: string, data: PacketHexStr, rsp = false): Promise<any> {
|
||||
async sendPacket(cmd: string, data: PacketHexStr, rsp = false): Promise<RecvPacketData> {
|
||||
// wtfk tx
|
||||
// 校验失败和异常 可能返回undefined
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.isInit || !this.packetClient?.available) {
|
||||
this.core.context.logger.logError('packetClient is not init');
|
||||
this.core.context.logger.logError('PacketClient is not init');
|
||||
return undefined;
|
||||
}
|
||||
let md5 = crypto.createHash('md5').update(data).digest('hex');
|
||||
|
||||
Reference in new issue
Block a user