php - execute a function just once for all users -


i'm building on-line multi-player board game , have function creates new board. need after every round, can't seem able make execute once users. call function when timer reaches 0, on page game situated, executes every user on page.

thus, function generates new board many times there users playing game @ moment, want generate 1 board.

so, question how can make php function execute once , not many times there pages open?

edit on system: users play 90 seconds wait 15 second while see round results , whole thing repeats again , again. , if enter page in middle of round have option wait until new round begins or enter round right then. have no idea call function. tried calling when pause menu begins results displayed, executes function users.it still works cause still 1 board @ end of executions, it's not right, if there more hundreds of people playing, board generated hundreds of time. , also, generates board c++ .exe creates xml on server.i execute exe php , additional things also.

i have no idea call function. how prerender board said? function still has on page user has access execute. it's mind boggling.

and tried adding info in database see if function has been called before, still happens users @ same time.

i think need drastically more information system you're using give actual answer, general procedure might generate board first time client in particular game reports reaching end of particular round. save information board, plus game id , round number in database table. then, whenever client in same game reports finishing same round, send them saved board rather generating new 1 again.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -