views:

248

answers:

3

My goal for now is to have a user search for other users who want to go head to head to see whom can complete a puzzle the fastest. I have an idea of this to flag user's who are currently online using the membership provider.

I would like the server to be able to send the same puzzle to two different user sessions at once and listen for who completes the puzzle first, how feasible would this be with ASP.NET? Or should I be looking at other technologies?

Thanks!

A: 

A Smart client will be the easiest way to accomplish it, but it will force you to download the "game" to the clients. ASP.NET will give you a web based experience, but it will be harder to send the puzzles to the clients at the same time (forcing the local browser to wait for this event...) - the rest is easy on ASP.NET.

Dani
+1  A: 

I think as much as you described can be done in ASP.NET.

To track users who are online, unless your site is very big, you can probably just track it in memory. This would be wiped if your site refreshed, and wouldn't work if you need to scale to multiple servers, but it doesn't sound like thats a concern yet. Just keep a Dictionary that maps user names to user state.

This is a pretty minimalistic approach, but whatever.

One way to update the state to detect whose online is to build an HttpModule that checks if the caller is online and updates the state if so. The HttpModule would have an event that runs post authentication to update the users state. Also track when they were last active.

As far as 'sending a puzzle' goes, thats another thing. If its sufficient that the user goes to a page to look for the puzzle, then just add a page that loads their current puzzle. If the persons puzzle needs to appear without user action, you could have a page they visit that uses AJAX to check if there is a new puzzle every few seconds.

Frank Schwieterman
Ideally, I would wait for user confirmation that both players are ready, then have the server redirect them to the same puzzle. Or something similar.
Jreeter
A: 

hi actually i am also developing similar game could you please provide some help on script, what i am trying to do is to get 2 player game where one player will roll dice and another player is accepting the dice value and providing input over it.

please suggest how to achive this in asp.net

solutionsdxb