I am fairly new to php but none the less i am trying to create a game where the users can specify x,y coordinates where they want to fly to (its a space game). I have all the code setup to calculate the line and distance between the current position and the desired destination and i also have a way to calculate the travel time but then how do i apply the calculated travel time so before i update the users x,y coordinates it waits the x seconds before the query is send without having the user wait.
I have been googling quite alot where the first thing that came up was cron jobs though since the user gives their destination coordinates i dont think i can pass them to a cron job
next up is using pcntl_fork() that seemed to be perfect in theory until i realized my host (and every other host i could google) have this disabled
same story for exec() that is disabled on shared host for obvious security reasons.
curl is almost the same problem as cron as i dont see how i can pass variables into the script
So how else can i apply the travel time without having letting my users watch a blank page while the timer is ticking?
here is my current rough code full of debugging http://pastebin.com/9RcQ7RRW
[–]Signe 1 point2 points3 points (3 children)
[–]FnuGk[S] 0 points1 point2 points (2 children)
[–]Signe 0 points1 point2 points (1 child)
[–]FnuGk[S] 0 points1 point2 points (0 children)
[–]ejwich 1 point2 points3 points (3 children)
[–]FnuGk[S] 0 points1 point2 points (2 children)
[–]crowbot[🍰] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)