Question

I'm trying to create a real-time webbrowser game in ASP.Net MVC3, but I'm unsure about what's the best approach to processing 'real-time' events on the server side.

Imagine that the client wants to upgrade a building, upgrading a building takes time. A record gets inserted in the database that holds the end-time and on the client a ajax timer start's running. I was thinking about having a windows service running all the time. Every second the service checks the table and does the real processing when the time passed the end-time. However I could imagine that when you have a huge amount of data to process this can get problematic.

What would be the best way of doing this?

Cheers.

No correct solution

OTHER TIPS

I've seen games like that before. You do not need to count down yourself, you just need to store the datetime for whenever the building will be ready.

When a page is requested you send a timestamp of when the building will be completed, and use javascript to count down. For example, like this.

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