correctly handle invalid session (#1020)

* correctly handle invalid session

* give discord some time, use it wisely
This commit is contained in:
Gus Caplan
2016-12-26 18:04:09 -06:00
committed by Amish Shah
parent b0c2f818a8
commit b79533e373

View File

@@ -78,8 +78,14 @@ class WebSocketPacketManager {
}
if (packet.op === Constants.OPCodes.INVALID_SESSION) {
this.ws.sessionID = null;
this.ws._sendNewIdentify();
if (packet.d) {
setTimeout(() => {
this.ws._sendResume();
}, 2500);
} else {
this.ws.sessionID = null;
this.ws._sendNewIdentify();
}
return false;
}