// Token: 0x0600059E RID: 1438 RVA: 0x0002548C File Offset: 0x0002388C
        public void recibir_CallBack(IAsyncResult ar)
        {
            bool flag = !this.esta_Conectado() || this.disposed;

            if (flag)
            {
                this.get_Desconectar_Socket();
            }
            else
            {
                SocketError socketError;
                int         num   = this.socket.EndReceive(ar, out socketError);
                bool        flag2 = num > 0 && socketError == SocketError.Success;
                if (flag2)
                {
                    string @string = Encoding.UTF8.GetString(this.buffer, 0, num);
                    foreach (string text in from x in @string.Replace("\n", string.Empty).Split(new char[1])
                             where x != string.Empty
                             select x)
                    {
                        Action <string> action = this.paquete_recibido;
                        if (action != null)
                        {
                            action(text);
                        }
                        bool flag3 = this.esta_esperando_paquete;
                        if (flag3)
                        {
                            this.pings.Add(Environment.TickCount - this.ticks);
                            bool flag4 = this.pings.Count > 48;
                            if (flag4)
                            {
                                this.pings.RemoveAt(1);
                            }
                            this.esta_esperando_paquete = false;
                        }
                        PaqueteRecibido.Recibir(this, text);
                    }
                    bool flag5 = this.esta_Conectado();
                    if (flag5)
                    {
                        this.socket.BeginReceive(this.buffer, 0, this.buffer.Length, SocketFlags.None, new AsyncCallback(this.recibir_CallBack), this.socket);
                    }
                }
                else
                {
                    this.cuenta.desconectar();
                }
            }
        }
示例#2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Task.Run(() =>
            {
                GlobalConf.cargar_Todas_Cuentas();
                XElement.Parse(Properties.Resources.interactivos).Descendants("SKILL").ToList().ForEach(i => new ObjetoInteractivoModelo(i.Element("nombre").Value, i.Element("gfx").Value, bool.Parse(i.Element("caminable").Value), i.Element("habilidades").Value, bool.Parse(i.Element("recolectable").Value)));
                paquete_recibido = new PaqueteRecibido();
                paquete_recibido.Inicializar();
            });

            Application.Run(new Principal());
        }
示例#3
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Task.Run(() =>
            {
                GlobalConf.cargar_Todas_Cuentas();
                XElement.Parse(Properties.Resources.interactivos).Descendants("SKILL").ToList().ForEach(i => new ObjetoInteractivoModelo(i.Element("nombre").Value, i.Element("gfx").Value, bool.Parse(i.Element("caminable").Value), i.Element("habilidades").Value, bool.Parse(i.Element("recolectable").Value)));

                paquete_recibido = new PaqueteRecibido();
                paquete_recibido.Inicializar();
            }).ContinueWith(t =>
            {
                XElement.Parse(Properties.Resources.hechizos).Descendants("HECHIZO").ToList().ForEach(mapa =>
                {
                    Hechizo hechizo            = new Hechizo(short.Parse(mapa.Attribute("ID").Value), mapa.Element("NOMBRE").Value);
                    HechizoStats hechizo_stats = new HechizoStats();

                    mapa.Descendants("NIVEL").ToList().ForEach(stats =>
                    {
                        hechizo_stats.coste_pa       = byte.Parse(stats.Attribute("COSTE_PA").Value);
                        hechizo_stats.alcanze_minimo = byte.Parse(stats.Attribute("RANGO_MINIMO").Value);
                        hechizo_stats.alcanze_maximo = byte.Parse(stats.Attribute("RANGO_MAXIMO").Value);

                        hechizo_stats.es_lanzado_linea       = bool.Parse(stats.Attribute("LANZ_EN_LINEA").Value);
                        hechizo_stats.es_lanzado_con_vision  = bool.Parse(stats.Attribute("NECESITA_VISION").Value);
                        hechizo_stats.es_celda_vacia         = bool.Parse(stats.Attribute("NECESITA_CELDA_LIBRE").Value);
                        hechizo_stats.es_alcanze_modificable = bool.Parse(stats.Attribute("RANGO_MODIFICABLE").Value);

                        hechizo_stats.lanzamientos_por_turno    = byte.Parse(stats.Attribute("MAX_LANZ_POR_TURNO").Value);
                        hechizo_stats.lanzamientos_por_objetivo = byte.Parse(stats.Attribute("MAX_LANZ_POR_OBJETIVO").Value);
                        hechizo_stats.intervalo = byte.Parse(stats.Attribute("COOLDOWN").Value);

                        stats.Descendants("EFECTO").ToList().ForEach(efecto =>
                        {
                            hechizo_stats.agregar_efecto(new HechizoEfecto(int.Parse(efecto.Attribute("TIPO").Value), Zonas.Parse(efecto.Attribute("ZONA").Value)), bool.Parse(efecto.Attribute("ES_CRITICO").Value));
                        });

                        hechizo.get_Agregar_Hechizo_Stats(byte.Parse(stats.Attribute("ID").Value), hechizo_stats);
                    });
                });
            }).Wait();

            Application.Run(new Principal());
        }