Skip to content

Commit

Permalink
fix: 注释掉无用代码
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed Oct 12, 2024
1 parent cdd00d6 commit 978d2c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/core/apis/group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export class NTQQGroupApi {
this.groupCache.set(group.groupCode, group);
}
this.context.logger.logDebug(`加载${this.groups.length}个群组缓存完成`);
console.log('pid', process.pid);
//console.log('pid', process.pid);
// this.session = await frida.attach(process.pid);
setTimeout(async () => {
this.sendPocketRkey();
}, 10000);
// setTimeout(async () => {
// this.sendPocketRkey();
// }, 10000);
}
async getCoreAndBaseInfo(uids: string[]) {
return await this.core.eventWrapper.callNoListenerEvent(
Expand All @@ -62,7 +62,7 @@ export class NTQQGroupApi {
async sendPocketRkey() {
let hex = '08E7A00210CA01221D0A130A05080110CA011206A80602B006011A0208022206080A081408022A006001';
let ret = await this.core.apis.PacketApi.sendPacket('OidbSvcTrpcTcp.0x9067_202', hex, true);
console.log('ret: ', ret);
//console.log('ret: ', ret);
}
async sendPacketPoke(group: number, peer: number) {
let data = encodeGroupPoke(group, peer);
Expand Down
17 changes: 11 additions & 6 deletions src/core/helper/packet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class PacketClient {
this.logger.log.bind(this.logger)(`Attempting to connect to ${this.url}`);
this.websocket = new WebSocket(this.url);
this.websocket.on('error', (err) => this.logger.logError.bind(this.logger)('[Core] [Packet Server] Error:', err.message));

this.websocket.onopen = () => {
this.isConnected = true;
this.reconnectAttempts = 0;
Expand Down Expand Up @@ -44,12 +45,16 @@ export class PacketClient {
}

private attemptReconnect(): void {
if (this.reconnectAttempts < this.maxReconnectAttempts) {
this.reconnectAttempts++;
this.logger.logError.bind(this.logger)(`Reconnecting attempt ${this.reconnectAttempts}`);
setTimeout(() => this.connect().then().catch(), 1000 * this.reconnectAttempts);
} else {
this.logger.logError.bind(this.logger)(`Max reconnect attempts reached. Could not reconnect to ${this.url}`);
try {
if (this.reconnectAttempts < this.maxReconnectAttempts) {
this.reconnectAttempts++;
this.logger.logError.bind(this.logger)(`Reconnecting attempt ${this.reconnectAttempts}`);
setTimeout(() => this.connect().then().catch(), 1000 * this.reconnectAttempts);
} else {
this.logger.logError.bind(this.logger)(`Max reconnect attempts reached. Could not reconnect to ${this.url}`);
}
} catch (error) {
this.logger.logError.bind(this.logger)(`Error attempting to reconnect: ${error}`);
}
}
async registerCallback(trace_id: string, type: string, callback: any): Promise<void> {
Expand Down

0 comments on commit 978d2c2

Please sign in to comment.