Search code examples
c++iosreal-timegoogle-play-games

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


I'm developing a real-time multiplayer game for Android an iOS with Google Play Game Services. I'm using the C++ API of it, with Cocos2d-x.

The GPG is implemented in the game as Google's documentation tells and this works well on Android. But on iOS, the game crashes after the real-time room has enough players.

Snapshots are not enabled and I'm using Google's UI for real-time room.

Other functionality works well, the tested ones:

  • Invitations from friends

  • Invitating friends

  • Leaderborads

  • Showing Achievements UI

Logs when signing in 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

Logs after CreateRealTimeRoom() is ran:

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

After room has enough players and ShowWaitingRoomUI's callback should be called, but it isn't:

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.

Solution

  • Have you tried this by using real iOs device? This error occurs in iphone simulator for me.