Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function redne()
- print("Ecoute activée !")
- while true do
- local senderid, mess, proto = rondanet.receive("superproto")
- print("[test]", "[SenderID]:",senderid)
- local table = textutils.unserialize(mess) --Prob vien ici
- if table.action == "login" then
- local user = table.User
- local pass = table.Pass
- if fs.exists("/files/users/"..user) then
- local file fs.open("/files/users/"..user, "r")
- local id = file.readLine()
- local pseudo = file.readLine()
- local mot = file.readLine()
- local argent = file.readLine()
- local historique = file.readLine()
- local entreprise = file.readLine()
- file.close()
- if user == pseudo and mot == pass then
- local table = {action = "login", user = pseudo, response = "yes"}
- rondanet.send(senderid, table)
- else
- local table = {action = "login", user = pseudo, response = "no"}
- rondanet.send(senderid, table)
- end
- elseif table.action == "keyretrive" then
- rondanet.send(senderid, publickey)
- print("Clée public envoyée a",senderid)
- else
- print("Pas implementer", table.action)
- end
- end
- end
- rondanet.close()
- end
Add Comment
Please, Sign In to add comment