iDevGames Forums
Browser Based.. Updating turn times? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Browser Based.. Updating turn times? (/thread-3278.html)



Browser Based.. Updating turn times? - guest_05 - May 21, 2007 07:41 AM

Alright guys,

Im going to have a go at making a new browser based game.

I will not use socket servers or anything.

What i really want to know is how the users "money" "turns" will update without a socket server?


If only one user is browing the site, and the turn time goes into the next turn, how will all the other players money update?

Would i need to update the entire database?

Any help on this would be helpful.


P.s im using mysql, php. Cheers.


Browser Based.. Updating turn times? - Tobs_ - May 24, 2007 04:03 PM

Record the last time the user was given their turns/money, store that somewhere for each player, and within your login code you could check if enough time has passed to give them more money. If I remember you can subtract dates/times in php to give you how many hours/minutes has passed, then divide the hours by 24, giving you the days (you would have to round this down of course).
Or you could call a php script to give them their turns/money yourself, but doing something yourself is not allowed in today's world; it's amazing how far we will go to be lazy =]

Tobs