Merge remote-tracking branch 'MCRcortex/dev' into dev

This commit is contained in:
Danielv123 committed 2018-04-30 14:26:14 +02:00
commit 6e5585c86c
1 file changed
+15 -5
+15 -5
View File
@@ -828,7 +828,8 @@ function instanceManagement() {
}); });
} }
// if we got some confirmed orders // if we got some confirmed orders
// console.log("Importing " + confirmedOrders.length + " items! " + JSON.stringify(confirmedOrders)); //console.log("Importing " + confirmedOrders.length + " items! " + JSON.stringify(confirmedOrders));
//if (!(confirmedOrders.length>0)){return;}
let cmd="["; let cmd="[";
for(let i=0;i<confirmedOrders.length;i++) for(let i=0;i<confirmedOrders.length;i++)
{ {
@@ -839,8 +840,7 @@ function instanceManagement() {
cmd="["; cmd="[";
} }
} }
messageInterface("/silent-command remote.call('clusterio', 'importMany', '"+cmd.slice(0, -1)+"]"+ "')"); if (!(cmd=="[")){messageInterface("/silent-command remote.call('clusterio', 'importMany', '"+cmd.slice(0, -1)+"]"+ "')");}confirmedOrders=[];
confirmedOrders=[];
} }
}, 1000); }, 1000);
// COMBINATOR SIGNALS --------------------------------------------------------- // COMBINATOR SIGNALS ---------------------------------------------------------
@@ -863,13 +863,23 @@ function instanceManagement() {
} }
inventoryFrame["signal-unixtime"] = Math.floor(Date.now()/1000); inventoryFrame["signal-unixtime"] = Math.floor(Date.now()/1000);
// console.log("RCONing inventory! " + JSON.stringify(inventoryFrame)); // console.log("RCONing inventory! " + JSON.stringify(inventoryFrame));
messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')"); let cmd="{";
for (var key in inventoryFrame)
{
cmd+='"'+key+'"'+":"+inventoryFrame[key]+",";
if(cmd.length>400)//450 //ITS SMALL SO FACTORIO DOESNT SPILT IT INTO MULTIPLE PACKETS
{
messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");
cmd="{";
}
}
if (!(cmd=="[")){messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");}
} catch (e){ } catch (e){
console.log(e); console.log(e);
} }
} }
}); });
}, 1000); }, 1550);
// Make sure world has its worldID // Make sure world has its worldID
setTimeout(function(){ setTimeout(function(){
messageInterface("/silent-command remote.call('clusterio','setWorldID',"+instanceconfig.unique+")") messageInterface("/silent-command remote.call('clusterio','setWorldID',"+instanceconfig.unique+")")