GAE 可以充当 XMPP 服务器吗?
我正在考虑使用 GAE 构建一款多人游戏。当玩家 A 采取行动时,我想记录详细信息,然后让玩家 B 知道该行动。
我想我可能会在我的客户端中获得一些开源 XMPP 库,并在可能的情况下通知我的应用程序的存在?我不想强迫玩家注册像 google talk 这样的服务,所以我将根据会话 id 动态生成 jid。
希望收到您的来信!
谢谢
I'm thinking of building a multi-player game using GAE. When player A makes a move, I'd like to record the details and then let player B know about the move.
I thought that I might get some open-source XMPP library in my client and notify presence to my app if that is possible? I wouldn't want to force the player to sign-up to a service like google talk, so I'll generate jid's on the fly based on session id.
Would like to hear from you!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您将无法将您的 gae 应用程序设置为 xmpp 服务器,因为您无法打开套接字 - 这样做受到 api 的限制。
但是,您不需要运行 xmpp 服务器来实现您想要做的事情。您可以使用 appengine api 中提供的 XMPP 库使您的应用程序成为客户端,您的游戏“客户端”可以与该客户端对话以在此处查看 python api:http://code.google.com/appengine/docs/python/xmpp/。并非所有游戏客户端都需要是 gtalk 客户端,但它们需要能够桥接到 gtalk,我相信大多数都能够做到。
这里有一个简短的示例:http://code.google.com/appengine/articles /using_xmpp.html
You are not going to be able to make your gae app an xmpp server because you cannot open sockets - doing so is restricted by the api.
However, you don't need to run an xmpp server to achieve what you want to do. You can use the XMPP libraries available in the appengine api to make your app a client that your game 'clients' talk to see the python api here: http://code.google.com/appengine/docs/python/xmpp/. Not all your game clients need to be gtalk clients, but they will need to be able to bridge into gtalk, which I believe most will be able to.
There is a short example here: http://code.google.com/appengine/articles/using_xmpp.html
花 15 分钟看看 Amazon 的弹性计算云 (EC2) 可能值得
每小时2美分左右就可以部署一个云服务器。
这是一个很好的概述
http://www.youtube.com/watch?v=ZAB8wCg9MyE&feature=player_embedded
Might be worthwhile spending 15 mins to look at Amazon's Elastic Compute Cloud (EC2)
You can deploy a cloud server for about 2 cents an hour.
Here's a good overview
http://www.youtube.com/watch?v=ZAB8wCg9MyE&feature=player_embedded