Esempio n. 1
0
        private void Networkplayagain(object sender, PlayAgainArgs e)
        {
            this.Invoke((MethodInvoker) delegate()
            {
                progressBar1.Visible = false;
            });

            if (e.Response == "no")
            {
                MessageBox.Show("Server refused to play again", "Game ended", MessageBoxButtons.OK);

                network.Stop();
            }
            else
            {
                DialogResult result = MessageBox.Show("Do you want to play Again?", "play again", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    network.Send("playAgain", "yes");
                }
                else
                {
                    network.Send("playAgain", "no");
                    network.Stop();
                }
            }
        }
Esempio n. 2
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (network != null)
     {
         //network.Disconnected -= Network_Disconnected;
         network.Stop();
     }
 }