feat(inferium-server)!: support of multi computer plans
This commit is contained in:
parent
b075b953ab
commit
e628ec2153
@ -1,14 +0,0 @@
|
||||
local function mystical(essenceName)
|
||||
return 'mysticalagriculture:' .. essenceName .. '_seeds'
|
||||
end
|
||||
|
||||
return {
|
||||
mystical('coal'),
|
||||
mystical('coal'),
|
||||
mystical('coal'),
|
||||
mystical('coal'),
|
||||
mystical('experience'),
|
||||
mystical('experience'),
|
||||
mystical('experience'),
|
||||
mystical('inferium')
|
||||
}
|
||||
16
config/inferium-plans.lua
Normal file
16
config/inferium-plans.lua
Normal file
@ -0,0 +1,16 @@
|
||||
local function mystical(essenceName)
|
||||
return 'mysticalagriculture:' .. essenceName .. '_seeds'
|
||||
end
|
||||
|
||||
return {
|
||||
default = {
|
||||
mystical('coal'),
|
||||
mystical('coal'),
|
||||
mystical('inferium'),
|
||||
mystical('inferium'),
|
||||
mystical('inferium'),
|
||||
mystical('inferium'),
|
||||
mystical('inferium'),
|
||||
mystical('inferium')
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,18 @@
|
||||
local inferiumPlan = require('config/inferium-plan') -- temporary default plan
|
||||
local inferiumPlans = require('config/inferium-plans') -- temporary default plan
|
||||
|
||||
local VERSION = "0.1.0"
|
||||
local VERSION = "0.2.0"
|
||||
|
||||
local INFERIUM_QUERY_PORT = 111
|
||||
local INFERIUM_REPLY_PORT = 112
|
||||
|
||||
local defaultPlan = inferiumPlans.default or error('no default plan provided in config')
|
||||
|
||||
local modem = peripheral.find("modem") or error("No modem attached", 0)
|
||||
|
||||
modem.open(INFERIUM_QUERY_PORT)
|
||||
|
||||
local function getPlanForComputer(computerId)
|
||||
return inferiumPlan
|
||||
return inferiumPlans[computerId] or defaultPlan
|
||||
end
|
||||
|
||||
local function messageReceived(message)
|
||||
|
||||
@ -18,7 +18,7 @@ local LIST_CONFIG_FILES = {
|
||||
'upgrade.lua',
|
||||
'config/mining.lua',
|
||||
'config/harvesting.lua',
|
||||
'config/inferium-plan.lua'
|
||||
'config/inferium-plans.lua'
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user