Attempted to fix combinator transmission

This commit is contained in:
Danielv123 committed 2018-01-19 20:30:15 +01:00
1 parent 501807884f
commit 1ab3c49772
1 file changed
+4 -1
+4 -1
View File
@@ -845,12 +845,13 @@ function instanceManagement() {
fs.writeFileSync(instancedirectory + "/script-output/txbuffer.txt", "");
// txBufferClearCounter = 0;
//}
signals = signals.split("\n");
console.log(signals);
if (signals[0]) {
fs.writeFileSync(instancedirectory + "/script-output/txbuffer.txt", "");
// loop through all our frames
for (let i = 0; i < signals.length; i++) {
if (signals[i]) {
if (signals[i] && objectOps.isJSON(signals[i])) {
// signals[i] is a JSON array called a "frame" of signals. We timestamp it for storage on master
// then we unpack and RCON in this.frame to the game later.
let framepart = JSON.parse(signals[i]);
@@ -860,6 +861,8 @@ function instanceManagement() {
}
// send to master using socket.io, opened at the top of instanceManagement()
socket.emit("combinatorSignal", doneframe);
} else {
console.log("Invalid jsony: "+signals[i])
}
}
}