From 86dd4d6847a06d5b3979b939b03cafb7c9d8fb81 Mon Sep 17 00:00:00 2001 From: IoyoCode Date: Wed, 20 Sep 2023 20:10:20 +0100 Subject: [PATCH] fix(ws): fixed using 1015 close code --- .../java/com/seailz/discordjar/gateway/GatewayFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java b/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java index 8fc06554..8c6752dc 100644 --- a/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java +++ b/src/main/java/com/seailz/discordjar/gateway/GatewayFactory.java @@ -169,7 +169,7 @@ public boolean attemptReconnect(CloseStatus status) { switch (status.getCode()) { case 1012: return true; - case 1011, 1015: + case 1011, 1015, 1003: return false; case 4000: if (debug) logger.info("[Gateway] Connection was closed due to an unknown error. Will attempt reconnect."); @@ -407,7 +407,7 @@ public void killConnection() throws IOException { heartbeatManager = null; readyForMessages = false; // close connection - if (getSocket() != null && getSocket().getWs() != null) getSocket().getWs().close(CloseStatus.TLS_HANDSHAKE_FAILURE.getCode(), "Going away"); + if (getSocket() != null && getSocket().getWs() != null) getSocket().getWs().close(CloseStatus.NOT_ACCEPTABLE.getCode(), "Going away"); if (debug) { logger.info("[DISCORD.JAR - DEBUG] Connection closed.");