使用“Google Play 游戏服务”玩游戏时突然断开连接

Posted

技术标签:

【中文标题】使用“Google Play 游戏服务”玩游戏时突然断开连接【英文标题】:Suddenly disconnects while playing using "Google Play Game Services" 【发布时间】:2013-09-24 16:22:25 【问题描述】:

我按照 Google 指南 (https://developers.google.com/games/services/android/multiplayer) 并在我的游戏中实现了多人游戏。一切似乎都正常,但是“有时”连接突然丢失,并且在它发生后没有执行任何事件(onLeftRoom 或 onDisconnectedFromRoom)......

如果我看到logcat,我可以看到一些相关信息:

09-19 15:50:08.623: I/libjingle(10434): void buzz::PresencePushTask::HandlePresence(const buzz::Jid&, const buzz::XmlElement*): Received directed presence :0x4dxicadq3fv30u0iy8gcj9yz@public.talk.google.com/games_andr34DE8388
09-19 15:50:08.623: E/DataConnectionManager(10434): Received directed presence of type 'unavailable' from peer.
09-19 15:50:08.623: I/libjingle(10434): Removing from roster: 0x4dxicadq3fv30u0iy8gcj9yz@public.talk.google.com/games_andr34DE8388
09-19 15:50:08.683: W/libjingle(10434): Warning(libjingleclient.cpp:1183): void gtalk::LibjingleClient::TerminateAllCalls_w(): Terminating call for session:1464668934
09-19 15:50:08.693: I/DataConnectionManager(10434): onConnectionResult called for sessionId: 1464668934 result: false
09-19 15:50:08.693: D/rtmp:LibjingleEventHandler(10434): [libjingleHandler] handleMessage(CALL_STATE_CHANGED): for sessionId: 1464668934 new state=12
09-19 15:50:08.693: W/libjingle(10434): Warning(callregistry.cpp:27): void games_rtmp::CallRegistry::UnregisterCall(const string&, const string&): Attempting to erase non-existent session:1464668934
09-19 15:50:08.693: E/DataConnectionManager(10434): tearDown() called when network is NOT ready for match !
09-19 15:50:08.693: I/libjingle(10434): worker_thread:0x62acd7d8 initialized=1
09-19 15:50:08.693: I/libjingle(10434): Waiting for a reply.
09-19 15:50:08.693: I/libjingle(10434): Channel disabled
09-19 15:50:08.693: I/libjingle(10434): Changing data state, recv=0 send=0
09-19 15:50:08.693: I/libjingle(10434): Destroyed channel
09-19 15:50:08.693: I/libjingle(10434): Waiting for a reply.
09-19 15:50:08.703: I/DataConnectionManager(10434): onConnectionResult called for sessionId: 1464668934 result: false
09-19 15:50:08.703: E/DataConnectionManager(10434): Could not find JID for session ID 1464668934
09-19 15:50:08.703: D/rtmp:LibjingleEventHandler(10434): [libjingleHandler] handleMessage(CALL_STATE_CHANGED): for sessionId: 1464668934 new state=15
09-19 15:50:08.703: I/libjingle(10434): Waiting for a reply.
09-19 15:50:08.703: I/libjingle(10434): Waiting for a reply.
09-19 15:50:08.703: I/libjingle(10434): worker_thread:0x62acd7d8 initialized=1
09-19 15:50:08.703: I/libjingle(10434): Waiting for a reply.
09-19 15:50:08.703: I/libjingle(10434): SSL Cleanup

我快疯了……有人可以帮帮我吗?

【问题讨论】:

我在我的游戏中看到了类似的消息。我用最新的。 gpg v 1.4.1 并得到这个:github.com/playgameservices/android-basic-samples/issues/155 【参考方案1】:

我已经更新了 googleplayservice-lib,它现在可以工作了。

【讨论】:

【参考方案2】:

我也有同样的问题。我正在测试两天前有效的代码,所以我认为它是由谷歌引起的。稍后再试。

【讨论】:

它仍然出现的错误,我已经尝试了一切。我刚刚向 Google 支持团队发送了一条消息... 有什么消息吗?您知道在哪里可以了解更多信息吗?【参考方案3】:

这几天甚至在 wifi 上也更频繁地发生。我猜你的代码很好,Google 相关的问题会自行解决。

【讨论】:

以上是关于使用“Google Play 游戏服务”玩游戏时突然断开连接的主要内容,如果未能解决你的问题,请参考以下文章

我可以为非游戏使用 Google play 游戏服务吗

使用Google Play游戏服务android成功创建房间后强制启动游戏

Android Google Play 游戏服务回合制多人游戏不自动匹配

无法使用 Google Play 游戏服务创建房间

使用 Google Play 游戏服务联系用户

如何静默下载 Google Play 游戏服务保存的游戏快照数据?