private void CheckDataCounter() { DataEventCount--; if (DataEventCount == 0) { UM_TBM_MatchesLoadResult result = new UM_TBM_MatchesLoadResult(new GooglePlayResult(GP_GamesStatusCodes.STATUS_OK)); result.SetMatches(_Matches); result.SetInvitations(_Invitations); MatchesListUpdated(); MatchesListLoadedEvent(result); } }
private void HandleActionMatchesInfoLoaded(UM_TBM_MatchesLoadResult res) { if (res.IsFailed) { return; } foreach (UM_TBM_Invite iinvite in TBM.Matchmaker.Invitations) { TBM.Matchmaker.AcceptInvite(iinvite); } foreach (UM_TBM_Match mmatch in TBM.Matchmaker.Matches) { MatchPanelUI panel = CreateNewMatchPanel(mmatch.Status == UM_TBM_MatchStatus.Ended ? FinishedMatchesHolder : ActiveMatchesHolder); panel.SetMatchInfo(mmatch); if (!matchUIs.ContainsKey(mmatch.Id)) { matchUIs.Add(mmatch.Id, panel); } } }
void HandleActionMatchesInfoLoaded(GK_TBM_LoadMatchesResult res) { UM_TBM_MatchesLoadResult result = new UM_TBM_MatchesLoadResult(res); if (res.IsSucceeded) { _Matches.Clear(); _Invitations.Clear(); foreach (KeyValuePair <string, GK_TBM_Match> pair in res.LoadedMatches) { GK_TBM_Match match = pair.Value; if (match.LocalParticipant == null) { continue; } if (match.LocalParticipant.Status == GK_TurnBasedParticipantStatus.Invited) { UM_TBM_Invite invite = new UM_TBM_Invite(match); _Invitations.Add(invite); } else { UM_TBM_Match m = new UM_TBM_Match(match); _Matches.Add(m); } result.SetMatches(_Matches); result.SetInvitations(_Invitations); } } MatchesListUpdated(); MatchesListLoadedEvent(result); }