Example #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (client != null)
     {
         client.sendMessage("r+true");
         if (client.ready)
         {
             Form opponentForm = new OpponentForm(client, this);
             opponentForm.Show();
             setup = false;
             ReadyButton.Hide();
             button_Reset.Hide();
             waitingLabel.Hide();
         }
         else
         {
             waitingLabel.Show();
         }
     }
     else if (server != null)
     {
         if (server.ready)
         {
             server.sendMessage("r+true");
             Form opponentForm = new OpponentForm(server, this);
             opponentForm.Show();
             setup = false;
             ReadyButton.Hide();
             button_Reset.Hide();
             waitingLabel.Hide();
         }
         else
         {
             waitingLabel.Show();
         }
     }
 }
Example #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (client != null)
     {
         client.sendMessage("r+true");
         if (client.ready)
         {
             Form opponentForm = new OpponentForm(client, this);
             opponentForm.Show();
             setup = false;
             ReadyButton.Hide();
             button_Reset.Hide();
             waitingLabel.Hide();
         }
         else
         {
             waitingLabel.Show();
         }
     }
     else if (server != null)
     {
         if (server.ready)
         {
             server.sendMessage("r+true");
             Form opponentForm = new OpponentForm(server, this);
             opponentForm.Show();
             setup = false;
             ReadyButton.Hide();
             button_Reset.Hide();
             waitingLabel.Hide();
         }
         else
         {
             waitingLabel.Show();
         }
     }
 }