mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 16:23:12 +09:00
Attempted fix for command corruption
This commit is contained in:
1 parent
6a7042c0aa
commit
fc1f3bd077
1 file changed
+15
-5
@@ -831,11 +831,21 @@ 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));
|
||||||
sadas = JSON.stringify(confirmedOrders);
|
let itemCount = confirmedOrders.length;
|
||||||
confirmedOrders = [];
|
if(itemCount > 0){
|
||||||
// send our RCON command with whatever we got
|
let numberOfFragments = Math.floor(itemCount*20/2000); // 20 is approximate length of items, 2000 is maximum length we want to send at a time
|
||||||
messageInterface("/silent-command remote.call('clusterio', 'importMany', '" + sadas + "')");
|
let exportedCount = 0;
|
||||||
sadas = null;
|
let exportFragment = [];
|
||||||
|
while(exportedCount < itemCount){
|
||||||
|
exportFragment[exportFragment.length] = confirmedOrders[exportedCount];
|
||||||
|
exportedCount++;
|
||||||
|
if(exportFragment.length > 100 || exportedCount >= itemCount){
|
||||||
|
messageInterface("/silent-command remote.call('clusterio', 'importMany', '" + JSON.stringify(exportFragment) + "')");
|
||||||
|
exportFragment = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
confirmedOrders = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
// COMBINATOR SIGNALS ---------------------------------------------------------
|
// COMBINATOR SIGNALS ---------------------------------------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user