Ejemplo n.º 1
0
 public void StartHowToFirst(string user, string opponent)
 {
     if (!string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(opponent))
     {
         try
         {
             if (_callback.ContainsKey(user))
             {
                 if (_callback.ContainsKey(opponent))
                 {
                     GameMng.AddHowToFirst(user, opponent);
                     _callback[user].StartHowToFirstFromServer(user, opponent);
                     _callback[opponent].StartHowToFirstFromServer(opponent, user);
                 }
                 else if (opponent == "autoPlayer")
                 {
                     GameMng.AddHowToFirst(user, opponent);
                     _callback[user].StartHowToFirstFromServer(user, opponent);
                 }
             }
         }
         catch (Exception ex)
         {
             _callback[user].RecieveError(ex.Message);
             _callback[opponent].RecieveError(ex.Message);
         }
     }
 }