mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
fix: Sharding Issues & Cleanup (#2952)
* fix: Sharding causing constant heartbeat / identify spam * misc: Remove wait param in connect * misc: Wait 2.5 seconds before sending identify again if session is resumable * misc: Remove useless destroy call * nit: Capitalization * fix: Identify on HELLO not connectionOpen * misc: Add different intervals for identify after invalid session - 2500 if we couldn't resume in time - 5000 if we didn't have a session ID (per the docs on identify, that a client can only connect every 5 seconds) - Otherwise, just identify again * misc: Only clear heartbeat if shard is fully dead Reconnect clears it otherwise * fix: Accessing .length on a Collection
This commit is contained in:
@@ -15,10 +15,10 @@ class ClientPresence extends Presence {
|
||||
this.client.ws.broadcast({ op: OPCodes.STATUS_UPDATE, d: packet });
|
||||
} else if (Array.isArray(presence.shardID)) {
|
||||
for (const shardID of presence.shardID) {
|
||||
this.client.ws.shards[shardID].send({ op: OPCodes.STATUS_UPDATE, d: packet });
|
||||
this.client.ws.shards.get(shardID).send({ op: OPCodes.STATUS_UPDATE, d: packet });
|
||||
}
|
||||
} else {
|
||||
this.client.ws.shards[presence.shardID].send({ op: OPCodes.STATUS_UPDATE, d: packet });
|
||||
this.client.ws.shards.get(presence.shardID).send({ op: OPCodes.STATUS_UPDATE, d: packet });
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user