コード例 #1
0
        internal void HandleMatchFromNotification(TurnBasedMatch match)
        {
            Logger.d("AndroidTbmpClient.HandleMatchFromNotification");
            Logger.d("Got match from notification: " + match);

            if (mMatchDelegate != null)
            {
                Logger.d("Delivering match directly to match delegate.");
                MatchDelegate del = mMatchDelegate;
                PlayGamesHelperObject.RunOnGameThread(() => {
                    del.Invoke(match, true);
                });
            }
            else
            {
                Logger.d("Since we have no match delegate, holding on to the match until we have one.");
                mMatchFromNotification = match;
            }
        }
コード例 #2
0
        public void RegisterMatchDelegate(MatchDelegate deleg)
        {
            Logger.d("AndroidTbmpClient.RegisterMatchDelegate");
            if (deleg == null)
            {
                Logger.w("Can't register a null match delegate.");
                return;
            }

            mMatchDelegate = deleg;

            // if we have a pending match to deliver, deliver it now
            if (mMatchFromNotification != null)
            {
                Logger.d("Delivering pending match to the newly registered delegate.");
                TurnBasedMatch match = mMatchFromNotification;
                mMatchFromNotification = null;
                PlayGamesHelperObject.RunOnGameThread(() => {
                    deleg.Invoke(match, true);
                });
            }
        }
コード例 #3
0
 public void RegisterMatchDelegate(MatchDelegate deleg) {
     Logger.d("AndroidTbmpClient.RegisterMatchDelegate");
     if (deleg == null) {
         Logger.w("Can't register a null match delegate.");
         return;
     }
     
     mMatchDelegate = deleg;
     
     // if we have a pending match to deliver, deliver it now
     if (mMatchFromNotification != null) {
         Logger.d("Delivering pending match to the newly registered delegate.");
         TurnBasedMatch match = mMatchFromNotification;
         mMatchFromNotification = null;
         PlayGamesHelperObject.RunOnGameThread(() => {
             deleg.Invoke(match, true);
         });                
     }
 }