Exemplo n.º 1
0
 private void bunifuButton2_Click(object sender, EventArgs e)
 {
     byte[] b = Encoding.ASCII.GetBytes("MissingGame|" + bunifuTextBox1.Text + "|" + Me.username);
     SocketMain.SendData(b, SocketMain.ns);
     MessageBox.Show("Merci pour votre rapport");
     this.Hide();
 }
Exemplo n.º 2
0
 private void bunifuButton1_Click(object sender, EventArgs e)
 {
     byte[] b = Encoding.ASCII.GetBytes("JoinRoomRequest|" + room.ToString() + "|" + Me.username);
     Me.currentroom    = room;
     SocketMain.f7todo = "keep";
     SocketMain.SendData(b, SocketMain.ns);
 }
Exemplo n.º 3
0
        private static void Main()
        {
            var f = new SocketMain();

            Console.ReadLine();
            //AgentService.ServiceMain();
        }
Exemplo n.º 4
0
 private void bunifuImageButton3_Click(object sender, EventArgs e)
 {
     byte[] b = Encoding.ASCII.GetBytes("SendMessageRequest|" + bunifuMaterialTextbox2.Text + "|" + Me.username + "|" + Me.currentroom.ToString());
     SocketMain.SendData(b, SocketMain.ns);
     flowLayoutPanel1.VerticalScroll.Value = flowLayoutPanel1.VerticalScroll.Maximum;
     bunifuMaterialTextbox2.Text           = "";
 }
Exemplo n.º 5
0
        private void disconect_button_Click(object sender, EventArgs e)
        {
            byte[] b = Encoding.ASCII.GetBytes("DisconnectRequest");
            SocketMain.SendData(b, SocketMain.ns);

            Application.Exit();
        }
Exemplo n.º 6
0
 private void bunifuImageButton1_Click(object sender, EventArgs e)
 {
     if (Me.currentroomadmin == Me.username)
     {
         SocketMain.SendData(Encoding.ASCII.GetBytes("RemoveRoom|" + Me.currentroom.ToString()), SocketMain.ns);
     }
     SocketMain.EndSession();
     //Application.Exit();
 }
Exemplo n.º 7
0
        private void timer3_Tick(object sender, EventArgs e)
        {
            SocketMain sock = new SocketMain();

            new Thread(() =>
            {
                sock.Connect();
            }).Start();
            timer3.Stop();
        }
Exemplo n.º 8
0
 private void bunifuMaterialTextbox2_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         byte[] b = Encoding.ASCII.GetBytes("SendMessageRequest|" + bunifuMaterialTextbox2.Text + "|" + Me.username + "|" + Me.currentroom.ToString());
         SocketMain.SendData(b, SocketMain.ns);
         flowLayoutPanel1.VerticalScroll.Value = flowLayoutPanel1.VerticalScroll.Maximum;
         bunifuMaterialTextbox2.Text           = "";
         e.Handled          = true;
         e.SuppressKeyPress = true;
     }
 }
Exemplo n.º 9
0
        private void bunifuButton2_Click(object sender, EventArgs e)
        {
            string groupname  = groupname_text.Text;
            string gameID     = Game.GetIDByGame(gameid_combobox.Text);
            int    maxplayers = maxplayer_slider.Value;
            bool   ispublic   = bunifuToggleSwitch1.Value;

            if (groupname == "" || groupname.Length < 4)
            {
                MessageBox.Show("Nom de groupe trop court (4 charactères minimum)");
            }
            else
            {
                if (bunifuToggleSwitch1.Value == false)
                {
                    ispublic = true;
                }
                else
                {
                    ispublic = false;
                }
                string groupdesc = groupdescription_text.Text;
                string ispb      = "";
                if (ispublic == true)
                {
                    ispb = "public";
                }
                else
                {
                    ispb = "private";
                }
                if (gameID != "")
                {
                    Group.g.Clear();
                    if (maxplayers < 2)
                    {
                        MessageBox.Show("Le nombre de places minimal est de 2 joueurs");
                    }
                    if (maxplayers >= 2)
                    {
                        string msg = "CreateGroupRequest|" + Me.username + "|" + "1" + "|" + maxplayers.ToString() + "|" + ispb + "|" + gameID + "|" + groupname + "|" + groupdesc;
                        SocketMain.SendData(Encoding.ASCII.GetBytes(msg), SocketMain.ns);
                        string msgs = "JoinCreatedGroup|" + Me.username;
                        SocketMain.SendData(Encoding.ASCII.GetBytes(msgs), SocketMain.ns);
                    }
                }
                else
                {
                    MessageBox.Show("Impossible de créer un groupe pour ce jeu, merci de contacter un administrateur");
                }
            }
        }
Exemplo n.º 10
0
 private void disconnect_button_Click(object sender, EventArgs e)
 {
     if (Me.username == Me.currentroomadmin)
     {
         byte[] b = Encoding.ASCII.GetBytes("RemoveRoom|" + Me.currentroom.ToString());
         SocketMain.SendData(b, SocketMain.ns);
     }
     else
     {
         byte[] b = Encoding.ASCII.GetBytes("LeaveRoom|" + Me.currentroom.ToString());
         SocketMain.SendData(b, SocketMain.ns);
     }
 }
Exemplo n.º 11
0
 private void bunifuButton1_Click(object sender, EventArgs e)
 {
     if (bunifuCheckBox2.Checked == true)
     {
         Properties.Settings.Default.check    = true;
         Properties.Settings.Default.username = username_text.Text;
         Properties.Settings.Default.password = password_text.Text;
         Properties.Settings.Default.Save();
     }
     if (username_text.Text != "" && password_text.Text != "")
     {
         string msg  = "AuthRequest|" + username + "|" + password;
         byte[] bmsg = Encoding.ASCII.GetBytes(msg);
         Me.username = username_text.Text;
         SocketMain.SendData(bmsg, SocketMain.ns);
     }
 }
Exemplo n.º 12
0
        private void bunifuButton1_Click(object sender, EventArgs e) // inscription
        {
            string identifiant = bunifuTextBox1.Text;
            string email       = bunifuTextBox3.Text;
            string password    = bunifuTextBox2.Text;
            string confirm     = bunifuTextBox4.Text;

            if (bunifuCheckBox2.Checked != true)
            {
                MessageBox.Show("Veuillez accepter les CGU");
            }
            if (bunifuTextBox1.Text.Length > 0 && bunifuTextBox3.Text.Length > 0 && bunifuTextBox2.Text.Length > 0 && bunifuTextBox4.Text == password && bunifuCheckBox2.Checked == true)
            {
                string msg  = "RegisterRequest|" + identifiant + "|" + email + "|" + password;
                byte[] bmsg = Encoding.ASCII.GetBytes(msg);
                SocketMain.SendData(bmsg, SocketMain.ns);
            }
            else
            {
                MessageBox.Show("Veuillez remplir tout les champs !");
            }
        }
Exemplo n.º 13
0
 private void bunifuImageButton1_Click(object sender, EventArgs e)
 {
     SocketMain.EndSession();
 }
Exemplo n.º 14
0
 private void bunifuImageButton1_Click(object sender, EventArgs e)
 {
     byte[] b = Encoding.ASCII.GetBytes("RoomKick|" + userprofil.Text + "|" + Me.currentroomadmin);
     SocketMain.SendData(b, SocketMain.ns);
 }