iteration
This commit is contained in:
12
auth.lua
12
auth.lua
@@ -28,10 +28,10 @@ function lns_lookup(hostname)
|
||||
}
|
||||
|
||||
lns_server_id = rednet.lookup("lns", lns_server)
|
||||
rednet.send(lns_server_id, data)
|
||||
rednet.send(lns_server_id, data, "lns")
|
||||
|
||||
while true do
|
||||
id, msg = rednet.receive()
|
||||
id, msg = rednet.receive("lns")
|
||||
if id == lns_server_id then
|
||||
if msg == nil then
|
||||
return nil
|
||||
@@ -57,10 +57,10 @@ if action == "login" then
|
||||
["password"] = password
|
||||
}
|
||||
|
||||
rednet.send(auth_server_id, data)
|
||||
rednet.send(auth_server_id, data, "auth")
|
||||
|
||||
while true do
|
||||
id, msg = rednet.receive()
|
||||
id, msg = rednet.receive("auth")
|
||||
if id == auth_server_id then
|
||||
if msg == "invalid request" then
|
||||
io.write("Invalid request\n")
|
||||
@@ -103,10 +103,10 @@ if action == "register" then
|
||||
["password"] = password
|
||||
}
|
||||
|
||||
rednet.send(auth_server_id, data)
|
||||
rednet.send(auth_server_id, data, "auth")
|
||||
|
||||
while true do
|
||||
id, msg = rednet.receive()
|
||||
id, msg = rednet.receive("auth")
|
||||
if id == auth_server_id then
|
||||
if msg == "invalid request" then
|
||||
io.write("Invalid request\n")
|
||||
|
||||
Reference in New Issue
Block a user