Exemple #1
0
 public CreateAccount()
 {
     playerClient = new ServiceReference.PlayerManagerClient();
     newPlayer    = new ServiceReference.Player();
     code         = new ServiceReference.Code();
     InitializeComponent();
     SetHideForm();
 }
Exemple #2
0
 public Lobby(ServiceReference.Player player)
 {
     playerThis   = player;
     playerClient = new ServiceReference.PlayerManagerClient();
     gameClient   = new ServiceReference.GameManagerClient();
     InitializeComponent();
     label_UserName.Content = playerThis.UserName;
     label_EE.Content       = "EE: " + playerClient.GetScore(playerThis.UserName);
 }
 private void SendPlayer()
 {
     ServiceReference.Player player = new ServiceReference.Player();
     ServiceReference.PlayerManagerClient client = new ServiceReference.PlayerManagerClient();
     player.UserName = textBox_UserName.Text;
     player.Password = passwordBox_Password.Password;
     player.Email    = textBox_Email.Text;
     player.Score    = "0";
     client.AddPlayer(player);
     client.Close();
 }
 private void Button_Send_Click(object sender, RoutedEventArgs e)
 {
     using (ServiceReference.PlayerManagerClient client = new ServiceReference.PlayerManagerClient()) {
         if (ValidateBlankSpaces(textBox_UserName.Text, passwordBox_Password.Password, passwordBox_PasswordConfirmed.Password,
                                 textBox_Email.Text, textBox_EmailConfirmed.Text))
         {
             label_Message.Content = "*Debe completar todos campos";
         }
         else
         {
             bool playerFinded = client.FindPlayer(textBox_UserName.Text, textBox_Email.Text);
             if (playerFinded == true)
             {
                 if (passwordBox_Password.Password == passwordBox_PasswordConfirmed.Password)
                 {
                     if (textBox_Email.Text == textBox_EmailConfirmed.Text)
                     {
                         if (ValidateEmail(textBox_Email.Text) == true)
                         {
                             MainWindow mainWindow = new MainWindow();
                             SendPlayer();
                             this.Close();
                             mainWindow.Show();
                         }
                         else
                         {
                             label_Message.Content = "*Introduzca un correo electrónico válido";
                         }
                     }
                     else
                     {
                         label_Message.Content = "*El correo electrónico y/o contraseña deben coincidir";
                     }
                 }
                 else
                 {
                     label_Message.Content = "*El correo electrónico y/o contraseña deben coincidir";
                 }
             }
             else
             {
                 label_Message.Content = "*Nombre de usuario y/o Correo electrónico ocupado";
             }
         }
     }
 }
Exemple #5
0
 public TeacherMatchBoard(ServiceReference.Player player, int idGame, int idSelectedCharacter)
 {
     playerInstance = new InstanceContext(this);
     playerClient   = new ServiceReference.PlayerManagerClient();
     gameClient     = new ServiceReference.GameManagerClient();
     chatClient     = new ServiceReference.ChatManagerClient(playerInstance);
     music          = new SoundPlayer();
     InitializeComponent();
     playerThis  = player;
     this.idGame = idGame;
     this.idSelectedCharacter = idSelectedCharacter;
     InitializeMusic();
     chatClient.ConnectToChat(playerThis.UserName);
     ShowSelectedCharacter();
     chatClient.InitializeGameChat(idGame, playerThis.UserName);
     label_Message.Content    = playerThis.UserName;
     label_Message_EE.Content = "EE: " + playerClient.GetScore(playerThis.UserName);
 }
 private void Button_LogIn_Click(object sender, RoutedEventArgs e)
 {
     ServiceReference.PlayerManagerClient client = new ServiceReference.PlayerManagerClient();
     if (textBox_UserName.Text != "" && passwordBox_Password.Password != "")
     {
         bool Logging = client.LogIn(textBox_UserName.Text, passwordBox_Password.Password);
         if (Logging == true)
         {
             Lobby lobby = new Lobby();
             lobby.Show();
             this.Close();
         }
         else
         {
             label_Message.Content = "*Usuario y/o contraseña incorrectos";
         }
     }
     else
     {
         label_Message.Content = "*Complete los campos de Usuario y/o Contraseña";
     }
     client.Close();
 }