Hey everyone, still plugging away at a game I'm working on and I'm trying to figure out the best way to approach a fight restriction based on time. Basically, a user can only fight once every 15 minutes. And until the timer is expired they can't click on a "Fight!" button. Now, I understand everyone has issues with energy/time related limitations in games but I'm using it for more of a realistic approach rather than a monetary one. I mean if you get in a fight you are pretty damn tired, you aren't going to rush in to fights back to back. Makes no sense to me. Plus it allows a user to take time to strategize a bit before a fight.
I am using pure php, jquery, and mysql. I am tossing around one approach and I'm curious to hear how anyone of you would approach this.
Idea 1:
Basically when a user clicks fight, it will insert a timestamp of the current time plus 15 minutes into the fighters table under 'nextFightTime'. Then use a db call to check if that time has passed before allowing the user to click again. Of course I would include jquery somewhere for the actual countdown. Just not sure if this is the most efficient.
Anyways thanks in advance for the advice guys.