Esempio n. 1
0
        private void Button_Accept_Click(object sender, RoutedEventArgs e)
        {
            Lobby lobby = new Lobby(playerThis);

            lobby.Show();
            this.Close();
        }
Esempio n. 2
0
 private void Button_LogIn_Click(object sender, RoutedEventArgs e)
 {
     try {
         if (textBox_UserName.Text != "" && passwordBox_Password.Password != "")
         {
             string encryptedPassword = playerClient.EncryptPassword(passwordBox_Password.Password);
             ServiceReference.Player PlayerLogging = playerClient.LogIn(textBox_UserName.Text, encryptedPassword);
             if (PlayerLogging != null)
             {
                 Lobby lobby = new Lobby(PlayerLogging);
                 lobby.Show();
                 this.Close();
             }
             else
             {
                 label_Message.Content = Properties.Resources.message_WrongPasswordUserName;
             }
         }
         else
         {
             label_Message.Content = Properties.Resources.message_CompleteFieldsPasswordEmail;
         }
     } catch (Exception ex) {
         ServerFailed serverFailed = new ServerFailed();
         serverFailed.Show();
         this.Close();
     }
 }
Esempio n. 3
0
 private void TableClosing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (Fold.Visible)
     {
         I.Write("Fold$");
         Thread.Sleep(500);
     }
     I.Write("Stand$");
     I.Write("Leave$");
     lobby.Show();
 }
Esempio n. 4
0
        public void NotifyLoserEndGame()
        {
            Lobby lobby = new Lobby(playerThis);

            MessageBox.Show(Properties.Resources.message_LoserFail, Properties.Resources.message_Luck, MessageBoxButton.OK, MessageBoxImage.Information);
            chatClient.ExitChat(playerThis.UserName);
            gameClient.ExitGame(playerThis.UserName, idGame);
            this.Close();
            lobby.Show();
            music.SoundLocation = path + "/Resources/MENU.wav";
            music.PlayLooping();
            music.Dispose();
        }
Esempio n. 5
0
 private void LeftGame()
 {
     try {
         Lobby lobby = new Lobby(playerThis);
         gameClient.ExitGame(playerThis.UserName, idGame);
         startGameClient.ExitStartGame(playerThis.UserName);
         lobby.Show();
         this.Close();
     } catch (Exception) {
         ServerFailed serverFailed = new ServerFailed();
         serverFailed.Show();
         this.Close();
     }
 }
 private void Tolobby(object sender, RoutedEventArgs e)
 {
     try
     {
         Lobby mainWindow = new Lobby(Client, callback, Username);
         mainWindow.Title = Username;
         this.Close();
         mainWindow.Show();
     }
     catch (Exception)
     {
         this.Close();
     }
 }
Esempio n. 7
0
        public void NotifyWinnerEndGame()
        {
            PlaySoundWinnerCharacter(idSelectedCharacter);
            playerClient.AddOneScore(playerThis.UserName);
            MessageBox.Show(Properties.Resources.message_WinnerPass, Properties.Resources.message_Congrats, MessageBoxButton.OK, MessageBoxImage.Information);
            chatClient.ExitChat(playerThis.UserName);
            gameClient.ExitGame(playerThis.UserName, idGame);
            Lobby lobby = new Lobby(playerThis);

            this.Close();
            lobby.Show();
            music.SoundLocation = path + "/Resources/MENU.wav";
            music.PlayLooping();
            music.Dispose();
        }
Esempio n. 8
0
        private void button1_Click(object sender, EventArgs e)
        {
            I.Write(textBox1.Text + "$" + textBox2.Text);
            if (I.Read() == "1")
            {
                I.Name = textBox1.Text;

                this.Visible = false;
                Lobby lobby = new Lobby();
                lobby.Show();
            }
            else
            {
                label1.Visible = true;
                Thread.Sleep(5000);
            }
        }
 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();
 }