Question

Here's the scenario:

I have a SmartFox server running on Amazon EC2 and using MySQL for the database. I'm using AS3 as the programming language.

I have a virtual world in which the user can click on some icon (like home design), and it shows the animation as the house is getting built. It takes eight hours to build it and it will show the percentage with a progress bar as it's getting build.

I could have used AS3 timers, but the problem is that the user might log out from the virtual world (or close the browser) and come back at a later (after maybe two to eight hours, for instance).

I haven't done anything like this before, so can anyone help me with the details, such as what general strategy needs to be used and how to implement, etc.

Please help.

Was it helpful?

Solution

You could do it like this - right after user clicks and starts the process notify the server about that and make server side script get current time and save it to the DB. If the user logs out right after that, just retrieve that saved timestamp each time your client app starts again and calculate how much time passed since the timestamp was taken (at server side), then pass calculated value to the client. This way you will always have the right time displayed and calculations will be client internal clock independent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top