diff --git a/config/inferium.lua b/config/inferium.lua index 9577534..5167ec4 100644 --- a/config/inferium.lua +++ b/config/inferium.lua @@ -15,7 +15,6 @@ return { mystical('inferium') }, fertilizedBoost = false, - length = 8, firstCropZ = 2 } } diff --git a/inferium-server.lua b/inferium-server.lua index 7a8b179..edde063 100644 --- a/inferium-server.lua +++ b/inferium-server.lua @@ -1,7 +1,8 @@ local net = require('libs/net') +local utils = require('libs/utils') local inferium = require('config/inferium') -local VERSION = "1.1.1" +local VERSION = "1.1.2" local INFERIUM_SERVER = 'inferium.com' local PERSISTED_CONFIGS = '/data/inferium-configs' @@ -46,6 +47,14 @@ local function setConfigForComputer(computerId, config) savePersistedConfigs(LOCAL_CONFIGS) end +local function getConfigWithLength(config) + local configWithLength = utils.shallowClone(config) + configWithLength.length = utils.sizeof(config.plan) + + return configWithLength +end + + local function getConfig(computerId) if not computerId == nil then print('getconfig error: no computerId found') @@ -62,7 +71,7 @@ local function getConfig(computerId) return { type = "getconfig/response", - payload = config + payload = getConfigWithLength(config) } end