Crons Tutorial

Location of the Videos
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: crons

Post by Jackolantern »

Actually that is a pretty common technique that has been unofficially dubbed the "On Page View" method. You just have a related action that the players take check the last time the code portion was run in the database (or check whatever else you want it to run on) to see if the cron-like part of the script needs to run. Because, if no player sees the page that needs the cron-like script to run, then it likely doesn't matter if it has run at all, if that makes any sense lol. Of course, this method is not recommended for very sensitive scripts, such as those that add to all player's stats (such as auto-healing crons, refilling action points, etc.), because it is possible, although unlikely if you test the times with enough precision, that the script can be run more than once per "tick".
The indelible lord of tl;dr
Post Reply

Return to “Older Browser MMO Videos”