BananeMan

Untitled

Sep 22nd, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. function redne()
  2. print("Ecoute activée !")
  3. while true do
  4. local senderid, mess, proto = rondanet.receive("superproto")
  5. print("[test]", "[SenderID]:",senderid)
  6. local table = textutils.unserialize(mess) --Prob vien ici
  7. if table.action == "login" then
  8. local user = table.User
  9. local pass = table.Pass
  10. if fs.exists("/files/users/"..user) then
  11. local file fs.open("/files/users/"..user, "r")
  12.  
  13. local id = file.readLine()
  14. local pseudo = file.readLine()
  15. local mot = file.readLine()
  16. local argent = file.readLine()
  17. local historique = file.readLine()
  18. local entreprise = file.readLine()
  19. file.close()
  20. if user == pseudo and mot == pass then
  21. local table = {action = "login", user = pseudo, response = "yes"}
  22. rondanet.send(senderid, table)
  23. else
  24. local table = {action = "login", user = pseudo, response = "no"}
  25. rondanet.send(senderid, table)
  26. end
  27. elseif table.action == "keyretrive" then
  28. rondanet.send(senderid, publickey)
  29. print("Clée public envoyée a",senderid)
  30. else
  31. print("Pas implementer", table.action)
  32. end
  33. end
  34. end
  35. rondanet.close()
  36. end
Add Comment
Please, Sign In to add comment