diff --git a/client.js b/client.js index aded5348..ce67a6a8 100644 --- a/client.js +++ b/client.js @@ -364,12 +364,14 @@ write-data=${ path.resolve(config.instanceDirectory, instance) }\r\n data = data.toString("utf8").replace(/(\r\n\t|\n|\r\t)/gm,""); console.log(data); if(data.includes("Starting RCON interface")){ - let client = new Rcon(); + let client = new Rcon({ + packetResponseTimeout: 200000, + maxPending: 5 + }); client.connect({ host: 'localhost', port: Number(process.env.RCONPORT) || instconf.clientPort, - password: instconf.clientPassword, - timeout: 5000 + password: instconf.clientPassword }); client.onDidAuthenticate(() => { console.log('Clusterio | RCON Authenticated!'); @@ -493,8 +495,10 @@ write-data=${ path.resolve(config.instanceDirectory, instance) }\r\n // connect to the server with rcon if(true || process.platform != "linux"){ // IP, port, password - client = new Rcon(); - + client = new Rcon({ + packetResponseTimeout: 200000, // 200s, should allow for commands up to 1250kB in length + maxPending: 5 + }); // check the logfile to see if the RCON interface is running as there is no way to continue without it // we read the log every 2 seconds and stop looping when we start connecting to factorio function checkRcon() { @@ -505,7 +509,6 @@ write-data=${ path.resolve(config.instanceDirectory, instance) }\r\n host: 'localhost', port: args["rcon-port"] || Number(process.env.RCONPORT) || instanceconfig.clientPort, password: args["rcon-password"] || instanceconfig.clientPassword, - timeout: 5000 }); } else { setTimeout(function(){ diff --git a/package.json b/package.json index 51ee37db..9e8d861f 100644 --- a/package.json +++ b/package.json @@ -56,20 +56,20 @@ "node-factorio-api": "^0.3.1-alpha", "node-forge": "^0.7.1", "prom-client": "^10.2.3", - "rcon-client": "^3.0.2", + "rcon-client": "^3.1.6", "request": "^2.83.0", "right-pad": "^1.0.1", "rmdir-sync": "^1.0.1", "sanitizer": "^0.1.3", "simple-git": "^1.96.0", "single-line-log": "^1.1.2", + "snyk": "^1.134.2", "socket.io": "^2.0.4", "socket.io-client": "^2.0.4", "socket.io-prometheus": "^0.2.1", "sync-request": "^4.0.1", "typescript-collections": "^1.3.2", - "underscore": "^1.8.3", - "snyk": "^1.134.2" + "underscore": "^1.8.3" }, "devDependencies": { "documentation": "^5.4.0",