Is there a way to convey information when inviting me to a Turn-based match in Google Play multiplayer?

It looks like this is going to be a very common scenario, so I am somewhat puzzled that I cannot find support for this in Google Play Services.

Basically, I have a turn based multiplayer game. It has several scenarios that the player can choose to play - either single player or multiplayer. Of course, the inviting player chooses which game he wants to play.

However, there seems to be no way to contact the invited player, which he is being asked to play for. Where there are multiple scenarios, the invited player may not be equally prepared to play all the scenarios, but currently the invitee is forced to accept the invitation before he can see that they just said yes.

Or am I missing something? Alternatively, is there any way to handle this in a sane way?

+3


source to share


1 answer


Prompts provide the ability to specify an option that can advertise a discrete set of values, see Invitation Java doc.

I have an example in one of my apps where I create a pivot based game and set a variation, for example:

TurnBasedMatchConfig tbmc = TurnBasedMatchConfig.builder()
        .addInvitedPlayers(invitees)
        .setAutoMatchCriteria(autoMatchCriteria)
        .setVariant(variant)
        .build();

      



This should propagate the variation to the invitation that the invited player (s) sees. I don't think the default Google Play Services handler shows an option, but if you have an in-game invite handler, you can check which option and how to display it.

I know this option works for me for "automatch" in both real time and turn-based games, although I also seem to remember that in some cases I didn't get the correct value for the option - I think a likely error in Game Play services. I tried to find what I think was a stackoverflow question, I would support and answer, but I only found the previous answer on a similar question.

+2


source







All Articles