从设备A,我向设备B发送基于回合制的邀请。但设备B虽然收到邀请,却错误地将其识别为实时邀请!显然这是一个问题,我无法继续游戏!
我正在发送设备A的邀请,如下所示:
TurnBasedMatchConfig.Builder matchBuilder = TurnBasedMatchConfig.builder();
int minP = 1;
int maxP = 1;
int bitMask = 0;
int variant = -1;
ArrayList<String> invitees = ....list of players here...
if (minP > 0 && maxP > 0)
{
matchBuilder.setAutoMatchCriteria(RoomConfig.createAutoMatchCriteria(
minP,
maxP,
bitMask));
}
matchBuilder.setVariant(variant);
if (invitees.size() > 0) matchBuilder.addInvitedPlayers(invitees);
Games.TurnBasedMultiplayer.createMatch(_client, matchBuilder.build()).setResultCallback(new InitiateMatchResultClass());
在设备B上,我收到了这样的邀请:https://developers.google.com/android/reference/com/google/android/gms/games/multiplayer/OnInvitationReceivedListener
@Override
public void onInvitationReceived(Invitation invitation)
{
Log.i(ExConsts.TAG, "onInvitationReceived");
if(invitation.getInvitationType() == Invitation.INVITATION_TYPE_REAL_TIME)
{
Log.i(ExConsts.TAG, "INVITATION_TYPE_REAL_TIME");
}
else if(invitation.getInvitationType() == Invitation.INVITATION_TYPE_TURN_BASED)
{
Log.i(ExConsts.TAG, "INVITATION_TYPE_TURN_BASED");
}
}
我可能做错了什么?!