scripting - having a script autorun on a web server -


sorry if question bit ambiguous, i'll explain want do.

i want run game on webserver. turn based game, of people might have come across it. game called mafia: http://mafiascum.net/wiki/index.php?title=newbie_guide.

i know how needs work in terms of mysql database server side scripting language etc etc.

what not sure whats best way script activate when game starts, , able run script every 3 minutes update game status:

once 10 people join game starts

people vote during 3 minute period. (votes stored in database)

after 3 minutes script needs run calculate votes , remove player

then 1 , half minutes later script needs run again.

this cycle of 3 minutes, 1 , half minutes need repeat until condition met, i.e players 2 dead or something.

when players refresh page need updated on games status.

ive read sockets, , wonder if might path take. sockets able send json clients? jquery can update client game results.

ideally the front end done in jquery , backend script processing done php or something.

how open be? in terms of people trying cheat sending attacks such post variables sqli attacks etc etc.

its quite broad question, , sure there more 1 approcah more 1 correct answer, intrested on peoples thoughts on how go developing it.

thanks time :)

i use cron job or similar on backend update status every x seconds have suggested.

to trigger game start, fire off php command set cron job running.

this way timing controlled behind scenes on server, , free update status of game using jquery actual players.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -