From 40113fc0d8647125a3138b9361126d2da4d26fe3 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Tue, 25 Oct 2022 13:36:13 +0700 Subject: [PATCH] change reconnectect timeout and readd reason check --- config.js | 2 +- index.js | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/config.js b/config.js index 2d846f8..8eb21e3 100644 --- a/config.js +++ b/config.js @@ -14,7 +14,7 @@ module.exports = { 'eval': { 'serverUrl': 'http://192.168.1.105:4445/', }, - 'reconnectTimeout': 1000 * 6, + 'reconnectTimeout': 1000 * 2, 'discord': { 'token': 'OTcxNjUwNDU2NzA5Mzk4NTY5.G3lKC2._XQNTTU1Jqmaam_A0JKSe93GP1vFZvDpiXqZzA', 'servers': { diff --git a/index.js b/index.js index be9d383..2e43a8d 100644 --- a/index.js +++ b/index.js @@ -217,14 +217,12 @@ function main() { const timeout = config.reconnectTimeout; - // try { - // if (reason.text) { - // if (reason.text === 'Wait 5 seconds before connecting, thanks! :)') timeout = 1000 * 6; - // if (reason.text === 'You are logging in too fast, try again later.') timeout = 1000 * 6; - // } - // } catch (e) { - // console.log(e.message); - // } + try { + if (reason.text) { + if (reason.text === 'Wait 5 seconds before connecting, thanks! :)') timeout = 1000 * 6; + if (reason.text === 'You are logging in too fast, try again later.') timeout = 1000 * 6; + } + } catch (e) {} try { clearInterval(notonline);