Ejemplo n.º 1
0
        public void get_Servidor_Estado(ClienteTcp cliente, string paquete)
        {
            Cuenta cuenta = cliente.cuenta;

            string[]      separado_servidores = paquete.Substring(2).Split('|');
            ServidorJuego servidor            = cuenta.juego.servidor;
            bool          primera_vez         = true;

            foreach (string sv in separado_servidores)
            {
                string[] separador = sv.Split(';');

                int             id     = int.Parse(separador[0]);
                EstadosServidor estado = (EstadosServidor)byte.Parse(separador[1]);
                string          nombre = id == 601 ? "Eratz" : "Henual";

                if (id == cuenta.configuracion.get_Servidor_Id())
                {
                    servidor.actualizar_Datos(id, nombre, estado);
                    cuenta.logger.log_informacion("LOGIN", $"El servidor {nombre} esta {estado}");

                    if (estado != EstadosServidor.CONECTADO)
                    {
                        primera_vez = false;
                    }
                }
            }

            if (!primera_vez && servidor.estado == EstadosServidor.CONECTADO)
            {
                cliente.enviar_Paquete("Ax");
            }
        }
Ejemplo n.º 2
0
        public void get_Servidor_Estado(TcpClient cliente, string paquete)
        {
            Account cuenta = cliente.Account;

            string[]   separado_servidores = paquete.Substring(2).Split('|');
            GameServer servidor            = cuenta.Game.Server;
            bool       primera_vez         = true;

            foreach (string sv in separado_servidores)
            {
                string[] separador = sv.Split(';');

                int             id     = int.Parse(separador[0]);
                EstadosServidor estado = (EstadosServidor)byte.Parse(separador[1]);
                string          nombre = id == 601 ? "Eratz" : "Henual";

                if (id == cuenta.AccountConfiguration.get_Servidor_Id())
                {
                    servidor.actualizar_Datos(id, nombre, estado);
                    cuenta.Logger.log_information("LOGIN", $"The server {cuenta.AccountConfiguration.get_Servidor_Id()} is {estado}");

                    if (estado != EstadosServidor.ONLINE)
                    {
                        primera_vez = false;
                    }
                }
            }

            if (!primera_vez && servidor.estado == EstadosServidor.ONLINE)
            {
                cliente.Send("Ax");
            }
        }
Ejemplo n.º 3
0
        public Task get_Servidor_Estado(ClienteTcp cliente, string paquete) => Task.Run(async() =>
        {
            Cuenta cuenta = cliente.cuenta;
            string[] separado_servidores = paquete.Substring(2).Split('|');
            ServidorJuego servidor       = cuenta.juego.servidor;
            bool primera_vez             = true;

            foreach (string sv in separado_servidores)
            {
                string[] separador = sv.Split(';');

                int id = int.Parse(separador[0]);
                EstadosServidor estado = (EstadosServidor)byte.Parse(separador[1]);
                string nombre          = cuenta.configuracion.get_Servidor_Nombre(id);

                if (nombre.Equals(cuenta.configuracion.servidor))
                {
                    servidor.actualizar_Datos(id, nombre, estado);
                    cuenta.logger.log_informacion("LOGIN", $"El servidor {nombre} esta {estado}");

                    if (estado != EstadosServidor.CONECTADO)
                    {
                        primera_vez = false;
                    }
                }
            }

            if (!primera_vez && servidor.estado == EstadosServidor.CONECTADO)
            {
                await cliente.enviar_Paquete_Async("Ax");
            }
        });
Ejemplo n.º 4
0
        public void get_Servidor_Estado(ClienteTcp cliente, string paquete)
        {
            Cuenta cuenta = cliente.cuenta;

            string[] array = paquete.Substring(2).Split(new char[]
            {
                '|'
            });
            ServidorJuego servidor = cuenta.juego.servidor;
            bool          flag     = true;

            foreach (string text in array)
            {
                string[] array3 = text.Split(new char[]
                {
                    ';'
                });
                int    num   = int.Parse(array3[0]);
                string text2 = "Issering";
                switch (num)
                {
                case 601:
                    text2 = "Eratz";
                    break;

                case 602:
                    text2 = "Henual";
                    break;

                case 603:
                    text2 = "Nabur";
                    break;

                case 604:
                    text2 = "Arty";
                    break;

                case 605:
                    text2 = "Algathe";
                    break;

                case 606:
                    text2 = "Hogmeiser";
                    break;

                case 607:
                    text2 = "Droupik";
                    break;

                case 608:
                    text2 = "Ayuto";
                    break;

                case 609:
                    text2 = "Bilby";
                    break;

                case 610:
                    text2 = "Clustus";
                    break;

                case 611:
                    text2 = "Issering";
                    break;
                }
                EstadosServidor estadosServidor = (EstadosServidor)byte.Parse(array3[1]);
                bool            flag2           = num == cuenta.configuracion.get_Servidor_Id();
                if (flag2)
                {
                    servidor.actualizar_Datos(num, text2, estadosServidor);
                    cuenta.logger.log_informacion("LOGIN", string.Format("Le serveur {0} est {1}", text2, estadosServidor));
                    bool flag3 = estadosServidor != EstadosServidor.CONNECTE;
                    if (flag3)
                    {
                        flag = false;
                    }
                }
            }
            Console.WriteLine("servidor.estado");
            Console.WriteLine(flag);
            bool flag4 = !flag && servidor.estado == EstadosServidor.CONNECTE;

            if (flag4)
            {
                cliente.enviar_Paquete("Ax", false);
            }
        }
Ejemplo n.º 5
0
 // Token: 0x06000469 RID: 1129 RVA: 0x00010388 File Offset: 0x0000E788
 public void actualizar_Datos(int _id, string _nombre, EstadosServidor _estado)
 {
     this.id     = _id;
     this.nombre = _nombre;
     this.estado = _estado;
 }