谷歌应用引擎
我想知道像packman这样的游戏的网络服务器游戏是否可以轻松地在google应用引擎上举行?在响应速度方面。 我想设置一个服务器来管理将举行比赛的游戏桌。 每桌只能有两个玩家。
我不明白我是否可以将 java applet 上传到 GAE 以及我是如何这样做的。
关于其他适合实时动作游戏的免费服务器还有什么建议吗?
谢谢
I would like to know whether a net server game for a game like packman can be held on google application engine easily? In terms of response speed.
I want to set a server which can manage the game tables in which the games will be held.
Each table will have two players only.I don't understand if I can upload a java applet to GAE and how I'm doing so.
Any other suggestions about other free servers which can be suitable for a real time action games?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
GAE 仅支持短期连接(最长约 30 秒)。这意味着您无法在客户端和 GAE 服务器之间打开永久连接。这有效地防止了从服务器到客户端的推送通知,而这在大多数游戏设置中都是必需的。
为了缓解这一限制,Google 引入了Channel API,使您能够将消息从服务器推送到客户端。不过,您需要在客户端上使用他们的 JavaScript 库边。您可以编写一个小程序来调用 javascript 来访问此库,但这可能有点混乱。
总而言之,由于这些限制,GAE 可能无法满足您的需求。
更新:
GAE 不适合用户之间实时通信的另一个原因是:Google 选择的任何服务器都可以处理对 GAE 应用的客户端请求。两个进行通信的用户可以连接到两个不同的服务器,甚至可以连接到不同的数据中心(甚至可能位于不同的大陆)。要在它们之间传递数据,您需要将所有消息存储到数据存储(速度较慢)或内存缓存(不可靠且可能较慢,因为它需要在服务器/数据中心之间传播)。
GAE supports only short-lived connections (about 30sec max). Which means you can not have a permanent connection open between your client and GAE server. This effectively prevents push notifications from server to client, which are needed in most gaming setups.
To alleviate this limitation, Google introduced Channel API which enables you to push messages from server to client. However you need to use their javascript library on the client side. You could write an applet which calls javascript to access this library but this could be a bit of a kludge.
All-in-all, due to this limitations, GAE could prove not to be the right fit for your needs.
Update:
There is another reason why GAE is not fit for real-time communication between users: a client request to GAE app can be served by any server that Google chooses. Two users communicating could be connected to two different servers, even in different data centers (maybe even on different continents). To pass data between them you'd need to store all messages to datastore (slow) or to memcache (unreliable and possibly slow because it would need to propagate between servers/datacenters).
如果数据存储正常并且您没有可能需要超过 30 秒的请求 - 使用具有高性能设置的前端。
If DataStore ok and you don't have requests that can take more than 30 seconds - use fronend with high performance settings.