public Client_Thread(TcpClient client, StreamReader receiverStream, Player_Control player) { receiver_mana = new Receiver_Manager(client, receiverStream, player); send_mana = new Send_Manager(client, player); // tạo luồng giao tiếp riêng với client tuyen_client = new Thread(new ThreadStart(ReceiveData)); tuyen_client.Start(); }
public void UserNameHasChange(object sender, EventArgs e) { Control Button = sender as Control; //Get Parent Control Parent = Button.Parent; Player_Control user = Parent as Player_Control; WriteLog("Vừa được thay đổi thành : " + user.name_lb.Text + WriteTimeNow(), user.IndexOfUser); }
public void SubScoreEvent(object sender, EventArgs e) { Control Button = sender as Control; //Get Parent Control Parent = Button.Parent; //Get Parent Of Parent Control ParentOfParent = Parent.Parent; Player_Control user = ParentOfParent as Player_Control; WriteLog(user.name_lb.Text + " vừa bị trừ 10 điểm " + WriteTimeNow(), user.IndexOfUser); }
public void ReceiveAnswer(object sender, EventArgs e) { Control Button = sender as Control; //Get Parent Control Parent = Button.Parent; //Get Parent Of Parent Control ParentOfParent = Parent.Parent; Player_Control user = ParentOfParent as Player_Control; WriteLog(user.name_lb.Text + " vừa trả lời : " + user.answer_content.Text + WriteTimeNow(), user.IndexOfUser); }
/*INIT*/ public Send_Manager(TcpClient client, Player_Control player) { this.Client = client; this.Player = player; Create_Event_For_Send_Manager(); Send_Player_InFo(); Send_Screen_Properties(); player_manager = new Player_Manager(null); }
public void CustomScoreEvent(object sender, EventArgs e) { Control Button = sender as Control; //Get Parent Control Parent = Button.Parent; //Get Parent Of Parent Control ParentOfParent = Parent.Parent; Player_Control user = ParentOfParent as Player_Control; int scoreHasChange; if (user.addScore_tb.Text == "" || int.TryParse(user.addScore_tb.Text, out scoreHasChange) == false) { return; } WriteLog(user.name_lb.Text + " vừa được thay đổi thành " + scoreHasChange + " điểm " + WriteTimeNow(), user.IndexOfUser); }
public void SubmitMode(object sender, EventArgs e) { Control Button = sender as Control; //Get Parent Control Parent = Button.Parent; //Get Parent Of Parent Control ParentOfParent = Parent.Parent; //Get Parent Of Paren Of Parent Control ParentOfParentOfParent = ParentOfParent.Parent; //Get Parent Of Paren Of Parent Of Parent Control ParentOfParentOfParentOfParent = ParentOfParentOfParent.Parent; Player_Control user = ParentOfParentOfParentOfParent as Player_Control; if (user.IsLock == 1) { WriteLog(user.name_lb.Text + " đã bị khóa chế độ nộp " + WriteTimeNow(), user.IndexOfUser); } if (user.IsLock == 0) { WriteLog(user.name_lb.Text + " đã được mở khóa chế độ nộp " + WriteTimeNow(), user.IndexOfUser); } }
public void LockUserEdit(object sender, EventArgs e) { Control Button = sender as Control; //Get Parent Control Parent = Button.Parent; //Get Parent Of Parent Control ParentOfParent = Parent.Parent; //Get Parent Of Paren Of Parent Control ParentOfParentOfParent = ParentOfParent.Parent; //Get Parent Of Paren Of Parent Of Parent Control ParentOfParentOfParentOfParent = ParentOfParentOfParent.Parent; Player_Control user = ParentOfParentOfParentOfParent as Player_Control; if (user.IsLockEdit == 1) { WriteLog(user.name_lb.Text + " vừa bị khóa chỉnh sửa từ máy chủ " + WriteTimeNow(), user.IndexOfUser); } if (user.IsLockEdit == 0) { WriteLog(user.name_lb.Text + " vừa được mở khóa chỉnh sửa từ máy chủ " + WriteTimeNow(), user.IndexOfUser); } }
public void ReceiveAlarm(object sender, EventArgs e) { Player_Control user = sender as Player_Control; WriteLog(user.name_lb.Text + " vừa gửi chuông " + WriteTimeNow(), user.IndexOfUser); }
public Receiver_Manager(TcpClient client, StreamReader readData, Player_Control player) { Player_control = player; Client = client; ReadData = readData; }