在iOS上创建实时聊天室后,Google Play游戏服务崩溃

Google Play Game Services crashing after creating real-time room on iOS

本文关键字:Play Google 游戏 服务 崩溃 iOS 创建 实时 聊天室      更新时间:2023-10-16

我正在使用Google Play游戏服务为Android和iOS开发一款实时多人游戏。我正在使用它的C++API和Cocos2d-x。

谷歌的文档告诉,GPG是在游戏中实现的,这在Android上运行良好。但在iOS上,当实时房间有足够的玩家后,游戏就会崩溃。

快照没有启用,我正在使用谷歌的UI进行实时聊天。

其他功能运行良好,经过测试的功能:

  • 朋友的邀请

  • 邀请朋友

  • Leaderborads

  • 显示成就UI

登录G+时的日志:

cocos2d: [LUA-print] Loading game
Signing in to GPG
cocos2d: [LUA-print] Entered background
2014-10-14 15:32:34.539 MYAPP iOS[10716:1633086] VERBOSE: Cancelling event timer
cocos2d: [LUA-print] Entered foreground
Signed in to GPG
MYAPP iOS[10716:1633086] ERROR: Attempting to get name of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get avatar URL of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get id of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get title of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get current xp of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get last level up timestamp of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get current level of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get level number of an invalid PlayerLevel
MYAPP iOS[10716:1633086] ERROR: Attempting to get minimum xp of an invalid PlayerLevel
MYAPP iOS[10716:1633086] ERROR: Attempting to get maximum xp of an invalid PlayerLevel
MYAPP iOS[10716:1633086] ERROR: Attempting to get next level of an invalid Player
MYAPP iOS[10716:1633086] ERROR: Attempting to get level number of an invalid PlayerLevel
MYAPP iOS[10716:1633086] ERROR: Attempting to get minimum xp of an invalid PlayerLevel
MYAPP iOS[10716:1633086] ERROR: Attempting to get maximum xp of an invalid PlayerLevel

运行CreateRealTimeRoom()后的日志:

MYAPP iOS[10716:1633236] VERBOSE: ProcessedInState is not implemented.
MYAPP iOS[10716:1633236] VERBOSE: OnConnectNetworkStart is not implemented.
MYAPP iOS[10716:1633236] INFO: Connect with retry.getRetryAuthToken(): 1
MYAPP iOS[10716:1633236] INFO: Token expired.  Refreshing.
MYAPP iOS[10716:1633236] Trying to refresh token; old token is: XXX
MYAPP iOS[10716:1633086] Auth updated!  ... maybe.  New token is: XXX
MYAPP iOS[10716:1633236] Token refresh success!
MYAPP iOS[10716:1633236] INFO: Trying to connect with returned auth token.
MYAPP iOS[10716:1633236] VERBOSE: ProcessedInState is not implemented.
MYAPP iOS[10716:1633236] VERBOSE: OnConnectNetworkDone is not implemented.
MYAPP iOS[10716:1633236] VERBOSE: ProcessedInState is not implemented.
MYAPP iOS[10716:1633236] VERBOSE: OnEnterRoomStart is not implemented.
MYAPP iOS[10716:1633236] VERBOSE: OnEnterRoomEnd is not implemented.
MYAPP iOS[10716:1633393] INFO: mPlayerId: 112816036638541164521 Enter room: ChoKCQilzeL2rgQQAhABGAAg____________ARCA1Jb6uNOCgrsB
MYAPP iOS[10716:1633393] VERBOSE: RtmpDcmLog is not implemented.
created a room 1
[RTMP] (Error) +[GPGRealTimeRoomMaker performPreCheck:checkDelegate:]:[main] Sign in to the Google Play Games Service before using the multiplayer functions

房间有足够的玩家后,应该调用ShowWaitingRoomUI的回调,但不是:

MYAPP iOS[10716:1633236] ERROR:  - unhandledMessage: message.type=48
MYAPP iOS[10716:1633393] ERROR: Attempting to get participant for invalid participant id.
MYAPP iOS[10716:1633393] INFO: Waiting for connection from p_CJXeyNKXhKOL3QEQAQ
OnParticipantStatusChanged participant:p_CJXeyNKXhKOL3QEQAQ   status: 2
JOINED OnParticipantStatusChanged participant :p_CJXeyNKXhKOL3QEQAQ
JOINED OnParticipantStatusChanged room :ChoKCQilzeL2rgQQAhABGAAg____________ARCA1Jb6uNOCgrsB
OnParticipantStatusChanged participant participantsInRace_.size: 1
MYAPP iOS[10716:1633394] VERBOSE: RtmpPeerLog is not implemented.
MYAPP iOS[10716:1633394] ERROR: peer_capabilities must not be null in PeerStateMachine::WaitingForOutgoingRemoteConnectionNoSessionId
MYAPP iOS[10716:1633394] VERBOSE: EnteredState is not implemented.    MYAPP iOS[10716:1633394] INFO: OP: 1
MYAPP iOS[10716:1633394] INFO: CALL_STATE_CHANGED_OP: New state: 1
MYAPP iOS[10716:1633394] ERROR: peer_capabilities must not be null in PeerStateMachine::WaitingForConnectionData
MYAPP iOS[10716:1633394] VERBOSE: EnteredState is not implemented.

你用真正的iOs设备尝试过吗?这个错误发生在我的iphone模拟器中。