This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
TheCodMan78's profile picture

Storing info on servers

Started by TheCodMan78, 15 April 2013 - 12:43 PM
TheCodMan78 #1
Posted 15 April 2013 - 02:43 PM
Hey guys, so basically what I want to go about doing is I want to store login info for computers on a server. And the computers ask the server if the login is correct. Does anyone know how I could go about doing this? I'm not asking for a program to do this. Just for someone to point me in the right direction. Thanks :)/>

-cod
Sammich Lord #2
Posted 15 April 2013 - 02:45 PM
Have a table store all the login info. Then have the server constantly wait for rendet messages that then checks to see if the username is in the table, if so then check to see if the password is correct, if so send a message back saying it is true.
TheCodMan78 #3
Posted 15 April 2013 - 02:50 PM
Have a table store all the login info. Then have the server constantly wait for rendet messages that then checks to see if the username is in the table, if so then check to see if the password is correct, if so send a message back saying it is true.
Thanks for the answer, and responding so quickly! :)/>
TheCodMan78 #4
Posted 15 April 2013 - 03:07 PM
Have a table store all the login info. Then have the server constantly wait for rendet messages that then checks to see if the username is in the table, if so then check to see if the password is correct, if so send a message back saying it is true.
Could you also point me in the right direction a little further? :P/> (If that made any sense?)
Sammich Lord #5
Posted 15 April 2013 - 03:10 PM
Have a table store all the login info. Then have the server constantly wait for rendet messages that then checks to see if the username is in the table, if so then check to see if the password is correct, if so send a message back saying it is true.
Could you also point me in the right direction a little further? :P/> (If that made any sense?)
I'll right you some basic code for it.

local logins = {
  ['username'] = 'Hello',
  ['Helloworld123'] = 'password123'
}
That would be the basic table.
Then you would just want a split function to split the message. The message would be sorta like this "Login:USERNAME:PASSWORD". Hope that explains more.
TheCodMan78 #6
Posted 15 April 2013 - 03:13 PM
Sure did, thanks.