summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--index.js5
1 files changed, 5 insertions, 0 deletions
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();