mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-25 00:23:12 +09:00
Don't open rcon port on linux because its not needed
This commit is contained in:
1 parent
12fd4f28a2
commit
39dcb43199
1 file changed
+11
-9
@@ -249,18 +249,17 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\
|
|||||||
client.close();
|
client.close();
|
||||||
client.connect();
|
client.connect();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
serverprocess.stdout.on('data', (chunk) => {
|
|
||||||
if(process.platform == "linux"){
|
if(process.platform == "linux"){
|
||||||
console.log('Factorio: ' + chunk);
|
// we have to log on linux because linux only shows stdout of the first process launched
|
||||||
|
console.log('Factorio: ' + data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
serverprocess.stderr.on('data', (chunk) => {
|
serverprocess.stderr.on('data', (chunk) => {
|
||||||
console.log('ERR: ' + chunk);
|
console.log('ERR: ' + chunk);
|
||||||
});
|
});
|
||||||
|
|
||||||
// connect to the server with rcon
|
// connect to the server with rcon
|
||||||
|
if(process.platform != "linux"){
|
||||||
// IP, port, password
|
// IP, port, password
|
||||||
client = new Rcon({
|
client = new Rcon({
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
@@ -286,15 +285,19 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\
|
|||||||
setTimeout(checkRcon, 5000);
|
setTimeout(checkRcon, 5000);
|
||||||
|
|
||||||
client.on('authenticated', function () {
|
client.on('authenticated', function () {
|
||||||
console.log('Clusterio | Authenticated!');
|
console.log('Clusterio | RCON Authenticated!');
|
||||||
instanceManagement(); // start using rcons
|
instanceManagement(); // start using rcons
|
||||||
}).on('connected', function () {
|
}).on('connected', function () {
|
||||||
console.log('Clusterio | Connected!');
|
console.log('Clusterio | RCON Connected!');
|
||||||
// getID();
|
// getID();
|
||||||
}).on('disconnected', function () {
|
}).on('disconnected', function () {
|
||||||
console.log('Clusterio | Disconnected!');
|
console.log('Clusterio | RCON Disconnected!');
|
||||||
process.exit(0); // exit because RCON disconnecting is undefined behaviour and we rather just wanna restart now
|
process.exit(0); // exit because RCON disconnecting is undefined behaviour and we rather just wanna restart now
|
||||||
});
|
});
|
||||||
|
} else if(process.platform == "linux"){
|
||||||
|
// TODO: Check if this works fine on linux or if it has to be delayed until the server starts properly
|
||||||
|
instanceManagement();
|
||||||
|
}
|
||||||
|
|
||||||
// set some globals
|
// set some globals
|
||||||
confirmedOrders = [];
|
confirmedOrders = [];
|
||||||
@@ -302,7 +305,7 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure instancemanagement only runs once
|
// ensure instancemanagement only ever runs once
|
||||||
_.once(instanceManagement);
|
_.once(instanceManagement);
|
||||||
function instanceManagement() {
|
function instanceManagement() {
|
||||||
console.log("Started instanceManagement();");
|
console.log("Started instanceManagement();");
|
||||||
@@ -498,7 +501,6 @@ function instanceManagement() {
|
|||||||
for(let key in flowStat1) totalFlows[key] = flowStat1[key];
|
for(let key in flowStat1) totalFlows[key] = flowStat1[key];
|
||||||
for(let key in flowStat2) totalFlows[key] = flowStat2[key];
|
for(let key in flowStat2) totalFlows[key] = flowStat2[key];
|
||||||
if(oldFlowStats && totalFlows && oldTimestamp) {
|
if(oldFlowStats && totalFlows && oldTimestamp) {
|
||||||
// todo: Migrate this to JSON.parse(JSON.stringify())
|
|
||||||
let payload = objectOps.deepclone(totalFlows);
|
let payload = objectOps.deepclone(totalFlows);
|
||||||
// change from total reported to per time unit
|
// change from total reported to per time unit
|
||||||
for(let key in oldFlowStats) {
|
for(let key in oldFlowStats) {
|
||||||
|
|||||||
Reference in new issue
Block a user