mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Add reconnect when factorio complains about payload size
Sometimes the rcon lib messes up and delivers a 4x package that makes factorio stop responding to rcon and throw an error. We catch that error and attempt to reconnect. Couldn't parse RCON data: Maximum payload size exceeded
This commit is contained in:
1 parent
9971b9f5b3
commit
4db55a8857
2 files changed
+14
-2
No files matched your search
@@ -8,6 +8,7 @@ var request = require("request")
|
||||
var ncp = require('ncp').ncp;
|
||||
var Rcon = require('simple-rcon');
|
||||
var hashFiles = require('hash-files');
|
||||
var _ = require('underscore'):
|
||||
|
||||
var libomega = require("./libomega.js");
|
||||
// require config.json
|
||||
@@ -236,6 +237,15 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\
|
||||
console.log(`child process exited with code ${code}`);
|
||||
process.exit();
|
||||
});
|
||||
serverprocess.stdout.on("data", (data) => {
|
||||
// log("Stdout: " + data);
|
||||
if(data.toString('utf8').includes("Couldn't parse RCON data: Maximum payload size exceeded")){
|
||||
console.error("ERROR: RCON CONNECTION BROKE DUE TO TOO LARGE PACKET!");
|
||||
console.error("Attempting reconnect...");
|
||||
client.close();
|
||||
client.connect();
|
||||
}
|
||||
});
|
||||
/*
|
||||
serverprocess.stdout.on('data', (chunk) => {
|
||||
console.log('OUT: ' + chunk);
|
||||
@@ -286,8 +296,9 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\
|
||||
lastSignalCheck = Date.now();
|
||||
})
|
||||
}
|
||||
|
||||
_.once(instanceManagement);
|
||||
function instanceManagement() {
|
||||
console.log("Started instanceManagement();")
|
||||
// load plugins and execute onLoad event
|
||||
let pluginDirectories = getDirectories("./sharedPlugins/");
|
||||
let plugins = [];
|
||||
|
||||
+2
-1
@@ -32,6 +32,7 @@
|
||||
"portfinder": "^1.0.9",
|
||||
"request": "^2.79.0",
|
||||
"simple-rcon": "^0.3.1",
|
||||
"sync-request": "^4.0.1"
|
||||
"sync-request": "^4.0.1",
|
||||
"underscore": "^1.8.3"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user