开发者

Silverlight(card game) and WCF communication (with IIS)

开发者 https://www.devze.com 2023-01-20 23:41 出处:网络
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.

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 conn开发者_开发技巧ect 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...


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: Link

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).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消