Find the answer to your Linux question:
Results 1 to 5 of 5

Thread: Just wondering

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Just wondering

    Hey, Im kind of new to computer programming and server administration, but im the type of person who likes a challenge so heres my situation. I want to run a webserver for a text based strategy game. Im going to write it out in python cgi scripts (python for ease of use) with all the data stored in a mysql database. Now, how exactly do i get user name authentication to match up with info in the my sql database? do i assign each person their own mini database containing their info accessed by their username and password? If you could point me to a tutorial that i might have missed while googling that would be just as appreciated as anything. If I havent made my question clear enough let me know. All help is appreciated.

  2. #2
    Linux Newbie
    Join Date
    Apr 2005
    South America

    Re: Just wondering

    Quote Originally Posted by mrprchr i assign each person their own mini database containing their info accessed by their username and password? ...
    Dya mean like a replacement to tables??

  3. #3
    Well, i think i worded that kind of awkwardly. Basically what im saying is im going to make a game, and when people log in to the game, how do i handle that? When they click on the login link how do i make it so that it is that persons kingdom information that is displayed? Im not really sure how to word it, but i think thats a little better of an idea.

  4. $spacer_open
  5. #4
    Well, what about this:

    Give each user a user id (UID).

    Have a table with each UID, there login name, screen name (if you want a sperate one) and password.

    UID login_name screen_name password
    001 "france20" "French Fred" "x1s5f1x"
    002 "bobToo" "King Edward" "toilets"

    Then when they login, you can check the login name against the password and maybe store the UID in a cookie??? or somehow identify that the user has logged on, maybe a boolean value in the table above which you could set to true when they are logged in....

    Then have a second table consiting of fields that have the UID, and then all the data about the kingdom they own:

    UID Size_of_kingdom Capital_city population points
    001 27 Paris 426000 12
    002 41 London 542100 15
    THen you can load the data from the coresponding field in that record (by matching the UID's) back into the game. You'd only have 2 tables, and each user will only have one record that you would need to check to load back there game.

    Its not perfect... theres a few things you need to think about, like how to tell weather someone is logged on etc... but hope that helps you out a bit maybe!

  6. #5
    That sounds good to me. Like I said, im still new to working with computers but I learn fast so thats good. Now that you helped me on the login authentification part, i can get everything together and start finishing up. Thank you for your help, youve got me rolling along now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts