/// <summary>
        ///
        /// </summary>
        /// <param name="client"></param>
        /// <param name="message"></param>
        //private void HandleKey(AuthClient client, string message)
        //{
        //    client.FrameManager.RemoveFrame(AuthentificationFrame.Instance);
        //    client.FrameManager.AddFrame(WorldSelectionFrame.Instance);
        //    client.Cypher = true;
        //}

        /// <summary>
        ///
        /// </summary>
        /// <param name="client"></param>
        /// <param name="message"></param>
        private void HandleAuthentification(AuthClient client, string message)
        {
            var credentials = message.Split('#');

            if (credentials.Length != 2)
            {
                client.Send(AuthMessage.AUTH_FAILED_CREDENTIALS());
                return;
            }

            var account  = credentials[0];
            var password = credentials[1].Substring(1);

            AuthService.Instance.AddMessage(() => ProcessAuthentification(client, account, password));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="client"></param>
        /// <param name="accountName"></param>
        /// <param name="password"></param>
        private void ProcessAuthentification(AuthClient client, string accountName, string password)
        {
            client.FrameManager.RemoveFrame(AuthentificationFrame.Instance);

            var account = AccountRepository.Instance.GetByName(accountName);

            if (account == null || Util.CryptPassword(client.AuthKey, account.Password) != password)
            {
                client.Send(AuthMessage.AUTH_FAILED_CREDENTIALS());
                return;
            }

            if (account.Banned)
            {
                client.Send(AuthMessage.AUTH_FAILED_BANNED());
                return;
            }

            if (AuthService.Instance.IsConnected(account.Id))
            {
                client.Send(AuthMessage.AUTH_FAILED_ALREADY_CONNECTED());
                return;
            }

            AuthService.Instance.AddMessage(() =>
            {
                client.Account = account;

                AuthService.Instance.ClientAuthentified(client);

                client.Send(AuthMessage.ACCOUNT_PSEUDO(account.Pseudo));
                client.Send(AuthMessage.UNKNOW_AC0());

                AuthService.Instance.SendWorldList(client);

                client.Send(AuthMessage.ACCOUNT_RIGHT(client.Account.Power));
                client.Send(AuthMessage.ACCOUNT_SECRET_ANSWER());

                client.FrameManager.AddFrame(WorldSelectionFrame.Instance);
            });
        }