public void CreateQuickMatch(uint minOpponents, uint maxOpponents, uint variant, ulong exclusiveBitmask, Action <bool, GooglePlayGames.BasicApi.Multiplayer.TurnBasedMatch> callback) { callback = Callbacks.AsOnGameThreadCallback <bool, GooglePlayGames.BasicApi.Multiplayer.TurnBasedMatch>(callback); using (GooglePlayGames.Native.PInvoke.TurnBasedMatchConfigBuilder matchConfigBuilder = GooglePlayGames.Native.PInvoke.TurnBasedMatchConfigBuilder.Create()) { matchConfigBuilder.SetVariant(variant).SetMinimumAutomatchingPlayers(minOpponents).SetMaximumAutomatchingPlayers(maxOpponents).SetExclusiveBitMask(exclusiveBitmask); using (GooglePlayGames.Native.PInvoke.TurnBasedMatchConfig config = matchConfigBuilder.Build()) this.mTurnBasedManager.CreateMatch(config, this.BridgeMatchToUserCallback((Action <GooglePlayGames.BasicApi.UIStatus, GooglePlayGames.BasicApi.Multiplayer.TurnBasedMatch>)((status, match) => callback(status == GooglePlayGames.BasicApi.UIStatus.Valid, match)))); } }
public void CreateWithInvitationScreen(uint minOpponents, uint maxOpponents, uint variant, Action <UIStatus, GooglePlayGames.BasicApi.Multiplayer.TurnBasedMatch> callback) { callback = Callbacks.AsOnGameThreadCallback(callback); mTurnBasedManager.ShowPlayerSelectUI(minOpponents, maxOpponents, true, delegate(PlayerSelectUIResponse result) { if (result.Status() != CommonErrorStatus.UIStatus.VALID) { callback((UIStatus)result.Status(), null); } else { using (GooglePlayGames.Native.PInvoke.TurnBasedMatchConfigBuilder turnBasedMatchConfigBuilder = GooglePlayGames.Native.PInvoke.TurnBasedMatchConfigBuilder.Create()) { turnBasedMatchConfigBuilder.PopulateFromUIResponse(result).SetVariant(variant); using (GooglePlayGames.Native.PInvoke.TurnBasedMatchConfig config = turnBasedMatchConfigBuilder.Build()) { mTurnBasedManager.CreateMatch(config, BridgeMatchToUserCallback(callback)); } } } }); }