View Full Version : KoC/ Darkthrone Turns?
28th March 2007, 08:12 AM
I understand how to make a text based MMOLG, however what has always baffled me is how they make the turns continuely happen. When i make a script it works on user interaction. This seems to run perminantly in the background
Does anyone know how this is done?
28th March 2007, 08:27 AM
Have you tried contacting the KOC and/or DT admins?
28th March 2007, 03:03 PM
What you want to do is set up a cron for every 30 minutes (or whatever time you want) and make it run a php file that gives turns, gold, soldiers, and whatever else you want.
31st March 2007, 02:00 PM
the biggest killer of morpgs is the turn cron, the koc clone thats going arround is a good example, it is highly inefficient and will crash whatever server you have it on before long. crons need to be as efficient and as streamlined as possible, with as little database interaction as you can possibly manage to help reduce the stress on the server.
3rd April 2007, 10:18 AM
the file is cron.php
it runs periodically and gives you turns , gold or wateva
u have to set it somewhere in da CPanel is any.
3rd April 2007, 10:47 AM
Uh cron jobs have nothing to do with PHP autosabber, that is just absurd. Cronjobs are done by crontabs. If you happen to use cron to run PHP such as in the case of "php cron.php"; php is not the mechanism.
The best way to manage a turn cron is with a form of PL/SQL (in the case of oracle), PL/PgSQL (in the case of postgresql), or with a stored procedure in mysql (5 or later... and it still isn't as good as PL/PgSQL or PL/SQL). The crontab that I run for my game is rather simple...
and under my crontab (crontab -e at the shell):
*/15 * * * * /usr/local/bin/php turn.php &2>/dev/null
17th April 2007, 08:57 AM
i acctually do it with mysql and sh scripts on foe.
a shell script basically executes mysql -u<username> turns.sql
This was about the most efficient manner i could work out.
The other way which isn't quite as relyable is a php script that basically runs continually and uses sleep() to work out the timings