XMPP 多个 MUC Web 应用程序操作指南
我正在设计一款网络游戏,需要支持数千(甚至数万)最终用户。
* 客户端是基于浏览器的。
* 服务器端“引擎”将基于具有 MUC 功能的 XMPP。
* 游戏由许多场景(数十到数百个)组成,最终用户(玩家)加入以参与该场景。
* 每个场景都必须有一个独特的“机器人”来控制流程。例如:玩家 X 对玩家 Y 施放咒语:机器人在房间其他人之前收到“施放咒语请求”,计算结果并“通知”场景的其余参与者已完成的操作(玩家 X 被解雇,玩家Y 击中...)。
我的问题是:
1. 哪种 XMPP 服务器最适合这项工作?
2. 什么服务器端语言可以支持为预期数量的玩家提供近乎实时的“消息传递”? (24/7、多个“房间”[场景]、数以万计的最终用户)。
3. 如果我们假设每个场景应该能够容纳最多 100 个用户,并且我们需要一个机器人出现在每个场景中来响应玩家的操作并将其“传递”给该场景中的其他参与者场景,最好的方法是什么:
A. 将 MUC 与为每个房间创建的机器人结合使用,以用户身份加入,或者:
B. 使用 PubSub 或其他方法。
I'm designing a net-game that needs to support thousands (even tens of thousands) of end users.
* The client side is browser-based.
* The server side "engine" will be based on XMPP with MUC functionalities.
* The game is made of many scenarios (dozens to hundreds), where the end-users (the players) join in order to take part in that scenario.
* Every scenario must have a unique "bot" that controls the flow. For example: player X casts a spell at player Y: the bot receives the "cast spell request" BEFORE the rest of the room, calculates the result and "notifies" the rest of the scenario participants regarding what's done (player X fired, player Y hit...).
My questions are:
1. What XMPP server would fit best for the job?
2. What server-side language can support a near real-time "messaging" for the expected amount of players? (24/7, multiple "rooms" [scenarios], tens of thousands of end users).
3. If we assume that each scenario should be able to host up to 100 users, and that we need a bot to be present in each scenario to respond to the players' actions and "deliver" them to the rest of the participants in that scenario, what would be the best approach:
A. Use MUCs with a bot created for each room, joining as a user, or:
B. Use PubSub or other methods.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的项目也有类似的场景。我使用 ejabberd 作为服务器,使用 stropejs 作为客户端。在服务器端我使用了java,因为它对我来说很熟悉。我使用了 whack 库。
这是我所做的事情。
收到消息后,外部组件创建一个新房间,并作为机器人加入游戏。
此组件实现将提供消息、状态通知等的侦听器。因此组件或机器人可以对每条消息或状态执行操作。
当rom中没有剩余用户时,房间将被关闭。
到目前为止,我成功完成了一个工作演示,该产品尚未完整。我也发现了一些困难..:-)
I had a similiar scenario for my project. i used ejabberd as server, and strophejs for client side. On the server side I used java since it was familiar for me. I used whack library.
Here are the thing i did.
upon recieving message, the external component creates a new room, and joins in the game as bot.
This component implementation will give listeners for messages, presence notification, etc.So component or bot can act upon each message or presence.
When there are no users left in the rom , room will be shutdown.
So far I managed complete a working demo, the product is not full yet.me too finding some difficulties..:-)