Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Play Game Service, automatching player information not included in result data
    primarykey
    data
    text
    <p>I made a simple example game app using google play game service by following google sample.</p> <p>In the code, I started player selection screen by using <code>GameClient.getSelectPayersIntent()</code> method just like sample.</p> <pre><code> intent = getGamesClient().getSelectPlayersIntent(1, 3); showScreen(Screen.WAITING); startActivityForResult(intent, RC_SELECT_PLAYERS); </code></pre> <p>Player selection activity returned result data, but it does not include <code>GamesClient.EXTRA_PLAYERS</code>, <code>GamesClient.EXTRA_MIN_AUTOMATCH_PLAYERS</code>, <code>GamesClient.EXTRA_MAX_AUTOMATCH_PLAYERS</code> extras even though I chose two auto match players. </p> <p>When I debugged it, it only holds <code>com.google.android.gms.games.MAX_SELECTION</code> , <code>com.google.android.gms.games.MIN_SELECTION</code> extras in its extra map.</p> <p>In the javadoc for <a href="https://developer.android.com/reference/com/google/android/gms/games/GamesClient.html#getSelectPlayersIntent%28int,%20int%29%20javadoc" rel="nofollow">getSelectPlayersIntent</a>, result should include chosen player information.</p> <p>Do I need to do some setup for this feature working?</p> <p>Here is my <code>onActivityResult</code> code. I just copied it from sample.</p> <pre><code>@Override protected void onActivityResult(int requestCode, int responseCode, Intent data) { super.onActivityResult(requestCode, responseCode, data); switch (requestCode) { case RC_SELECT_PLAYERS: // we got the result from the "select players" UI -- ready to create the room handleSelectPlayersResult(responseCode, intent); break; case RC_INVITATION_INBOX: // we got the result from the "select invitation" UI (invitation inbox). We're // ready to accept the selected invitation: handleInvitationInboxResult(responseCode, intent); break; ... other stuffs private void handleSelectPlayersResult(int response, Intent data) { if (response != Activity.RESULT_OK) { Log.w(TAG, "*** select players UI cancelled, " + response); showScreen(Screen.MAIN); return; } Log.d(TAG, "Select players UI succeeded."); // get the invitee list final ArrayList&lt;String&gt; invitees = data.getStringArrayListExtra(GamesClient.EXTRA_PLAYERS); if (invitees != null) { Log.d(TAG, "Invitee count: " + invitees.size()); } // get the automatch criteria Bundle autoMatchCriteria = null; int minAutoMatchPlayers = data.getIntExtra(GamesClient.EXTRA_MIN_AUTOMATCH_PLAYERS, 0); int maxAutoMatchPlayers = data.getIntExtra(GamesClient.EXTRA_MAX_AUTOMATCH_PLAYERS, 0); if (minAutoMatchPlayers &gt; 0 || maxAutoMatchPlayers &gt; 0) { autoMatchCriteria = RoomConfig.createAutoMatchCriteria( minAutoMatchPlayers, maxAutoMatchPlayers, 0); Log.d(TAG, "Automatch criteria: " + autoMatchCriteria); } // create the room Log.d(TAG, "Creating room..."); RoomConfig.Builder rtmConfigBuilder = RoomConfig.builder(this); if (invitees != null) { rtmConfigBuilder.addPlayersToInvite(invitees); } rtmConfigBuilder.setMessageReceivedListener(this); rtmConfigBuilder.setRoomStatusUpdateListener(this); if (autoMatchCriteria != null) { rtmConfigBuilder.setAutoMatchCriteria(autoMatchCriteria); } showScreen(Screen.WAITING); keepScreenOn(); getGamesClient().createRoom(rtmConfigBuilder.build()); Log.d(TAG, "Room created, waiting for it to be ready..."); } </code></pre> <h1>Update</h1> <p>Oops, it was my fault. I used sent intent, not received data Intent.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload