From f9a97222151f165778737fd9165a5468c7fe5fc0 Mon Sep 17 00:00:00 2001 From: joshricker Date: Mon, 18 Feb 2019 03:26:11 -0600 Subject: [PATCH] Remove command length. Remove command length for better compatible with large mod packs. --- sharedPlugins/clusterioMod/index.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sharedPlugins/clusterioMod/index.js b/sharedPlugins/clusterioMod/index.js index 4377c842..240bc2ba 100644 --- a/sharedPlugins/clusterioMod/index.js +++ b/sharedPlugins/clusterioMod/index.js @@ -185,11 +185,6 @@ module.exports = class remoteCommands { for(let i=0;i320) // Factorio max packet size is 508 - { - that.messageInterface("/silent-command remote.call('clusterio', 'runcode', '"+cmd.slice(0, -1)+"}"+ " for k, item in pairs(t) do GiveItemsToStorage(k, item) end')"); - cmd="local t={"; - } } if (!(cmd==="local t={")){ that.messageInterface("/silent-command remote.call('clusterio', 'runcode', '"+cmd.slice(0, -1)+"}"+ " for k, item in pairs(t) do GiveItemsToStorage(k, item) end')"); @@ -222,12 +217,6 @@ module.exports = class remoteCommands { for (let key in inventoryFrame) { cmd+='["'+key+'"]='+inventoryFrame[key]+","; - if(first && cmd.length>300 || !first && cmd.length > 320) // Factorio max packet size is 508 - { - that.messageInterface("/silent-command remote.call('clusterio', 'runcode', '"+(first ? 'global.ticksSinceMasterPinged=0 ':'')+cmd.slice(0, -1)+"}"+ " for name,count in pairs(s) do global.invdata[name]=count end')"); - cmd="local s={"; - first = false; - } } if (!(cmd==="local s={")){ that.messageInterface("/silent-command remote.call('clusterio', 'runcode', '"+(first ? 'global.ticksSinceMasterPinged=0 ':'')+cmd.slice(0, -1)+"}"+ " for name,count in pairs(s) do global.invdata[name]=count end')");