From f2833e5d964fb38d79805de3908f153a9314ee6c Mon Sep 17 00:00:00 2001 From: secret_online Date: Sun, 24 Jan 2016 09:16:33 +1300 Subject: Reconnect RCON on error Added 10s delay inbetween connections --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index aae741b..fba3da4 100644 --- a/index.js +++ b/index.js @@ -20,6 +20,11 @@ client.on("auth", function() { } }).on("end", function() { console.log("[INFO] Rcon closed!"); +}).on("error", function() { + client.disconnect(); + setTimeout(function() { + client.connect(); + }, 10000); }); client.connect(); -- cgit 1.4.1