//EMPEZAR VIDEOLLAMADA private void PICCAM_CHAT_Click(object sender, EventArgs e) { string conec = "Videollamada%" + frmLogin.NomU + "%" + lb_User2.Text; datados = Encoding.ASCII.GetBytes(conec); frmMenu.server.Send(datados, 0, datados.Length, SocketFlags.None); frmCamara camis = new frmCamara(); camis.Empezar2.Visible = true; camis.Show(); if (frmLogin.camm == "0") { frmMenu.Cliente = Encoding.ASCII.GetBytes("Logro%vidrio" + "%" + frmLogin.NomU + "%" + frmLogin.idU); frmMenu.server.Send(frmMenu.Cliente); MessageBox.Show("Nuevo logro!", "YEY", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
public void recibir() { while (true) { recv = server.Receive(data); stringData = Encoding.ASCII.GetString(data, 0, recv); string[] words = new string[4]; words = stringData.Split('%'); if (words[0] == "Login") { frmLogin.emailU = words[1]; frmLogin.idU = words[2]; frmLogin.zumba = words[3]; frmLogin.chato1 = words[4]; frmLogin.chato2 = words[5]; frmLogin.ora = words[6]; frmLogin.camm = words[7]; frmLogin.cuenta = words[8]; frmLogin.jugo = words[9]; frmLogin.mail = words[10]; if (frmLogin.zumba == "1") { pic_logro2.Image = ClientPOI.Properties.Resources.buzzz; } if (frmLogin.chato1 == "1") { pic_logro3.Image = ClientPOI.Properties.Resources.chat; } if (frmLogin.chato2 == "1") { pic_logro4.Image = ClientPOI.Properties.Resources.chatgrupal; } if (frmLogin.ora == "1") { pic_logro5.Image = ClientPOI.Properties.Resources.reloj; } if (frmLogin.camm == "1") { pic_logro6.Image = ClientPOI.Properties.Resources.camaraa; } if (frmLogin.cuenta == "1") { pic_logro1.Image = ClientPOI.Properties.Resources.nuevaCuenta; } if (frmLogin.jugo == "1") { pic_logro7.Image = ClientPOI.Properties.Resources.gamo; } if (frmLogin.mail == "1") { pic_logro8.Image = ClientPOI.Properties.Resources.mail; } } else if (words[0] == "Logro") { if (words[1] == "ora") { pic_logro5.Image = ClientPOI.Properties.Resources.reloj; } if (words[1] == "cgrup") { pic_logro4.Image = ClientPOI.Properties.Resources.chatgrupal; } if (words[1] == "cind") { pic_logro3.Image = ClientPOI.Properties.Resources.chat; } if (words[1] == "boss") { pic_logro2.Image = ClientPOI.Properties.Resources.buzzz; } if (words[1] == "vidrio") { pic_logro6.Image = ClientPOI.Properties.Resources.camaraa; } if (words[1] == "cuenta") { pic_logro1.Image = ClientPOI.Properties.Resources.nuevaCuenta; } if (words[1] == "juego") { pic_logro7.Image = ClientPOI.Properties.Resources.gamo; } if (words[1] == "email") { pic_logro8.Image = ClientPOI.Properties.Resources.mail; } } else if (words[0] == "Personal" || words[0] == "Grupal") { mensajenuevo = words[3]; AQuien = words[1]; DeQuien = words[2]; if (words[0] == "Personal") { personal = true; grupal = false; } if (words[0] == "Grupal") { personal = false; grupal = true; } } else if (words[0] == "Videollamada") { yousend = true; DudMandar = new UdpClient(ip_server, 9999); } else if (words[0] == "VideollamadaRecibir") { ireceive = true; DudMandar = new UdpClient(ip_server, 666); DialogResult boton = MessageBox.Show(words[2] + "quiere hacer una llamada contigo", "EY", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (boton == DialogResult.OK) { //funcion que no va aqui porque no es necesaria NombrePerVideollamda = words[2]; frmCamara camis = new frmCamara(); camis.Empezar.Visible = true; camis.ShowDialog(); } } else if (words[0] == "Abueno") { OCtl = true; } else if (words[0] == "juego") { DialogResult boton = MessageBox.Show(words[1] + " quiere juegar", "EY", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); if (boton == DialogResult.OK) { frmGame Game = new frmGame(); frmGame.osorio = false; Game.PIC1.Enabled = false; Game.PIC2.Enabled = false; Game.PIC3.Enabled = false; Game.PIC4.Enabled = false; Game.PIC5.Enabled = false; Game.PIC6.Enabled = false; Game.PIC7.Enabled = false; Game.PIC8.Enabled = false; Game.PIC9.Enabled = false; //Game.Parent = null; Game.ShowDialog(); break; } } else if (words[0] == "Buzz") { chatbuzz = true; } Thread.Sleep(1000); } }