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();
 }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        /*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);
        }
示例#6
0
        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);
        }
示例#7
0
        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);
            }
        }
示例#8
0
        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);
            }
        }
示例#9
0
        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);
        }
示例#10
0
 public Receiver_Manager(TcpClient client, StreamReader readData, Player_Control player)
 {
     Player_control = player;
     Client         = client;
     ReadData       = readData;
 }