private void button1_Click(object sender, EventArgs e) { string a = InGameForm.enterText("Введите новое имя для планеты"); if (a != string.Empty) { string[] res = new string[2]; res[0] = a; newName(res); } }
private void button1join_Click(object sender, EventArgs e) { if (connection != null) { connection.disconnect(); } me.name = textBox3name.Text; me.online = true; me.civSettings = new CivSettings(); me.civSettings.name = "Человеки"; int port = 0; try { port = Convert.ToInt32(textBox2port.Text); Tested = false; connection = new ClientConnectionSys(me, textBox1ip.Text, port, textBox4pass.Text); while (!Tested) { Thread.Sleep(100); } if (SuccesConnected) { game = new InGameForm(me, connection); game.FormClosed += game_FormClosed; game.addToChat("Сервер", welcomeStr); this.Hide(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }