Пример #1
0
        public static void ChallengeAccepted(string sender, string receiver)
        {
            GlobalItems.OngoingMatches.Add(new LiveMatch(sender, receiver));

            int a = GlobalItems.OngoingMatches.Count;

            for (int i = 0; i < a; i++)
            {
                LiveMatch alpha = GlobalItems.OngoingMatches[i];

                if (alpha != null)
                {
                    var abc = alpha.Sender;
                }
            }

            for (var i = 0; i < GlobalItems.Requests.Count; i++)
            {
                GameRequests item   = GlobalItems.Requests[i];
                var          sentBy = item.SenderName;
                var          sentTo = item.ReceiverName;
                if (sentTo != null && sentBy != null)
                {
                    if (sentTo == receiver && sentBy == sender)
                    {
                        GlobalItems.Requests.RemoveAt(i);
                    }
                }
            }
        }
Пример #2
0
 public static void RemoveRequest(string sender, string receiver)
 {
     for (var i = 0; i < GlobalItems.Requests.Count; i++)
     {
         GameRequests item   = GlobalItems.Requests[i];
         var          sentBy = item.SenderName;
         var          sentTo = item.ReceiverName;
         if (sentTo != null && sentBy != null)
         {
             if (sentTo == receiver && sentBy == sender)
             {
                 GlobalItems.Requests.RemoveAt(i);
             }
         }
     }
 }