I ran into a strange problem. In my multiplayer game user decides how many opponents they want to play with(up to 3), and after they've decided I create an autoMatchCriteria like this-
Bundle am = RoomConfig.createAutoMatchCriteria(opponentCount, opponentCount, 0);
And create a room-
// build the room config:
RoomConfig.Builder roomConfigBuilder = makeBasicRoomConfigBuilder();
roomConfigBuilder.setAutoMatchCriteria(am);
RoomConfig roomConfig = roomConfigBuilder.build();
// create room:
Games.RealTimeMultiplayer.create(((MainActivity) getActivity()).getGoogleApiClient(), roomConfig);
This triggers RoomUpdateListener's onJoinedRoom() or onRoomCreated() accordingly. And while the user waits in a waitingRoom they gets room status updates in RoomStatusUpdateListener's onPeersConnected() when a peer gets connected and after minimum required players are connected the game play can be started.
But when user selects more then one opponents, onPeersConnected() only gets called once if at all and the connected player keeps waiting indefinitely until they leave the room.
I tried it with google's waiting room ui and strange enough it worked with it for every opponent count.
So if anyone can point me to what am I doing wrong, would be a great help. Thank you.