Jake_vbulletin3_import12169
New Member
I am currently planning an Achievements system for my project. Achievements will be unlocked when the user actually visits the Achievements page, and any uncompleted ones will have their progress shown.It may take some time to calculate some of the achievements' progress. I came up with this idea, but I have no idea how to go about implementing it, or if it's even possible:
- JavaScript requests achievements data via AJAX
- PHP starts calculating achievement progress
- For each achievement, a line is written to the output stream, of the form \[code\]IDrogress\[/code\]
- JavaScript receives each line and shows the progress for the given achievement
- For each achievement:
- If there are more than N "threads", wait for one to finish
- Fork off a thread to calculate the current achievement and echo the result line