Jump to content


Help with cron jobs with MMORPG text based game!


3 replies to this topic

#1 00king00

    Young Padawan

  • Members
  • Pip
  • 13 posts

Posted 08 May 2007 - 10:27 AM

Help with cron jobs with MMORPG test based game!

Hello,

I lunched a new MMORPG text based game, but the player (turns) not working, the (turns) function in the game should be automatically run after 30 min

I tried to search the database bit can't find any information or tips to let the turns works, I setup a cron jobs as per the script information but also the (turns) didn't work :-(

I got a hint from a friend that maybe the IP server is involved with the turns, is it true? And how I can let the turn's works?

Thanx

#2 00king00

    Young Padawan

  • Members
  • Pip
  • 13 posts

Posted 08 May 2007 - 12:15 PM

A reply from the developer:



You need to write a shell command to execute the PHP script that you want. One way to do this is using wget, a command-line HTTP request tool. For instance,

Code:

wget -qO - http://example.com/script.php

will execute script.php, and print the ouput to stdout. If you put this in a cron job, the output will be emailed to you. You can also set up authentication on the script and provide the username and password to wget, which is a good idea to prevent random people from executing that script and advancing the game whenever they want to. Google for the wget documentation for more info.



But its didn't work and the turns space still empty!!

#3 Hayden

    P2L Jedi

  • Members
  • PipPipPip
  • 716 posts
  • Gender:Male
  • Location:Texas

Posted 08 May 2007 - 10:27 PM

you can also try doing...

/usr/bin/php /path/to/file.php

...in the cron job file or if you're using cPanel then it's even easier.




TBH: I wouldn't use cron to update the turns though. It only runs every 30 minutes and there will be people who get caught in the middle and either there turn goes longer than 30 minutes or shorter than 30 minutes. Why not just do a timestamp and they can not take another turn until it's greater than (or equal to) specified time?

Edited by SpatialVisionary, 08 May 2007 - 10:32 PM.


#4 00king00

    Young Padawan

  • Members
  • Pip
  • 13 posts

Posted 09 May 2007 - 10:48 AM

Well thanx mate

But where to write this line

/usr/bin/php /path/to/file.php

In the cron jobs? or in the script file?

and how i can do this timestamp and how i can creat such thing? is it easy or I should be a pro in PHP :-)

Thanx





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users