diff options
| author | secret_online <me+github@secretonline.co> | 2016-01-24 09:16:33 +1300 |
|---|---|---|
| committer | secret_online <me+github@secretonline.co> | 2016-01-24 09:16:33 +1300 |
| commit | f2833e5d964fb38d79805de3908f153a9314ee6c (patch) | |
| tree | 4ffc5da71456265a4d5b505558bb9986123b7c89 | |
| parent | Beautify with JS Beautify (diff) | |
| download | shulker-f2833e5d964fb38d79805de3908f153a9314ee6c.tar.gz shulker-f2833e5d964fb38d79805de3908f153a9314ee6c.zip | |
Reconnect RCON on error
Added 10s delay inbetween connections
| -rw-r--r-- | index.js | 5 |
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(); |