Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kalldrex

How do i do an account/password check system?

This topic is 6478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would i set up a server so that it..... 1)The client sends his username and the server seaches through a database to confirm it 2)When the client sends the password it confirms that the password belongs to that username! I need this as simple as possible so i can easily add and remove usernames and passwords at my discretion!

Share this post


Link to post
Share on other sites
Advertisement
Well, This all depends on what sort of database you will be using.

SQL, Access, Pandora, Oracle, CSV, Text, Excel, etc etc etc.

Personally I use SQL and I just use the ADO object to access the DB and then I just perform a Query "SELECT Password From UserDB Where Username=''''"

If it reutnrs anything then the Username is valid, now I check to see if the password matches the one returned from the Database, if that is true then they are logged in otherwise I send a error message back and disconnect them.

Share this post


Link to post
Share on other sites
1) what''s the difference between these methods
2) besides access,excel, and text how much $ do they cost?
3) Which one''s the easiest to program with?

Share this post


Link to post
Share on other sites
I can make a Java or Perl script that would do this on the client side for a fair price. Email me at adtomi@popmail.com.

Share this post


Link to post
Share on other sites
I simply send the username password from the client to the server. The server then assembles a file name out of them and if the file exists it opens it and if it doesn''t it''ll send back a message to have the program exit.

Cost = free.

There''s a few things you''ll need to do to keep people from stealing login information but it''s nothing difficult. Don''t use even the username within the game world and keep your server secure.

SQL server is a really good idea but it''s $2000 to beable to use it for anything other than development. I may eventually use it but I''m going to wait and see how the current system holds up.

Ben
http://therabbithole.redback.inficad.com

Share this post


Link to post
Share on other sites
Yes this is waht i want to do but my book on c++ only tells how to open files using the sequential method and that''s no good plus it prolly hard to do this with it cause i don''t know how to make it that it looks for a filename with the user''s name. If you could send me that part of your code or a sample or something i''d apprecieate it.

By your second thing I think you are saying don''t use the username within the game correct? Well i think i''m going to set it up like other MMORPGs that you can set up multiple chars on one account since i don''t want people having more then one account! Then the only ones who can see the actual username is the Admins.

Share this post


Link to post
Share on other sites
Kalldrex, I was talking to Nitro123 .

If you want to try to open a file that you don't know exists, just try to open it, if the call fails, then say that the password/user name was incorrect:
    
bool CheckNamePWord(char *name, char *pword, unsigned int psize) {
char filepath[260];
sprintf(filepath,"AC_%s\\login.inf",name);
FILE *fp = fopen(filepath,"rb");
if(fp!=NULL) {
/* Now we know that file exists, so let's encrypt the password that was provided with whatever encryption you use */
for(unsigned int a=0; a<psize; a++) {
if(fgetc(fp)!=pword[a]) {
fclose(fp);
return false;
}
}
// Well the account exists, and the pword is correct, so return that it worked out

fclose(fp);
return true;
}
return false;
}

There are probably tons of ways to even make that secure, but I hope it conveys what my idea is at least .

[EDIT: fix my code a little ]



http://www.gdarchive.net/druidgames/


Edited by - Null and Void on February 16, 2001 8:22:38 PM

Share this post


Link to post
Share on other sites
I don''t have anything to add to this... I do however have a comment.

The code submitted by Null and Void is at the very root how game programmers need to think. Given a problem; you need to come up with a solution. The solution should be simple and concise which is exactly what has been provided in the example code.

I love to see this kind of thinking...

Game On,


Dave "Dak Lozar" Loeser

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!