14

这些技术套件中的哪一个适用于多用户在线游戏项目。项目要求: 1. 能够在任何给定时间处理 2k-5k 用户。2. iphone 和 android 的客户端库(本机,无 javascript)。3. Microsoft Windows 的客户端库(最重要),也适用于 mac os x 和 linux。4. 专门用于模组开发的良好文档 5. 项目不是开源的。因此,只能使用具有合适许可证的库。

我也可以用 erlang 和 java 编程,编程语言不是问题。

我正在研究以下服务器技术,例如 Openfire、Tigase、ejabberd 和 RabbitMQ。一切都对我的项目有好处,但我想更多地了解我需要什么套件,AMQP 或 XMPP。

AMQP 专门为实时在线游戏提供什么。它是比 xmpp 更好的选择吗?

4

4 回答 4

17

Linden Labs (Second Life) 的人对许多你应该阅读的消息系统进行了彻底的比较:

http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes

值得一提的是,我在一个项目中使用 zeromq,这真的很有趣,因为根据用例,您不需要代理节点。

于 2010-08-18T22:55:37.163 回答
7

A key difference between XMPP and AMQP is binary content. AMQP handles binary data just fine, and XMPP seems more designed for XML. Personally for online games I use Google Protocol Buffers for message formatting and parsing, and with their very small binary footprint, I'd be more inclined to use AMQP to deliver those messages.

But do consider what AMQP server you want to use. I've been bitten by using RabbitMQ for my AMQP server in the past. RabbitMQ does not have any flow control facilities, at all. So if your clients are sending messages faster than your server can consume them, buffers on the server can fill up and blow the server up. More recent versions of RabbitMQ implement flow control in an exceedingly coarse way: they halt all consumers in the system until memory clears up.

I've never tried zeromq; perhaps it'd be better for the things I've been using RabbitMQ for...

于 2010-09-06T21:39:34.073 回答
5

5K 用户并没有告诉我太多关于他们的行为,但如果他们都在同一个 10 秒窗口内提交了一个请求,那么假设您每秒查看 500-1000 个请求。

我已经在我相对低功率的笔记本电脑上运行了 Active/MQ,每秒轻松处理 300 个请求,所以我很乐意在这里推荐它。您还可以设置代理集群并实现水平可扩展性。您可以使用 http 协议 (STOMP) 或其本机二进制协议。许多客户端 API 库也适用于 C/C++、Java、JavaScript 等。有一些初始的AMQP 支持

您没有提到任何持久性要求,但我再次认为大多数 RDBMS 就足够了。也就是说,从水平扩展的角度来看,一些面向文档和大表类型的数据库看起来很有趣。

我还发现 Apache Camel 的性能非常好,我强烈推荐它。Camel 用于实现您的逻辑层。

'希望这会有所帮助。

于 2010-09-07T00:09:28.017 回答
1

XMPP 可用于文本游戏。http://gamerunes.com

于 2011-06-10T02:18:50.050 回答