mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
src: Remove _trace from different places in the WS (#3679)
* src: Remove `ws._trace` from READY * src: Remove `ws._trace` from RESUME * lint: Fix lint by removing unused packet (#7) Co-authored-by: bdistin <bdistin@gmail.com>
This commit is contained in:
@@ -74,8 +74,7 @@ class ReadyHandler extends AbstractHandler {
|
|||||||
const ws = this.packetManager.ws;
|
const ws = this.packetManager.ws;
|
||||||
|
|
||||||
ws.sessionID = data.session_id;
|
ws.sessionID = data.session_id;
|
||||||
ws._trace = data._trace;
|
client.emit('debug', `READY ${ws.sessionID}`);
|
||||||
client.emit('debug', `READY ${ws._trace.join(' -> ')} ${ws.sessionID}`);
|
|
||||||
ws.checkIfReady();
|
ws.checkIfReady();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,16 @@ const AbstractHandler = require('./AbstractHandler');
|
|||||||
const Constants = require('../../../../util/Constants');
|
const Constants = require('../../../../util/Constants');
|
||||||
|
|
||||||
class ResumedHandler extends AbstractHandler {
|
class ResumedHandler extends AbstractHandler {
|
||||||
handle(packet) {
|
handle() {
|
||||||
const client = this.packetManager.client;
|
const client = this.packetManager.client;
|
||||||
const ws = client.ws.connection;
|
const ws = client.ws.connection;
|
||||||
|
|
||||||
ws._trace = packet.d._trace;
|
|
||||||
|
|
||||||
ws.status = Constants.Status.READY;
|
ws.status = Constants.Status.READY;
|
||||||
this.packetManager.handleQueue();
|
this.packetManager.handleQueue();
|
||||||
|
|
||||||
const replayed = ws.sequence - ws.closeSequence;
|
const replayed = ws.sequence - ws.closeSequence;
|
||||||
|
|
||||||
ws.debug(`RESUMED ${ws._trace.join(' -> ')} | replayed ${replayed} events.`);
|
ws.debug(`RESUMED | replayed ${replayed} events.`);
|
||||||
client.emit(Constants.Events.RESUME, replayed);
|
client.emit(Constants.Events.RESUME, replayed);
|
||||||
ws.heartbeat();
|
ws.heartbeat();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user