Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --*****************************
- --********BANQUE CLIENT********
- --*****************************
- --Déclaration des variables
- user = ""
- pass = ""
- idserver = 0
- whilef = False
- rondanet = "/disk/rondanet"
- publickey = ""
- os.loadAPI(rondanet)
- -- Fin des déclaration des variables
- function keyretriver()
- idserver = rondanet.lookup("babanque", "server")
- local messagea = {action = "keyretrive"}
- textutils.serialize(messagea)
- rondanet.send(idserver, messagea)
- while true do
- local si, mess, distance = rondanet.receive()
- if si == idserver then
- publickey = mess
- return publickey
- break
- end
- end
- end
- function interfac()
- print("Connection au serveur banquaire")
- rondanet.open("back")
- keyretriver()
- print("Banque interface")
- print("Entrée votre nom d'utilisateur:")
- user = read()
- print("Entrée votre mot de passe")
- pass = read("*")
- print("Connection en cours")
- end
- function conn()
- local logintable = {action = "Login", User = user, Pass = pass, id = os.getComputerID()}
- login = textutils.serialize(logintable)
- idserver = rondanet.lookup("babanque", "server")
- rondanet.send(idserver, login "superproto")
- while whilef == False do
- senderid, message, disance = rondanet.receive()
- if senderid == idserver then
- message = textutils.unserialize(message)
- if message.action == "login" and message.pseudo == user then
- whilef = True
- if message.response == "yes" then
- print("Bravo !")
- else
- print("Mauvais identifiant")
- break
- end
- end
- end
- end
- whilef = False
- end
- interfac()
Add Comment
Please, Sign In to add comment