private void JoinGame_Click(object sender, EventArgs e)
        {
            Game game = listBox1.SelectedItem as Game;

            Game game2   = client.RetrieveGame(game.Name, false);
            bool success = client.JoinGame(game2);

            if (success)
            {
                this.Hide();
                (new Lobby(game2, client)).Show();
            }
            else
            {
                MessageBox.Show("Unable to join game!", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void JoinGame_Click(object sender, EventArgs e)
        {
            Game game  = listBox1.SelectedItem as Game;
            Game game2 = client.ChooseGame(game.Name, false);
            //label1.Text = CurrentPlayer.Name;
            bool success = client.JoinGame(game2, PlayerCredentials.Instance.Player);

            if (success)
            {
                this.Hide();
                (new Lobby(game2)).Show();
            }
            else
            {
                MessageBox.Show("Unable to join game!", "Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }