Jump to content
xisto Community
Sign in to follow this  
Custergrant

Php Update

Recommended Posts

Hey guys,I'm currently making my own online PHP game, and I'm smack into the middle of the coding. The game is an industry/economy type game where you start out with some initial resources and a building and you expand your business empire by building more buildings that produce more buildings, which can be bought and sold on the live market. Basically, you try and become the wealthiest player in the game by the time the round ends.My problem is, I need my game to update hourly and not hourly. Meaning, I have codes that update my MySQL database when a user buys or sells and makes transactions in my game. But, every hour, I would like my game to update the users resources with the output that their buildings are creating. If that's a little confusing, it's like a user has a Sawmill that uses 50 logs/hour and puts out 25 Lumber/hour.I already have a table in my database that has the inputs and outputs/hour for the different buildings, but I need a way to update that into the users' resources. How would I go about doing that? Someone mentioned a cron job, but I'm not too sure.

Share this post


Link to post
Share on other sites

Well, I googled around a bit, and the cron option seems the most popular. I seen someone mention a perl script that runs periodically. I don;t know much (actually, almost nothing) about PHP, but could you simply run a second PHP script with a timer or schedual that would trigger a class to update the mySQL?

Share this post


Link to post
Share on other sites

Try the game travian out and get some ideas of making a game, I am currently making a online game, and i have managed to create a online update system to update resources for each user: crop,iron,bronze and lumber.

If you need any scripts email me or pm me, my website which has many errors and is under construnction is http://forums.xisto.com/no_longer_exists/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.