Jump to content

Timers for a large number of users.


Recommended Posts

I'm creating a (yet another) PHP MMORPG and it's coming along very smoothly; however, I am unsure what kind of timer methods I would use for giving user's money/stats.

 

If you need an example, let's say I want to give everyone $500 every 30 minutes. What's the best way to go about doing this? The only way I know is to make a cronjob to run a php script, but this can't be efficient or secure.

 

Any ideas?

Link to comment
Share on other sites

yea, just put some sort of identifying measures to make sure users don't try to run the script(if they know it exists). something like if you know it's supposed to run every 30 minutes, do a check to make sure that when it's execited that it really is 2:30 or 2:00 and so on. otherwise, there's no reason why not to use a cronjob

Link to comment
Share on other sites

Thanks guys.

 

I guess I could use a CJ. I was worried that other people would run it (or even a bot), but it wouldn't be that hard to protect.

 

Is it possible to pass variables when running a script? If so, I could just make a 10 digit ID or something.

 

Like /updatescript.php?auth=c732s9kw25

 

and only accept IPs from localhost maybe?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.