From a29d7f151a1587a3959f937203fe99f36c51de48 Mon Sep 17 00:00:00 2001 From: Romain Beaumont Date: Tue, 1 May 2018 21:06:20 +0200 Subject: [PATCH] Increase checkoutTimeoutInterval default to 30s Fix https://github.com/PrismarineJS/mineflayer/issues/644 --- doc/README.md | 2 +- src/client/keepalive.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/README.md b/doc/README.md index a023bde..1b28c24 100644 --- a/doc/README.md +++ b/doc/README.md @@ -78,7 +78,7 @@ Returns a `Client` instance and perform login. * clientToken : generated if a password is given * accessToken : generated if a password is given * keepAlive : send keep alive packets : default to true - * checkTimeoutInterval : default to `10*1000` (10s), check if keepalive received at that period, disconnect otherwise. + * checkTimeoutInterval : default to `30*1000` (30s), check if keepalive received at that period, disconnect otherwise. * version : 1.8 or 1.9 or false (to auto-negotiate): default to 1.8 * customPackets (optional) : an object index by version/state/direction/name, see client_custom_packet for an example diff --git a/src/client/keepalive.js b/src/client/keepalive.js index 17f212f..2c46b7e 100644 --- a/src/client/keepalive.js +++ b/src/client/keepalive.js @@ -4,7 +4,7 @@ module.exports = function(client, options) { const keepAlive = options.keepAlive == null ? true : options.keepAlive; if (!keepAlive) return; - const checkTimeoutInterval = options.checkTimeoutInterval || 20 * 1000; + const checkTimeoutInterval = options.checkTimeoutInterval || 30 * 1000; client.on('keep_alive', onKeepAlive);