private void CheckAccount(string packet)
        {
            string[] data     = packet.Split('#');
            string   username = data[0];
            string   password = data[1].Substring(1);

            Database.Records.AccountRecord account = Database.Records.AccountRecord.FindByUsername(username);
            if (account != null)
            {
                if (Utilities.Security.Hash.cryptPass(_client.EncrypKey, account.Password) == password)
                {
                    _client.Account = account;

                    if (Communication.World.Manager.WorldCommunicator.IsConnected(account.Username))
                    {
                        Communication.World.Manager.WorldCommunicator.SendKickPlayer(account.Username);
                    }

                    if (!AuthentificationQueue.AddClient(_client))
                    {
                        SendAccountInformation();
                        _client.State = AuthentificationState.OnServerList;
                    }
                    else
                    {
                        _client.State = AuthentificationState.InQueue;
                    }
                }
                else
                {
                    _client.Send("AlEx");
                }
            }
            else
            {
                _client.Send("AlEx");
            }
        }
 private static void RefreshQueue(object sender, ElapsedEventArgs e)
 {
     lock (WaitingClients)
     {
         if (WaitingClients.Count <= 0)
         {
             return;
         }
         for (int i = 0; i <= WaitingClients.Count - 1; i++)
         {
             AuthentificationClient client = WaitingClients[i];
             if (CanAcceptPlayer() > 0)
             {
                 WaitingClients.Remove(client);
                 client.State = AuthentificationState.OnServerList;
                 client.Handler.SendAccountInformation();
             }
             else
             {
                 client.Send("Af" + (i + 1) + "|" + WaitingClients.Count + "|0|0");
             }
         }
     }
 }