iteration

This commit is contained in:
Layla 2023-10-08 01:52:14 -04:00
parent 583bca0a38
commit d0ea038cdb

17
lns.lua
View File

@ -2,7 +2,21 @@ args = { ... }
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)
local data = {
@ -10,7 +24,6 @@ function lns_lookup(remote_hostname)
["hostname"] = remote_hostname
}
local lns_server_id = 8
if allow_dynamic_lns_hosts then
lns_server_id = rednet.lookup("lns", lns_server)
if lns_server_id == nil then