iteration
This commit is contained in:
17
lns.lua
17
lns.lua
@ -2,7 +2,21 @@ args = { ... }
|
|||||||
|
|
||||||
cache = {}
|
cache = {}
|
||||||
|
|
||||||
allow_dynamic_lns_hosts = false
|
|
||||||
|
settings.define("lns_client.allow_dynamic_lns_hosts", {
|
||||||
|
description = "Allow dynamic LNS hosts",
|
||||||
|
type = "boolean",
|
||||||
|
default = false
|
||||||
|
})
|
||||||
|
|
||||||
|
settings.define("lns_client.lns_server", {
|
||||||
|
description = "LNS Server Rednet ID",
|
||||||
|
type = "number",
|
||||||
|
default = 8
|
||||||
|
})
|
||||||
|
|
||||||
|
allow_dynamic_lns_hosts = settings.get("lns_client.allow_dynamic_lns_hosts")
|
||||||
|
lns_server_id = settings.get("lns_client.lns_server")
|
||||||
|
|
||||||
function lns_lookup(remote_hostname)
|
function lns_lookup(remote_hostname)
|
||||||
local data = {
|
local data = {
|
||||||
@ -10,7 +24,6 @@ function lns_lookup(remote_hostname)
|
|||||||
["hostname"] = remote_hostname
|
["hostname"] = remote_hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
local lns_server_id = 8
|
|
||||||
if allow_dynamic_lns_hosts then
|
if allow_dynamic_lns_hosts then
|
||||||
lns_server_id = rednet.lookup("lns", lns_server)
|
lns_server_id = rednet.lookup("lns", lns_server)
|
||||||
if lns_server_id == nil then
|
if lns_server_id == nil then
|
||||||
|
Reference in New Issue
Block a user