fix: packet send/recv

This commit is contained in:
手瓜一十雪
2024-10-12 19:51:29 +08:00
parent bb8b06c044
commit cdd00d665d
4 changed files with 31 additions and 25 deletions

View File

@@ -53,16 +53,7 @@ export class NTQQPacketApi {
async sendPacket(cmd: string, data: string, rsp = false) {
// wtfk tx
// 校验失败和异常 可能返回undefined
return new Promise<undefined | {
type: string,//仅recv含有data
trace_id: string,
data: {
trace_id: string,
seq: number,
hex_data: string,
cmd: string
}
}>((resolve, reject) => {
return new Promise((resolve, reject) => {
if (!this.isInit || !this.PacketClient?.isConnected) {
this.core.context.logger.logError('PacketClient is not init');
return undefined;