public void CreateWithMatchmakerUI(MatchRequest request, IRealTimeMultiplayerListener listener) { PlayGamesPlatform.Instance.RealTime.CreateWithInvitationScreen( request.MinPlayers - 1, request.MaxPlayers - 1, (uint)GPGTypeConverter.ToGPGSVariant(request.Variant, MatchType.RealTime), new GPGRealTimeMultiplayerListener(listener, false)); }
public void CreateQuickMatch(MatchRequest request, IRealTimeMultiplayerListener listener) { PlayGamesPlatform.Instance.RealTime.CreateQuickGame( request.MinPlayers - 1, request.MaxPlayers - 1, (uint)GPGTypeConverter.ToGPGSVariant(request.Variant, MatchType.RealTime), new GPGRealTimeMultiplayerListener(listener, true)); }
/// <summary> /// Constructs a new instance /// from the <see cref="GooglePlayGames.BasicApi.Multiplayer.Invitation"/> object. /// </summary> internal static Invitation FromGPGSInvitation(GPGSInvitation inv) { if (inv == null) { return(null); } return(new Invitation(inv.ToEMMatchType(), Participant.FromGPGSParticipant(inv.Inviter), GPGTypeConverter.ToEMVariant(inv.Variant)) { GPGS_Invitation = inv }); }
public void CreateWithMatchmakerUI(MatchRequest request, Action cancelCallback, Action <string> errorCallback) { if (request == null) { throw new ArgumentNullException("Request can't be null."); } PlayGamesPlatform.Instance.TurnBased.CreateWithInvitationScreen( request.MinPlayers - 1, request.MaxPlayers - 1, (uint)GPGTypeConverter.ToGPGSVariant(request.Variant, MatchType.TurnBased), delegate(UIStatus uiBased, GPGS_TurnBasedMatch match) { if (uiBased == UIStatus.Valid) { if (mRegisteredMatchDelegate == null) { Debug.LogWarning("The MatchDelegate has not been registered."); return; } mRegisteredMatchDelegate(TurnBasedMatch.FromGPGSTurnBasedMatch(match), true, false); // playerWantsToQuit doesn't occur on GPG. return; } if (uiBased == UIStatus.UserClosedUI) { if (cancelCallback != null) { cancelCallback(); } return; } if (errorCallback != null) { errorCallback(GetMessageFromUIStatus(uiBased)); } } ); }
public void CreateQuickMatch(MatchRequest request, Action <bool, TurnBasedMatch> callback) { if (request == null) { throw new ArgumentNullException("Request can't be null."); } PlayGamesPlatform.Instance.TurnBased.CreateQuickMatch( request.MinPlayers - 1, request.MaxPlayers - 1, (uint)GPGTypeConverter.ToGPGSVariant(request.Variant, MatchType.TurnBased), (flag, match) => { if (callback == null) { return; } callback(flag, TurnBasedMatch.FromGPGSTurnBasedMatch(match)); } ); }