Android的两个玩家的游戏在互联网上播放互联、两个、玩家、网上

2023-09-04 23:35:14 作者:给朕换尿片

我在机器人开发出一种简单的两个玩家的棋局通过蓝牙播放。欲通过它使得有可能通过因特网被播放延伸。每当玩家做出的举动,此举应通过互联网传送到其他的球员。

I have developed a simple two player chess game in android to be played using Bluetooth. I want to extend it by making it possible to be played through internet. whenever a player makes a move, the move should be transferred to the other player via internet.

如何实现这一目标?

我听说C2DM mechanism.Does那套件我所描述的场景,是不是可靠?

I have heard of C2DM mechanism.Does that suites the scenario i described and is it reliable?

感谢:)

推荐答案

另一种方法是使用某种即时通讯为应用程序通信介质。对于如。使用 Asmack 连接到XMPP即时消息像GTalk的。提示用户创建一个帐户,在那里,为你的游戏。 并用它来通过IM发送和接收命令。这样你就不会需要设置你的中介服务器。

Another option is to use some sort of IM as a communication medium for app. For eg. Use Asmack to connect to XMPP Im like GTalk. Prompt user to create an account there, for your game. And use it to send and receive commands via IM. This way you won't need to setup your mediating server.

这工作,如果用户知道他是谁玩。为了收集用户数据,并让他们搜索可用的球员,你还需要安装一个服务器。 IRC聊天室可能是一种选择,以避免此也。

This works if user knows who he is playing with. To collect the user data and let them search for available players, you still need to setup a server. IRC chat room may be an option to avoid this also.

在GTalk的只是一个例子。您可以使用任何即时通讯或IRC也。