More specifically, how to have a server-side script, once started when some conditions are met, running constantly regardless of whether there is requests?
I am writing a multiplayer online game and wish to have a server that loops through game statistics at a constant rate independent of users' requests. If the execution of the script is triggered by users' request, many problems will occur. For example, if the PHP updating user's position according to the speed is triggered by user's request, then the faster they send the request the faster they will be able to move. And when a user turns off the webpage and stops sending requests, the role he plays in the game will not die because the script that takes care of this user cannot be triggered.
Up to now I have seen solutions such as using Quartz.net, writing a console application and running it as a scheduled task, writing a Windows Service and setting the timer, but which one should I apply?
My question is similar to a question asked before:How to run an independent server-side script on database, but the answer to that question was not clear and does not fit my situation so well.
I guess my question will seem naive to most of the people. Please forgive my ignorance. ^_^
Aucun commentaire:
Enregistrer un commentaire