コード例 #1
0
ファイル: Game1.cs プロジェクト: gogodr/CEIDS-Old-Files
        public void mandacion()
        {
            cliente = new Cliente();
            cliente.conectar("192.168.52.56", 8888);
            for (; ; )
            {
                Thread.Sleep(2);
                try
                {
                    cliente.enviar(100 + "Y" + (512 + (posi - 50) * -10) + "\0");
                }
                catch
                {
                }

                cliente.recibir(ref paquete);

                if (paquete.Split('Y').Length == 4)
                {

                    pos = new Vector2(float.Parse(paquete.Split('Y')[0]), float.Parse(paquete.Split('Y')[1]));
                    puntaje = paquete.Split('Y')[2];
                    estado = paquete.Split('Y')[3];
                   
                }

            }
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: gogodr/CEIDS-Old-Files
            public void mandacion()
            {
                cliente = new Cliente();
                cliente.conectar("192.168.52.56", 8888);
                for (; ; )
                {
                    
                   // cliente.enviar( "Y" + "" + "\0");

                    cliente.recibir(ref paquete);
                
                    if (paquete.Split('Y').Length == 2)
                    {
                        try
                        {
                            pos = new Vector2(float.Parse(paquete.Split('Y')[0]), float.Parse(paquete.Split('Y')[1]));
                        }
                        catch {

                        }
                    }
            }
        }