public override void PlayerWantsToQuitMatch(GKPlayer player, GKTurnBasedMatch match) { if (MatchDelegate != null) { MatchDelegate(TurnBasedMatch.FromGKTurnBasedMatch(match), false, true); } }
public override void PlayerReceivedTurnEventForMatch(GKPlayer player, GKTurnBasedMatch match, bool didBecomeActive) { if (CloseAndResetMatchmakerVC != null) { CloseAndResetMatchmakerVC(); } if (MatchDelegate != null) { MatchDelegate(TurnBasedMatch.FromGKTurnBasedMatch(match), didBecomeActive, false); } }
public override void PlayerMatchEnded(GKPlayer player, GKTurnBasedMatch match) { if (CloseAndResetMatchmakerVC != null) { CloseAndResetMatchmakerVC(); } if (MatchDelegate != null) { MatchDelegate(TurnBasedMatch.FromGKTurnBasedMatch(match), false, false); } }
public void GetAllMatches(Action <TurnBasedMatch[]> callback) { Util.NullArgumentTest(callback); GKTurnBasedMatch.LoadMatches( (gkMatches, nsError) => { TurnBasedMatch[] matches = gkMatches != null ? gkMatches.Select(gkm => TurnBasedMatch.FromGKTurnBasedMatch(gkm)).ToArray() : null; callback(matches); }); }
public void Rematch(TurnBasedMatch match, Action <bool, TurnBasedMatch> callback) { Util.NullArgumentTest(match); match.GC_TurnBasedMatch.Rematch((gkMatch, error) => { if (error != null) { Debug.Log("Failed to rematch with error " + error.LocalizedDescription); } if (callback != null) { callback(error == null, TurnBasedMatch.FromGKTurnBasedMatch(gkMatch)); } }); }
public void CreateQuickMatch(MatchRequest request, Action <bool, TurnBasedMatch> callback) { Util.NullArgumentTest(request); Util.NullArgumentTest(callback); using (var gkReq = request.ToGKMatchRequest()) { GKTurnBasedMatch.FindMatchForRequest(gkReq, (gkMatch, nsError) => { TurnBasedMatch match = TurnBasedMatch.FromGKTurnBasedMatch(gkMatch); if (nsError != null) { Debug.Log("Failed to create quick match with error " + nsError.LocalizedDescription); } if (callback != null) { callback(nsError == null, match); } }); } }