对于多人回合制游戏的Silverlight服务器端 [英] Server side for a multiplayer turn based silverlight game

查看:184
本文介绍了对于多人回合制游戏的Silverlight服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在设计使用Silverlight基于浏览器的游戏的早期阶段。本场比赛将有2-4个球员很多比赛(甚至高达8),将根据转向。

I am currently in the early stages of designing a browser based game using silverlight. The game is going to have many matches of 2-4 players (perhaps even up to 8) and will be turn based.

前端的Silverlight 3.0,因为我有一些经验在那里。我试图找出后端应该的。由于游戏是基于将其将不再需要经常轮询服务器作为一个实时游戏。服务器端将包括某种中间层的,客户端和后端之间连通。后端将是一个C#的Windows服务,根据用户的行为(攻击,防御,移动,技能,练级等等等等)进行验证和计算。

The Front end is Silverlight 3.0 since I have some experience there. I am trying to figure out what the back end should be. Since the game is turn based it will not need to poll the server as often as a real time game. The server end will include some sort of intermediary layer which communicates between the client and the back end. The back end is going to be a c# based Windows service which performs validation and calculations based on user actions (attack, defend, move, skills, leveling etc etc).

什么是亲的和下面的Silverlight的3.0客户端和服务器上的C#Windows服务之间的中间通信层的利弊。

What are the pro's and cons of the following for middle communication layer between the Silverlight 3.0 Client and the c# windows service on the server.

  1. 插座
  2. 在WCF / WCF双工服务
  3. 的.Net RIA服务

目前我不知道这三个选项高于一切,但是我在过去创建的ASP.Net Web服务和在大学,我这样做,我已经几乎被遗忘的一些插座编程。

Currently I don't know anything about the three options above, however I have in the past created ASP.Net Web services and in university I did some socket programing that I have mostly forgotten.

推荐答案

下面是我对事物的看法:

Here is my view of things:

套接字: 好处是,这样可以进行真正的好。缺点是,它是有些脆弱,并在客户端和服务器上实现两个复杂。我想避免这种情况,除非有没有其他的方法(例如,你需要非常高的性能)。

Sockets: Upside is that this can perform really good. Downside is that it is somewhat fragile and complicated to implement both on the client and on the server. I would avoid this unless there is no other way (e.g. you need very high performance).

WCF / WCF双工: WCF是非常容易实现的,如果你只需要十分钟,想想你要来回发送的内容。性能好,易于部署。这将是我的一个在线游戏的第一选择。

WCF / WCF Duplex: WCF is very easy to implement if you just take ten minutes to think about what you want to send back and forth. Performance is good and deployment is easy. This would be my first choice for an online game.

的WCF双工稍微复杂一些。有一些很好的教程就如何得到这个工作,但是我发现有一些缺陷,可能无法使这值得努力。如果您并不需要太高的轮询间隔我会坚持正常WCF。据我所知,WCF双工不投票,以及因此它不是一个真正双面打印。

WCF Duplex is somewhat more complex. There are some good tutorials as to how to get this to work, but I find there are some pitfalls that may not make this worth the effort. If you don't need high polling intervals I would stick with normal WCF. As far as I know WCF Duplex does polling as well so it's not really duplex.

.NET RIA服务: 我不知道这一个,但我想的开销没有大量的流量,当你需要什么。同样来自论坛的问题我知道这个人是不是那么容易定制,而WCF是更灵活。

.NET RIA Service: I'm not sure about this one, but I figure the overhead is not what you need when having large volumes of traffic. Also from forum questions I learn that this one is not so easy to customize, whereas WCF is more flexible.

结论: 除非有一些令人信服的理由不来,我会坚持到WCF。

Conclusion: Unless there is some compelling reason not to, I would stick to WCF.

这篇关于对于多人回合制游戏的Silverlight服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆