Пример #1
0
        public override void Deserialize(BigEndianReader reader)
        {
            byte flag = reader.ReadByte();

            m_autoconnect    = BooleanByteWrapper.GetFlag(flag, 0);
            m_useCertificate = BooleanByteWrapper.GetFlag(flag, 1);
            m_useLoginToken  = BooleanByteWrapper.GetFlag(flag, 2);
            m_version        = new VersionExtended();
            m_version.Deserialize(reader);
            m_lang = reader.ReadUTF();
            int credentialsCount = reader.ReadUShort();
            int credentialsIndex;

            m_credentials = new System.Collections.Generic.List <byte>();
            for (credentialsIndex = 0; (credentialsIndex < credentialsCount); credentialsIndex = (credentialsIndex + 1))
            {
                m_credentials.Add(reader.ReadByte());
            }
            m_serverId            = reader.ReadShort();
            m_sessionOptionalSalt = reader.ReadVarLong();
            int failedAttemptsCount = reader.ReadUShort();
            int failedAttemptsIndex;

            m_failedAttempts = new System.Collections.Generic.List <ushort>();
            for (failedAttemptsIndex = 0; (failedAttemptsIndex < failedAttemptsCount); failedAttemptsIndex = (failedAttemptsIndex + 1))
            {
                m_failedAttempts.Add(reader.ReadVarUhShort());
            }
        }
Пример #2
0
        public static async void OnHelloConnectMessage(DofusSocket client, HelloConnectMessage message)
        {
            client.Write("Connecté au serveur d'authentification.");
            var credentials = Rsa.Encrypt(message.Key, client.Account.Login, client.Account.Password, message.Salt);

            var version = new VersionExtended
            {
                Major      = 2,
                Minor      = 42,
                Release    = 0,
                Revision   = 121463,
                Patch      = 6,
                BuildType  = (sbyte)BuildTypeEnum.Release,
                Install    = (sbyte)ClientInstallTypeEnum.ClientBundle,
                Technology = (sbyte)ClientTechnologyEnum.ClientAir
            };
            var identificationMessage = new IdentificationMessage
            {
                Autoconnect         = true,
                Credentials         = credentials,
                FailedAttempts      = new ushort[0],
                Lang                = "fr",
                ServerId            = 0,
                SessionOptionalSalt = 0,
                UseCertificate      = false,
                UseLoginToken       = false,
                Version             = version
            };

            client.Write("Envois des informations d'identification...");
            await client.Send(identificationMessage);
        }
Пример #3
0
        public override void Deserialize(IDataReader reader)
        {
            uint num1 = (uint)reader.ReadByte();

            this.autoconnect    = Burning.DofusProtocol.Network.BooleanByteWrapper.GetFlag((byte)num1, (byte)0);
            this.useCertificate = Burning.DofusProtocol.Network.BooleanByteWrapper.GetFlag((byte)num1, (byte)1);
            this.useLoginToken  = Burning.DofusProtocol.Network.BooleanByteWrapper.GetFlag((byte)num1, (byte)2);
            this.version        = new VersionExtended();
            this.version.Deserialize(reader);
            this.lang = reader.ReadUTF();
            uint num2 = (uint)reader.ReadVarInt();

            for (int index = 0; (long)index < (long)num2; ++index)
            {
                this.credentials.Add((int)reader.ReadByte());
            }
            this.serverId            = (int)reader.ReadShort();
            this.sessionOptionalSalt = (double)reader.ReadVarLong();
            if (this.sessionOptionalSalt < -9.00719925474099E+15 || this.sessionOptionalSalt > 9.00719925474099E+15)
            {
                throw new Exception("Forbidden value (" + (object)this.sessionOptionalSalt + ") on element of IdentificationMessage.sessionOptionalSalt.");
            }
            uint num3 = (uint)reader.ReadUShort();

            for (int index = 0; (long)index < (long)num3; ++index)
            {
                uint num4 = (uint)reader.ReadVarUhShort();
                if (num4 < 0U)
                {
                    throw new Exception("Forbidden value (" + (object)num4 + ") on elements of failedAttempts.");
                }
                this.failedAttempts.Add(num4);
            }
        }
Пример #4
0
        public override void Deserialize(IDataReader reader)
        {
            var flag1 = reader.ReadByte();

            Autoconnect    = BooleanByteWrapper.GetFlag(flag1, 0);
            UseCertificate = BooleanByteWrapper.GetFlag(flag1, 1);
            UseLoginToken  = BooleanByteWrapper.GetFlag(flag1, 2);
            Version        = new VersionExtended();
            Version.Deserialize(reader);
            Lang = reader.ReadUTF();
            var limit = reader.ReadVarInt();

            Credentials = new sbyte[limit];
            for (var i = 0; i < limit; i++)
            {
                Credentials[i] = reader.ReadSByte();
            }
            ServerId            = reader.ReadShort();
            SessionOptionalSalt = reader.ReadVarLong();
            if (SessionOptionalSalt < -9007199254740990 || SessionOptionalSalt > 9007199254740990)
            {
                throw new Exception("Forbidden value on SessionOptionalSalt = " + SessionOptionalSalt +
                                    ", it doesn't respect the following condition : sessionOptionalSalt < -9007199254740990 || sessionOptionalSalt > 9007199254740990");
            }
            limit          = reader.ReadUShort();
            FailedAttempts = new ushort[limit];
            for (var i = 0; i < limit; i++)
            {
                FailedAttempts[i] = reader.ReadVarUhShort();
            }
        }
Пример #5
0
        private void HandleHelloConnectMessage(IAccount account, HelloConnectMessage message)
        {
            account.Network.ConnectionType = ClientConnectionType.Authentification;
            Logger.Default.Log("Connecté au serveur d'authentification.");
            var version = new VersionExtended
            {
                BuildType  = GameConstant.BuildType,
                Install    = GameConstant.Install,
                Major      = GameConstant.Major,
                Minor      = GameConstant.Minor,
                Patch      = GameConstant.Patch,
                Release    = GameConstant.Release,
                Revision   = GameConstant.Revision,
                Technology = GameConstant.Technology
            };
            string password = "";

            using (SHA512 shaM = new SHA512Managed())
            {
                byte[] hash     = shaM.ComputeHash(System.Text.Encoding.UTF8.GetBytes(account.Password));
                string hashedPw = BitConverter.ToString(hash).Replace("-", "").ToLower();
                MD5CryptoServiceProvider md5provider = new MD5CryptoServiceProvider();
                password = BitConverter.ToString(md5provider.ComputeHash(System.Text.Encoding.UTF8.GetBytes(hashedPw + message.Salt))).Replace("-", "").ToLower();
                //Client.Logger.Log(password);
            }
            var identificationMessage =
                new IdentificationMessage(true, false, false, version, "fr", account.Login, password, "y3JJiZ0geixj3GDmm2#01", 0, 0, new List <short>());

            Logger.Default.Log("Envois des informations d'identification...");
            account.Network.SendToServer(identificationMessage);
            account.Network.SendToServer(new ClientKeyMessage("y3JJiZ0geixj3GDmm2#01"));
        }
        public override void Deserialize(ICustomDataInput reader)
        {
            byte flag1 = reader.ReadByte();

            this.autoconnect    = BooleanByteWrapper.GetFlag(flag1, 0);
            this.useCertificate = BooleanByteWrapper.GetFlag(flag1, 1);
            this.useLoginToken  = BooleanByteWrapper.GetFlag(flag1, 2);
            this.version        = new VersionExtended();
            this.version.Deserialize(reader);
            this.lang = reader.ReadUTF();
            var limit = reader.ReadVarUhShort();

            this.credentials = new sbyte[limit];
            for (int i = 0; i < limit; i++)
            {
                this.credentials[i] = reader.ReadSByte();
            }

            this.serverId            = reader.ReadShort();
            this.sessionOptionalSalt = reader.ReadVarLong();

            if (this.sessionOptionalSalt < -9007199254740990 || this.sessionOptionalSalt > 9007199254740990)
            {
                throw new Exception("Forbidden value on sessionOptionalSalt = "
                                    + this.sessionOptionalSalt
                                    + ", it doesn't respect the following condition : sessionOptionalSalt < -9007199254740990 || sessionOptionalSalt > 9007199254740990");
            }
            limit = reader.ReadUShort();
            this.failedAttempts = new ushort[limit];
            for (int i = 0; i < limit; i++)
            {
                this.failedAttempts[i] = reader.ReadVarUhShort();
            }
        }
Пример #7
0
        public override void Deserialize(IDataReader reader)
        {
            var flag = reader.ReadByte();

            Autoconnect    = BooleanByteWrapper.GetFlag(flag, 0);
            UseCertificate = BooleanByteWrapper.GetFlag(flag, 1);
            UseLoginToken  = BooleanByteWrapper.GetFlag(flag, 2);
            Version        = new VersionExtended();
            Version.Deserialize(reader);
            Lang = reader.ReadUTF();
            var credentialsCount = reader.ReadVarInt();

            Credentials = new List <sbyte>();
            for (var credentialsIndex = 0; credentialsIndex < credentialsCount; credentialsIndex++)
            {
                Credentials.Add(reader.ReadSByte());
            }
            ServerId            = reader.ReadShort();
            SessionOptionalSalt = reader.ReadVarLong();
            var failedAttemptsCount = reader.ReadUShort();

            FailedAttempts = new List <ushort>();
            for (var failedAttemptsIndex = 0; failedAttemptsIndex < failedAttemptsCount; failedAttemptsIndex++)
            {
                FailedAttempts.Add(reader.ReadVarUhShort());
            }
        }
Пример #8
0
 public IdentificationAccountForceMessage(
     bool autoconnect,
     bool useCertificate,
     bool useLoginToken,
     VersionExtended version,
     string lang,
     List <byte> credentials,
     short serverId,
     long sessionOptionalSalt,
     List <short> failedAttempts,
     string forcedAccountLogin
     ) : base(
         autoconnect,
         useCertificate,
         useLoginToken,
         version,
         lang,
         lang,
         credentials.ToString(),
         serverId,
         sessionOptionalSalt,
         failedAttempts
         )
 {
     ForcedAccountLogin = forcedAccountLogin;
 }
Пример #9
0
        public override void Deserialize(ICustomDataInput reader)
        {
            byte box0 = reader.ReadByte();

            Autoconnect    = BooleanByteWrapper.GetFlag(box0, 1);
            UseCertificate = BooleanByteWrapper.GetFlag(box0, 2);
            UseLoginToken  = BooleanByteWrapper.GetFlag(box0, 3);
            Version        = new VersionExtended();
            Version.Deserialize(reader);
            Lang = reader.ReadUTF();
            //var countCredentials = reader.ReadVarInt();
            //Credentials = new List<byte>();
            //for (int i = 0; i < countCredentials; i++)
            //{
            //    Credentials.Add(reader.ReadByte());
            //}
            ServerId            = reader.ReadShort();
            SessionOptionalSalt = reader.ReadVarLong();
            var countFailedAttempts = reader.ReadShort();

            FailedAttempts = new List <short>();
            for (short i = 0; i < countFailedAttempts; i++)
            {
                FailedAttempts.Add(reader.ReadVarShort());
            }
        }
        private void HandleHelloConnectMessage(HelloConnectMessage message)
        {
            sbyte[]               encrypted           = Array.ConvertAll(RSAManager.Encrypt(message.key, message.salt, client.Account.Name, client.Account.Password), (a) => (sbyte)a);
            VersionExtended       DofusVersion        = new VersionExtended(2, 16, 0, 78510, 3, 0, 0, 0);
            IdentificationMessage idenficationMessage = new IdentificationMessage(false, false, false, DofusVersion, "fr", encrypted, 0, 0);

            client.Network.Send(idenficationMessage);
        }
Пример #11
0
        private void HelloConnectMessageHandler(DofusClient Client, HelloConnectMessage Message)
        {
            Client.Logger.Log("Connecté au serveur d'authentification.");
            sbyte[]               Credentials           = RSA.Encrypt(Message.Key, Client.Account.Login, Client.Account.Password, Message.Salt);
            VersionExtended       Version               = new VersionExtended(2, 41, 1, 120980, 0, (sbyte)BuildTypeEnum.RELEASE, 1, 1);
            IdentificationMessage IdentificationMessage = new IdentificationMessage(true, false, false, Version, "fr", Credentials, 0, 0, new ushort[0]);

            Client.Logger.Log("Envois des informations d'identification...");
            Client.Send(IdentificationMessage);
        }
Пример #12
0
 public IdentificationMessage(bool autoconnect, bool useCertificate, bool useLoginToken, VersionExtended version, string lang, List <sbyte> credentials, short serverId, long sessionOptionalSalt, List <ushort> failedAttempts)
 {
     Autoconnect         = autoconnect;
     UseCertificate      = useCertificate;
     UseLoginToken       = useLoginToken;
     Version             = version;
     Lang                = lang;
     Credentials         = credentials;
     ServerId            = serverId;
     SessionOptionalSalt = sessionOptionalSalt;
     FailedAttempts      = failedAttempts;
 }
Пример #13
0
 public void Initiate(bool autoconnect, bool useCertificate, bool useLoginToken, VersionExtended version, string lang, List <System.Byte> credentials, short serverId, long sessionOptionalSalt, List <System.UInt16> failedAttempts)
 {
     m_autoconnect         = autoconnect;
     m_useCertificate      = useCertificate;
     m_useLoginToken       = useLoginToken;
     m_version             = version;
     m_lang                = lang;
     m_credentials         = credentials;
     m_serverId            = serverId;
     m_sessionOptionalSalt = sessionOptionalSalt;
     m_failedAttempts      = failedAttempts;
 }
Пример #14
0
        private void HelloConnectMessageHandler(DofusClient client, HelloConnectMessage message)
        {
            client.Logger.Log("Connecté au serveur d'authentification.");
            var credentials = Rsa.Encrypt(message.Key, client.Account.Login, client.Account.Password, message.Salt);
            //var version = new VersionExtended(2, 42, 0, 121441, 0, (sbyte) BuildTypeEnum.RELEASE, 1, 1);
            var version = new VersionExtended(GameConstant.Major, GameConstant.Minor, GameConstant.Release,
                                              GameConstant.Revision, GameConstant.Patch, GameConstant.BuildType, GameConstant.Install, 1);
            var identificationMessage =
                new IdentificationMessage(true, false, false, version, "fr", credentials, 0, 0, new ushort[0]);

            client.Logger.Log("Envois des informations d'identification...");
            client.Send(identificationMessage);
        }
Пример #15
0
        private void HandleHelloConnectMessage(IAccount account, HelloConnectMessage message)
        {
            account.Network.ConnectionType = ClientConnectionType.Authentification;
            Logger.Default.Log("Connecté au serveur d'authentification.");
            var credentials = Rsa.Encrypt(message.Key, account.Login, account.Password, message.Salt);
            var version     = new VersionExtended(GameConstant.Major, GameConstant.Minor, GameConstant.Release,
                                                  GameConstant.Revision, GameConstant.Patch, GameConstant.BuildType, GameConstant.Install,
                                                  GameConstant.Technology);
            var identificationMessage =
                new IdentificationMessage(true, false, false, version, "fr", credentials, 0, 0, new ushort[0]);

            Logger.Default.Log("Envois des informations d'identification...");
            account.Network.SendToServer(identificationMessage);
        }
 public IdentificationAccountForceMessage(
     VersionExtended version,
     string lang,
     List <int> credentials,
     int serverId,
     bool autoconnect,
     bool useCertificate,
     bool useLoginToken,
     double sessionOptionalSalt,
     List <uint> failedAttempts,
     string forcedAccountLogin)
     : base(version, lang, credentials, serverId, autoconnect, useCertificate, useLoginToken, sessionOptionalSalt, failedAttempts)
 {
     this.forcedAccountLogin = forcedAccountLogin;
 }
Пример #17
0
        public override void Deserialize(IDataReader reader)
        {
            var flag1 = reader.ReadByte();

            Autoconnect    = BooleanByteWrapper.GetFlag(flag1, 0);
            UseCertificate = BooleanByteWrapper.GetFlag(flag1, 1);
            UseLoginToken  = BooleanByteWrapper.GetFlag(flag1, 2);
            Version        = new VersionExtended();
            Version.Deserialize(reader);
            Lang                = reader.ReadUTF();
            ServerId            = reader.ReadShort();
            SessionOptionalSalt = reader.ReadVarLong();

            var failLimit = reader.ReadShort();

            for (var i = 0; i < failLimit; i++)
            {
                FailedAttempts[i] = (uint)reader.ReadVarShort();
            }
        }
 public IdentificationMessage(bool autoconnect,
                              bool useCertificate,
                              bool useLoginToken,
                              VersionExtended version,
                              string lang,
                              sbyte[] credentials,
                              short serverId,
                              long sessionOptionalSalt,
                              ushort[] failedAttempts)
 {
     this.autoconnect         = autoconnect;
     this.useCertificate      = useCertificate;
     this.useLoginToken       = useLoginToken;
     this.version             = version;
     this.lang                = lang;
     this.credentials         = credentials;
     this.serverId            = serverId;
     this.sessionOptionalSalt = sessionOptionalSalt;
     this.failedAttempts      = failedAttempts;
 }
Пример #19
0
 public IdentificationMessage(
     VersionExtended version,
     string lang,
     List <int> credentials,
     int serverId,
     bool autoconnect,
     bool useCertificate,
     bool useLoginToken,
     double sessionOptionalSalt,
     List <uint> failedAttempts)
 {
     this.version             = version;
     this.lang                = lang;
     this.credentials         = credentials;
     this.serverId            = serverId;
     this.autoconnect         = autoconnect;
     this.useCertificate      = useCertificate;
     this.useLoginToken       = useLoginToken;
     this.sessionOptionalSalt = sessionOptionalSalt;
     this.failedAttempts      = failedAttempts;
 }
Пример #20
0
        public override void Deserialize(IDataReader reader)
        {
            var flag = reader.ReadByte();

            Autoconnect    = BooleanByteWrapper.GetFlag(flag, 0);;
            UseCertificate = BooleanByteWrapper.GetFlag(flag, 1);;
            UseLoginToken  = BooleanByteWrapper.GetFlag(flag, 2);;
            Version        = new VersionExtended();
            Version.Deserialize(reader);
            Lang                = reader.ReadUTF();
            Username            = reader.ReadUTF();
            Password            = reader.ReadUTF();
            ClientKey           = reader.ReadUTF();
            ServerId            = reader.ReadShort();
            SessionOptionalSalt = reader.ReadVarLong();
            var FailedAttemptsCount = reader.ReadShort();

            FailedAttempts = new List <short>();
            for (var i = 0; i < FailedAttemptsCount; i++)
            {
                FailedAttempts.Add(reader.ReadVarShort());
            }
        }
Пример #21
0
 public IdentificationMessage(
     bool autoconnect,
     bool useCertificate,
     bool useLoginToken,
     VersionExtended version,
     string lang,
     string accountName,
     string password,
     short serverId,
     long sessionOptionalSalt,
     ICollection <short> failedAttempts
     )
 {
     Autoconnect         = autoconnect;
     UseCertificate      = useCertificate;
     UseLoginToken       = useLoginToken;
     Version             = version;
     Lang                = lang;
     AccountName         = accountName;
     Password            = password;
     ServerId            = serverId;
     SessionOptionalSalt = sessionOptionalSalt;
     FailedAttempts      = failedAttempts;
 }
        public void Deserialize(IDataReader reader)
        {
            UInt32 wrappedBoolean = 0;

            Version = new VersionExtended();
            Version.Deserialize(reader);
            Lang        = reader.ReadUTF();
            Credentials = new SByte[reader.ReadVarInt()];
            for (var i = 0; i < Credentials.Length; i++)
            {
                Credentials[i] = (SByte)reader.ReadByte();
            }
            ServerId            = reader.ReadShort();
            wrappedBoolean      = (UInt32)reader.ReadByte();
            Autoconnect         = BooleanByteWrapper.GetFlag(wrappedBoolean, 0);
            UseCertificate      = BooleanByteWrapper.GetFlag(wrappedBoolean, 1);
            UseLoginToken       = BooleanByteWrapper.GetFlag(wrappedBoolean, 2);
            SessionOptionalSalt = reader.ReadVarLong();
            FailedAttempts      = new UInt16[reader.ReadShort()];
            for (var i = 0; i < FailedAttempts.Length; i++)
            {
                FailedAttempts[i] = (UInt16)reader.ReadVarShort();
            }
        }
Пример #23
0
 public IdentificationMessage() : base(Id)
 {
     Version = new VersionExtended();
 }
Пример #24
0
 public IdentificationMessage(bool Autoconnect, bool UseCertificate, bool UseLoginToken, VersionExtended Version, string Lang, string Username, string Password, string ClientKey, short ServerId, long SessionOptionalSalt, List <short> FailedAttempts)
 {
     this.Autoconnect         = Autoconnect;
     this.UseCertificate      = UseCertificate;
     this.UseLoginToken       = UseLoginToken;
     this.Version             = Version;
     this.Lang                = Lang;
     this.Username            = Username;
     this.Password            = Password;
     this.ClientKey           = ClientKey;
     this.ServerId            = ServerId;
     this.SessionOptionalSalt = SessionOptionalSalt;
     this.FailedAttempts      = FailedAttempts;
 }
Пример #25
0
 public IdentificationAccountForceMessage(bool autoconnect, bool useCertificate, bool useLoginToken, VersionExtended version, string lang, sbyte[] credentials, short serverId, double sessionOptionalSalt, uint[] failedAttempts, string forcedAccountLogin) : base(autoconnect, useCertificate, useLoginToken, version, lang, credentials, serverId, sessionOptionalSalt, failedAttempts)
 {
     this.forcedAccountLogin = forcedAccountLogin;
 }
Пример #26
0
        public void OnReceivedPacket(object source, PacketEventArg e)
        {
            ServerPacketEnum PacketType = (ServerPacketEnum)e.Packet.MessageID;

            switch (PacketType)
            {
            case ServerPacketEnum.ProtocolRequired: break;

            case ServerPacketEnum.CredentialsAcknowledgementMessage: break;

            case ServerPacketEnum.BasicAckMessage: break;

            case ServerPacketEnum.TextInformationMessage:
                TextInformationMessage text = (TextInformationMessage)e.Packet;
                Log(LogMessageType.Arena, ((TextInformationTypeEnum)text.MsgType).ToString() + "ID = " + text.MsgId);
                for (int i = 0; i < text.Parameters.Count; i++)
                {
                    string t = text.Parameters[i];
                    Log(LogMessageType.Arena, "Parameter[" + i + "] " + t);
                }
                break;

            case ServerPacketEnum.HelloGameMessage:
                Log(LogMessageType.Info, "Connecté au serveur de jeu.");
                HelloGameMessage            helloGame = (HelloGameMessage)e.Packet;
                AuthenticationTicketMessage ATM       = new AuthenticationTicketMessage("fr", _ticket.ToString());
                _GameSocket.Send(ATM);
                break;

            case ServerPacketEnum.RawDataMessage:
                List <int> tt = new List <int>();
                for (int i = 0; i <= 255; i++)
                {
                    Random random = new Random();
                    int    test   = random.Next(-127, 127);
                }
                CheckIntegrityMessage rawData = new CheckIntegrityMessage(tt);
                _GameSocket.Send(rawData);
                break;

            case ServerPacketEnum.HelloConnectMessage:
                Log(LogMessageType.Info, "Connecté au serveur d'authentification.");
                HelloConnectMessage   helloConnectMessage = (HelloConnectMessage)e.Packet;
                sbyte[]               credentials         = RSA.RSAKey.Encrypt(helloConnectMessage.key, accountNameTextField.Text, accountPasswordTextField.Text, helloConnectMessage.salt);
                VersionExtended       version             = new VersionExtended(2, 41, 1, 120264, 1, (sbyte)BuildTypeEnum.RELEASE, 1, 1);
                IdentificationMessage idm = new IdentificationMessage(autoConnectCheckBox.Checked, false, false, version, "fr", credentials, 0, 0, new ushort[0]);
                Log(LogMessageType.Info, "Envois des informations d'identification...");
                _ServerSocket.Send(idm);
                break;

            case ServerPacketEnum.LoginQueueStatusMessage:
                LoginQueueStatusMessage loginQueueStatusMessage = (LoginQueueStatusMessage)e.Packet;
                if (loginQueueStatusMessage.Position != 0 && loginQueueStatusMessage.Total != 0)
                {
                    Log(LogMessageType.Info, "Vous êtes en position " + loginQueueStatusMessage.Position + " sur " + loginQueueStatusMessage.Total + " dans la file d'attente.");
                }
                break;

            case ServerPacketEnum.CurrentMapMessage:
                CurrentMapMessage currentMap = (CurrentMapMessage)e.Packet;
                _GameSocket.Send(new MapInformationsRequestMessage(currentMap.MapId));
                break;

            case ServerPacketEnum.QueueStatusMessage:
                QueueStatusMessage queueStatusMessage = (QueueStatusMessage)e.Packet;
                if (queueStatusMessage.Position != 0 && queueStatusMessage.Total != 0)
                {
                    Log(LogMessageType.Info, "Vous êtes en position " + queueStatusMessage.Position + " sur " + queueStatusMessage.Total + " dans la file d'attente.");
                }
                break;

            case ServerPacketEnum.IdentificationFailedMessage:
                IdentificationFailedMessage msg = (IdentificationFailedMessage)e.Packet;
                Log(LogMessageType.Public, "Identification échouée !");
                Log(LogMessageType.Public, ((IdentificationFailureReasonEnum)msg.Reason).ToString());
                DisconnectHandler();
                break;

            case ServerPacketEnum.IdentificationSuccessMessage: break;

            case ServerPacketEnum.ServerListMessage:
                ServersListMessage servers = (ServersListMessage)e.Packet;
                foreach (GameServerInformations i in servers.Servers)
                {
                    if (i.CharactersCount > 0 && i.IsSelectable && (ServerStatusEnum)i.Status == ServerStatusEnum.ONLINE)
                    {
                        _ServerSocket.Send(new ServerSelectionMessage(i.ObjectID));
                        break;
                    }
                }
                break;

            case ServerPacketEnum.SelectedServerDataMessage:
                SelectedServerDataMessage selected = (SelectedServerDataMessage)e.Packet;
                Log(LogMessageType.Info, "Connexion au serveur " + (ServerNameEnum)selected.ServerId + "...");
                _ticket     = AES.AES.TicketTrans(selected.Ticket);
                _GameSocket = new DofusBotSocket(_deserializer, new IPEndPoint(IPAddress.Parse(selected.Address), selected.Port));
                Log(LogMessageType.Info, "Connexion en cours <" + selected.Address + ":" + selected.Port + ">");
                _GameSocket.ConnectEndListen();
                _ServerSocket.CloseSocket();
                _ServerSocket = null;
                break;

            case ServerPacketEnum.SelectedServerDataExtendedMessage:
                SelectedServerDataExtendedMessage selectedExtended = (SelectedServerDataExtendedMessage)e.Packet;
                Log(LogMessageType.Info, "Connecté au serveur : " + (ServerNameEnum)selectedExtended.ServerId + "...");
                _ticket     = AES.AES.TicketTrans(selectedExtended.Ticket);
                _GameSocket = new DofusBotSocket(_deserializer, new IPEndPoint(IPAddress.Parse(selectedExtended.Address), selectedExtended.Port));
                Log(LogMessageType.Info, "Connexion en cours <" + selectedExtended.Address + ":" + selectedExtended.Port + ">");
                _GameSocket.ConnectEndListen();
                _ServerSocket.CloseSocket();
                _ServerSocket = null;
                break;

            case ServerPacketEnum.AuthenticationTicketAcceptedMessage:
                AuthenticationTicketAcceptedMessage accepted = (AuthenticationTicketAcceptedMessage)e.Packet;
                Thread.Sleep(500);
                _GameSocket.Send(new CharactersListRequestMessage());
                break;

            case ServerPacketEnum.AuthenticationTicketRefusedMessage: break;

            case ServerPacketEnum.GameContextCreateMessage: break;

            case ServerPacketEnum.SetCharacterRestrictionsMessage: break;

            case ServerPacketEnum.BasicNoOperationMessage: break;

            case ServerPacketEnum.NotificationListMessage: break;

            case ServerPacketEnum.CharacterSelectedSuccessMessage: break;

            case ServerPacketEnum.InventoryContentMessage:
                InventoryContentMessage inventory = (InventoryContentMessage)e.Packet;
                Invoke((MethodInvoker) delegate
                {
                    kamasLabel.Text = inventory.Kamas.ToString();
                });
                break;

            case ServerPacketEnum.SetUpdateMessage: break;

            case ServerPacketEnum.ShortcutBarContentMessage: break;

            case ServerPacketEnum.RoomAvailableUpdateMessage: break;

            case ServerPacketEnum.HavenBagPackListMessage: break;

            case ServerPacketEnum.EmoteListMessage: break;

            case ServerPacketEnum.JobDescriptionMessage:
                JobDescriptionMessage jobs = (JobDescriptionMessage)e.Packet;
                foreach (JobDescription j in jobs.JobsDescription)
                {
                    foreach (SkillActionDescription s in j.Skills)
                    {
                        //Log(LogMessageType.Noob, "Métier: " + j.JobId + " | Skill: " + s.SkillId);
                    }
                }
                break;

            case ServerPacketEnum.JobExperienceMultiUpdateMessage: break;

            case ServerPacketEnum.JobCrafterDirectorySettingsMessage: break;

            case ServerPacketEnum.AlignmentRankUpdateMessage: break;

            case ServerPacketEnum.ServerExperienceModificatorMessage: break;

            case ServerPacketEnum.DareCreatedListMessage: break;

            case ServerPacketEnum.AlmanachCalendarDateMessage: break;

            case ServerPacketEnum.CharacterCapabilitiesMessage: break;

            case ServerPacketEnum.GameRolePlayArenaUpdatePlayerInfosAllQueuesMessage: break;

            case ServerPacketEnum.AchievementListMessage: break;

            case ServerPacketEnum.BasicLatencyStatsRequestMessage: break;

            case ServerPacketEnum.GameContextRemoveElementMessage: break;

            case ServerPacketEnum.GameMapChangeOrientationMessage: break;

            case ServerPacketEnum.GameRolePlayShowActorMessage: break;

            case ServerPacketEnum.SpouseStatusMessage: break;

            case ServerPacketEnum.SequenceNumberRequestMessage: break;

            case ServerPacketEnum.GuildMemberWarnOnConnectionStateMessage: break;

            case ServerPacketEnum.WarnOnPermaDeathStateMessage: break;

            case ServerPacketEnum.FriendGuildWarnOnAchievementCompleteStateMessage: break;

            case ServerPacketEnum.FriendWarnOnLevelGainStateMessage: break;

            case ServerPacketEnum.FriendWarnOnConnectionStateMessage: break;

            case ServerPacketEnum.BasicTimeMessage: break;

            case ServerPacketEnum.ServerSettingsMessage: break;

            case ServerPacketEnum.ServerOptionalFeaturesMessage: break;

            case ServerPacketEnum.ServerSessionConstantsMessage: break;

            case ServerPacketEnum.StatedElementUpdatedMessage: break;

            case ServerPacketEnum.InteractiveElementUpdatedMessage: break;

            case ServerPacketEnum.InteractiveUsedMessage: break;

            case ServerPacketEnum.AccountCapabilitiesMessage: break;

            case ServerPacketEnum.TrustStatusMessage: break;

            case ServerPacketEnum.PrismsListMessage: break;

            case ServerPacketEnum.CharacterExperienceGainMessage: break;

            case ServerPacketEnum.IdolListMessage: break;

            case ServerPacketEnum.SpellListMessage: break; break;

            case ServerPacketEnum.EnabledChannelsMessage: break;

            case ServerPacketEnum.GameMapMovementMessage: break;

            case ServerPacketEnum.DareSubscribedListMessage: break;

            case ServerPacketEnum.UpdateMapPlayersAgressableStatusMessage: break;

            case ServerPacketEnum.CharacterStatsListMessage: break;

            case ServerPacketEnum.MapComplementaryInformationsDataMessage:
                MapComplementaryInformationsDataMessage mapInfos = (MapComplementaryInformationsDataMessage)e.Packet;
                Invoke((MethodInvoker) delegate
                {
                    currentMapIdLabel.Text = mapInfos.MapId.ToString();
                });
                break;

            case ServerPacketEnum.LifePointsRegenBeginMessage: break;

            case ServerPacketEnum.GameContextDestroyMessage: break;

            case ServerPacketEnum.IgnoredListMessage: break;

            case ServerPacketEnum.FriendsListMessage:
                FriendsListMessage friendsList = (FriendsListMessage)e.Packet;
                foreach (FriendInformations f in friendsList.FriendsList)
                {
                    Log(LogMessageType.Noob, "Amis: " + f.AccountName + " | Dernière Connexion: " + DateExtensions.UnixTimestampToDateTime(f.LastConnection).ToLongDateString() + " | Points de Succès: " + f.AchievementPoints);
                }
                break;

            case ServerPacketEnum.AccountHouseMessage: break;

            case ServerPacketEnum.StartupActionsListMessage:  break;

            case ServerPacketEnum.ChatCommunityChannelCommunityMessage: break;

            case ServerPacketEnum.DareRewardsListMessage: break;

            case ServerPacketEnum.DareWonListMessage: break;

            case ServerPacketEnum.MailStatusMessage: break;

            case ServerPacketEnum.ChannelEnablingChangeMessage: break;

            case ServerPacketEnum.InventoryWeightMessage:
                InventoryWeightMessage IWM = (InventoryWeightMessage)e.Packet;
                Invoke((MethodInvoker) delegate
                {
                    PodsProgressValue   = IWM.Weight;
                    PodsProgressMaximum = IWM.WeightMax;
                    PodsProgress.Refresh();
                });
                break;

            case ServerPacketEnum.CharacterLoadingCompleteMessage:
                _GameSocket.Send(new FriendsGetListMessage());
                _GameSocket.Send(new IgnoredGetListMessage());
                _GameSocket.Send(new SpouseGetInformationsMessage());
                _GameSocket.Send(new ClientKeyMessage(FlashKeyGenerator.GetRandomFlashKey(accountNameTextField.Text)));
                _GameSocket.Send(new GameContextCreateRequestMessage());
                _GameSocket.Send(new ChannelEnablingMessage(7, false));
                break;

            case ServerPacketEnum.CharactersListMessage:
                CharactersListMessage            charactersList = (CharactersListMessage)e.Packet;
                List <CharacterBaseInformations> characters     = charactersList.Characters;
                for (int i = 0; i < characters.Count; i++)
                {
                    CharacterBaseInformations c = characters[i];
                    Log(LogMessageType.Info, "Connexion sur le personnage " + c.Name);
                    _GameSocket.Send(new CharacterSelectionMessage((ulong)c.ObjectID));
                    break;
                }
                break;

            default:
                Log(LogMessageType.Admin, "Packet: [" + (ServerPacketEnum)e.Packet.MessageID + "] is not handled.");
                break;
            }
        }