Give computers actually-unique hostnames

This commit is contained in:
osmarks 2018-07-26 16:36:17 +01:00
parent 910368346f
commit 373be020a3

View File

@ -69,7 +69,7 @@ local protocol = "wyvern"
-- If it errors, an internal error will be returned. -- If it errors, an internal error will be returned.
-- Second argument is the type of node to host as. Other nodes may attempt to use this to discover other local-network nodes. -- Second argument is the type of node to host as. Other nodes may attempt to use this to discover other local-network nodes.
local function serve(fn, nodeType) local function serve(fn, nodeType)
rednet.host(protocol .. "/" .. nodeType, nodeType) rednet.host(protocol .. "/" .. nodeType, nodeType .. "/" .. tostring(os.getComputerID()))
while true do while true do
local sender, message = rednet.receive(protocol) local sender, message = rednet.receive(protocol)