Online Accounts (server-side)
I've been learning a bit about Java net programming, and I've made a simple text client and server. I am now trying to create a client and server for user accounts. I figured that each user account would have a username and a password at the very least, and that this information would have to be saved to a file on the server. What I'm on here for is to ask, how would I organize the files for the accounts on the server and access them? Considering that I would have to loop through the files to make sure usernames aren't repeated.
Any suggestions? As I said, I'm just looking for a way to organize this and loop through accounts (even if the user is not online).
Re: Online Accounts (server-side)
First of all I want to point out that this is a typical database thing. So instead of using single files per user you could have one file which is a database (e.g. using sqlite or hsqldb)
If you want your own implementstion then you should think about the requirements. You could use the username as filename. Then you can quickly access single users.
Or you could use index files which you could load quickly.
But reinventing the wheel might not be a good solution ....