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();
 }
Exemple #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);
 }
Exemple #3
0
        private static void Main()
        {
            var f = new SocketMain();

            Console.ReadLine();
            //AgentService.ServiceMain();
        }
 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           = "";
 }
        private void disconect_button_Click(object sender, EventArgs e)
        {
            byte[] b = Encoding.ASCII.GetBytes("DisconnectRequest");
            SocketMain.SendData(b, SocketMain.ns);

            Application.Exit();
        }
 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();
 }
Exemple #7
0
        private void timer3_Tick(object sender, EventArgs e)
        {
            SocketMain sock = new SocketMain();

            new Thread(() =>
            {
                sock.Connect();
            }).Start();
            timer3.Stop();
        }
 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;
     }
 }
        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");
                }
            }
        }
 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);
     }
 }
Exemple #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);
     }
 }
Exemple #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 !");
            }
        }
Exemple #13
0
 private void bunifuImageButton1_Click(object sender, EventArgs e)
 {
     SocketMain.EndSession();
 }
Exemple #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);
 }