private void btnAdb_Click(object sender, EventArgs e) { btnAdb.Enabled = false; NetWork.SendMsg("abandon"); NameTable[Player.MyName].Controls.Clear(); IsMyGround = false; }
private void btnReady_Click(object sender, EventArgs e) { NetWork.SendMsg("ready"); while (!NetWork.IsGameStart) { Thread.Sleep(3000); } Form2 f2 = new Form2(); f2.Show(); this.Hide(); }
private void btnCompare_Click(object sender, EventArgs e) { if (listName.SelectedIndex == -1) { MessageBox.Show("请选择要比较的玩家", "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop); } else { NetWork.SendMsg("compare with " + listName.Text); Player.Chip -= 50; labelChip.Text = "筹码:" + Player.Chip.ToString(); IsMyGround = false; } }
private void btnConnect_Click(object sender, EventArgs e) { IsConnect = NetWork.Connect(txtServerIP.Text, Convert.ToInt32(txtServerPort.Text)); //连接成功就发送用户名 if (IsConnect) { NetWork.SendMsg(txtName.Text.Trim()); Player.MyName = txtName.Text.Trim(); MessageBox.Show("连接成功,请准备"); } else { MessageBox.Show("错误发生,请稍后再试!"); } }
private void btnFlow_Click(object sender, EventArgs e) { NetWork.SendMsg("50"); Player.Chip -= 50; labelChip.Text = "筹码:" + Player.Chip.ToString(); IsMyGround = false; }