private void join_enter_button_Click(object sender, EventArgs e)
 {
     playButtonClick();
     dataBase.joinGame(join_gameID_textbox.Text, join_PlayerID_textbox.Text);
     if (dataBase.serverError == false)
     {
         using (game_play_ui gamePlayScreen = new game_play_ui(ref dataBase))
         {
             this.Hide();
             this.Owner.Hide();
             gamePlayScreen.ShowDialog();
         }
     }
     else
     {
         DialogResult result = MessageBox.Show("Bi sıkıntı var joinn", "Paniiik", MessageBoxButtons.YesNo);
         if (result == System.Windows.Forms.DialogResult.Yes)
         {
             Application.Exit();
         }
     }
 }
Example #2
0
        private async void host_enter_button_Click(object sender, EventArgs e)
        {
            playButtonClick();
            dataBase.hostGame(host_gameID_textbox.Text, host_playerID_textbox.Text);
            await Task.Delay(TimeSpan.FromMilliseconds(300));

            if (dataBase.serverError == false)
            {
                using (game_play_ui gamePlayScreen = new game_play_ui(ref dataBase))
                {
                    this.Hide();
                    this.Owner.Hide();
                    gamePlayScreen.ShowDialog();
                }
            }
            else
            {
                DialogResult result = MessageBox.Show("Bi sıkıntı var hostt", "Paniiik", MessageBoxButtons.YesNo);
                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    Application.Exit();
                }
            }
        }