Author Topic: General Help wanted  (Read 839 times)

Offline Rimmy

  • Level 12
  • *
  • Posts: 80
  • Reputation: +1/-0
    • View Profile
General Help wanted
« on: March 18, 2008, 04:06:24 PM »
I have encountered a few problems while working on my game. The biggest issue I have is the registration/login system. I know that this has probably been on the board before, but I really just need help from this community. I have read tons of tutorials out there, but I just can't get anything to work. I'm looking for help on getting a good registration/login system to work. What I'm looking for is a login system that doesn't even have to have a ton of security features. That is not to say that I'm looking for something with no security at all. I just need more personalized help. Even if you provided a list of links, that would be very much appreciated.

The next issue I have is that sooner or later, I'm going to have to use CRON jobs. I have no background knowledge of this at all. If someone could provide links or even personalized help, that would be great. All I'm looking for is a way to update turns hourly.

That's really all the help I need for now. I thank everyone in advance who posts on this thread with helpful information. Please don't post garbage though. :)

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: General Help wanted
« Reply #1 on: March 28, 2008, 10:49:16 AM »
Login is pretty simple. I assume you have some sort of user database. All you do is store a hashed version of that user's password in your database as a field. Then, you login consists of a username and password. Whatever password the user supplies, you perform the hashing algorithm and check to see if the two hashes match. If they do, then the user has successfully authenticated themself.

However, since http is stateless, you need to provide some way of tracking the state of the application. This is usually accomplished with 'sessions' which store a cookie in the browser to be accessed later by the application. My preferred method is to generate a unique identifier and tie it to the user account in the database. Upon each successful use of the identifier, it is refreshed and the new one replaces the old. This adds a level of security in that a compromised id grants the attacker a very short window of vulnerability.

As far as your CRON jobs are concerned. You likely do not need them simply to refresh turns. Simply insert a timestamp into the database and select them back out whenever it is possible for turns to be gained.
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Rimmy

  • Level 12
  • *
  • Posts: 80
  • Reputation: +1/-0
    • View Profile
Re: General Help wanted
« Reply #2 on: March 28, 2008, 05:13:14 PM »
Thanks for the reply. Do you know of any good sources that could help me with the turns?

Offline robot

  • Level 6
  • *
  • Posts: 26
  • Reputation: +0/-0
    • View Profile
    • PhpGame
Re: General Help wanted
« Reply #3 on: March 28, 2008, 05:38:38 PM »
this is a simple login script http://phpgame.net/a-basic-login-logout-system-with-session.php

you could first start up with the turn generation using cron
just create a php file with script to add turn to all accounts and set to cron to execute it every hour
you should try asking your web hosting support on how to setup the cron to execute the file

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal