mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Fixed stack size exceeded bug
This commit is contained in:
1 parent
a8dfd22eeb
commit
181cb1179c
2 files changed
+6
-8
No files matched your search
@@ -1,6 +1,5 @@
|
|||||||
module.exports = class remoteCommands {
|
module.exports = class remoteCommands {
|
||||||
constructor(mergedConfig, messageInterface, extras){
|
constructor(mergedConfig, messageInterface, extras){
|
||||||
console.log = messageInterface;
|
|
||||||
this.messageInterface = messageInterface;
|
this.messageInterface = messageInterface;
|
||||||
this.config = mergedConfig;
|
this.config = mergedConfig;
|
||||||
this.socket = extras.socket;
|
this.socket = extras.socket;
|
||||||
|
|||||||
@@ -3,24 +3,22 @@ const needle = require("needle");
|
|||||||
|
|
||||||
|
|
||||||
class ResearchSync {
|
class ResearchSync {
|
||||||
|
|
||||||
constructor(slaveConfig, messageInterface){
|
constructor(slaveConfig, messageInterface){
|
||||||
this.functions = this.loadFunctions();
|
this.functions = this.loadFunctions();
|
||||||
this.config = slaveConfig;
|
this.config = slaveConfig;
|
||||||
this.messageInterface = messageInterface;
|
this.messageInterface = messageInterface;
|
||||||
console.log = messageInterface;
|
|
||||||
|
|
||||||
this.research = {};
|
this.research = {};
|
||||||
|
|
||||||
messageInterface("ResearchSync enabled");
|
messageInterface("ResearchSync enabled");
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
this.doSync();
|
||||||
this.pollResearch();
|
this.pollResearch();
|
||||||
setTimeout(this.doSync, 2)
|
}, 30000);
|
||||||
}, 2000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pollResearch() {
|
pollResearch() {
|
||||||
this.messageInterface("Polling Research\n")
|
// this.messageInterface("Polling Research\n")
|
||||||
this.messageInterface(this.functions.dumpResearch);
|
this.messageInterface(this.functions.dumpResearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,8 +57,9 @@ class ResearchSync {
|
|||||||
// this.messageInterface("/c game.forces['player'].technologies['" + key + "'].researched=true");
|
// this.messageInterface("/c game.forces['player'].technologies['" + key + "'].researched=true");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if(Object.keys(difference).length > 0){
|
||||||
console.log("difference from other servers", difference);
|
this.messageInterface("difference from other servers", difference);
|
||||||
|
}
|
||||||
needle.post(this.config.masterIP + ':' + this.config.masterPort + '/api/editSlaveMeta', {
|
needle.post(this.config.masterIP + ':' + this.config.masterPort + '/api/editSlaveMeta', {
|
||||||
instanceID: this.config.unique,
|
instanceID: this.config.unique,
|
||||||
password: this.config.clientPassword,
|
password: this.config.clientPassword,
|
||||||
|
|||||||
Reference in new issue
Block a user