From 66b64eae1bb7e5bc8fce85e3bb10add582f1207a Mon Sep 17 00:00:00 2001 From: MCRcortex Date: Mon, 30 Apr 2018 18:37:08 +1000 Subject: [PATCH 1/8] started fixing receiveInventory --- client.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 05c81ff1..2583f38c 100644 --- a/client.js +++ b/client.js @@ -828,7 +828,7 @@ function instanceManagement() { }); } // if we got some confirmed orders - // console.log("Importing " + confirmedOrders.length + " items! " + JSON.stringify(confirmedOrders)); + console.log("Importing " + confirmedOrders.length + " items! " + JSON.stringify(confirmedOrders)); let cmd="["; for(let i=0;i400)//450 //ITS SMALL SO FACTORIO DOESNT SPILT IT INTO MULTIPLE PACKETS + { + messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')"); + cmd="{"; + } + } + messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");*/ } catch (e){ console.log(e); } } }); - }, 1000); + }, 1500); // Make sure world has its worldID setTimeout(function(){ messageInterface("/silent-command remote.call('clusterio','setWorldID',"+instanceconfig.unique+")") From 5b59abb8e35c87491fc4d49a18812aadce7b6fbe Mon Sep 17 00:00:00 2001 From: MCRcortex Date: Mon, 30 Apr 2018 18:38:48 +1000 Subject: [PATCH 2/8] changeds timings --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index 2583f38c..d21da8ca 100644 --- a/client.js +++ b/client.js @@ -880,7 +880,7 @@ function instanceManagement() { } } }); - }, 1500); + }, 1550); // Make sure world has its worldID setTimeout(function(){ messageInterface("/silent-command remote.call('clusterio','setWorldID',"+instanceconfig.unique+")") From 57f7dec9566d6f529c62591cc346690edae8b090 Mon Sep 17 00:00:00 2001 From: MCRcortex Date: Mon, 30 Apr 2018 18:41:02 +1000 Subject: [PATCH 3/8] recomments stuff --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index d21da8ca..9bac857e 100644 --- a/client.js +++ b/client.js @@ -828,7 +828,7 @@ function instanceManagement() { }); } // if we got some confirmed orders - console.log("Importing " + confirmedOrders.length + " items! " + JSON.stringify(confirmedOrders)); + //console.log("Importing " + confirmedOrders.length + " items! " + JSON.stringify(confirmedOrders)); let cmd="["; for(let i=0;i Date: Mon, 30 Apr 2018 19:32:43 +1000 Subject: [PATCH 4/8] fixed bug fixed so that it doesnt send when cmd=="[" --- client.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 9bac857e..9fe74c22 100644 --- a/client.js +++ b/client.js @@ -829,6 +829,7 @@ function instanceManagement() { } // if we got some confirmed orders //console.log("Importing " + confirmedOrders.length + " items! " + JSON.stringify(confirmedOrders)); + //if (!(confirmedOrders.length>0)){return;} let cmd="["; for(let i=0;i Date: Mon, 30 Apr 2018 20:44:29 +1000 Subject: [PATCH 5/8] split receiveInventory into multiple commands --- client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index 9fe74c22..c3d20cb1 100644 --- a/client.js +++ b/client.js @@ -863,8 +863,8 @@ function instanceManagement() { } inventoryFrame["signal-unixtime"] = Math.floor(Date.now()/1000); // console.log("RCONing inventory! " + JSON.stringify(inventoryFrame)); - messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')"); - /*let cmd="{"; + //messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')"); + let cmd="{"; for (var key in inventoryFrame) { cmd+='"'+key+'"'+":"+inventoryFrame[key]+","; @@ -874,7 +874,7 @@ function instanceManagement() { cmd="{"; } } - messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");*/ + messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')"); } catch (e){ console.log(e); } From f4e03899e796bb199f9e26d811bdb3b36ca01615 Mon Sep 17 00:00:00 2001 From: MCRcortex Date: Mon, 30 Apr 2018 21:28:45 +1000 Subject: [PATCH 6/8] fixed bug --- client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.js b/client.js index c3d20cb1..f3fce050 100644 --- a/client.js +++ b/client.js @@ -874,7 +874,7 @@ function instanceManagement() { cmd="{"; } } - messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')"); + if (!(cmd=="[")){messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");} } catch (e){ console.log(e); } From d6369ba29550cc9928cfadee0ef762b3d301ef8b Mon Sep 17 00:00:00 2001 From: MCRcortex Date: Mon, 30 Apr 2018 21:46:45 +1000 Subject: [PATCH 7/8] reverted stuff to prev commit reverted stuff back to prev commit until the mod has been updated --- client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index f3fce050..b2a74fed 100644 --- a/client.js +++ b/client.js @@ -863,8 +863,8 @@ function instanceManagement() { } inventoryFrame["signal-unixtime"] = Math.floor(Date.now()/1000); // console.log("RCONing inventory! " + JSON.stringify(inventoryFrame)); - //messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')"); - let cmd="{"; + messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')"); + /*let cmd="{"; for (var key in inventoryFrame) { cmd+='"'+key+'"'+":"+inventoryFrame[key]+","; @@ -874,7 +874,7 @@ function instanceManagement() { cmd="{"; } } - if (!(cmd=="[")){messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");} + if (!(cmd=="[")){messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");}*/ } catch (e){ console.log(e); } From 9c9db7882ca78a0cb6910cc2199b0f11067189bd Mon Sep 17 00:00:00 2001 From: MCRcortex Date: Mon, 30 Apr 2018 22:10:13 +1000 Subject: [PATCH 8/8] enabled inventoryFrame command splitting --- client.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client.js b/client.js index b2a74fed..cbedfcf8 100644 --- a/client.js +++ b/client.js @@ -863,8 +863,7 @@ function instanceManagement() { } inventoryFrame["signal-unixtime"] = Math.floor(Date.now()/1000); // console.log("RCONing inventory! " + JSON.stringify(inventoryFrame)); - messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '" + JSON.stringify(inventoryFrame) + "')"); - /*let cmd="{"; + let cmd="{"; for (var key in inventoryFrame) { cmd+='"'+key+'"'+":"+inventoryFrame[key]+","; @@ -874,7 +873,7 @@ function instanceManagement() { cmd="{"; } } - if (!(cmd=="[")){messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");}*/ + if (!(cmd=="[")){messageInterface("/silent-command remote.call('clusterio', 'receiveInventory', '"+cmd.slice(0, -1)+"}"+ "')");} } catch (e){ console.log(e); }