views:

46

answers:

2

Hy people!

I have an IIS server on my computer, and there is a silverlight card game what I develop actually, and i want it as a mulitplayer game tu run on my server. I search a lot of about it,but i can't decide which technology or what i should to use. Which technology allow me to communicate my server with the users who connect to it? I think a simple communication is enough for me, that just for example i connect to it, and the server answer for me(after authentication).--> i found the WCF for example For example if i connect to it, i see the people who actually connected, and after start the game with a user, and i make a card event etc... the partner can see what i did,and e can see the change and answer to that with another card event...

Please help...

A: 

WCF is a great way to let Silverlight communicate with your server. It has a lot of options available for connecting, throttling, setting timeouts, etc.

The problem you have isn't so much how to communicate but how you will coordinate. With all your clients calling to the server directly the server becomes responsible for tracking the state of every game. You will need to develop a state management system. For instance, you might store the result of actions in a database and the next time a client pings the server the client is given the updated information and the UI changes for the user.

Once you figure out this layer it will be pretty easy to write your WCF service methods and expose an endpoint that you can consume in your Silverlight client.

Erik Noren
thanks for your help :)
AndyD
you know, i just have a simple silverlight application on my IIS server yet. So a have to write the server code(wcf) which can serve the connecting client...and after that the client coded is neccessary ...and i have no idea how to start to write it ... :S
AndyD
for example that what should i search, what kind of part of WCF need for me..Can you help me in this?
AndyD
+1  A: 

Take a look at the help topics under here: http://msdn.microsoft.com/en-us/library/cc296254(VS.95).aspx

Also, a shameless plug for my own video on the subject: http://videos.visitmix.com/MIX09/T42F

And there's a lot of useful information on this and the occasional code sample on this blog: http://blogs.msdn.com/b/silverlightws/

WCF is indeed a great option for your scenario. It even allows for duplex/"push" scenarios (e.g. player A makes a move and sends a message to server, server automatically pushes notifications to players B, C and D).

Eugene Osovetsky
oohhh man,thanks a lot...it is really helpful i think...thanks a lot
AndyD