private bool CheckBlockedUser()
 {
     try
     {
         string line   = null;
         var    source = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["BlackList"]);
         using (StreamReader sr = new StreamReader(source))
         {
             line = sr.ReadToEnd();
         }
         if (line.Contains(";" + AccountSession.AccountID + ";"))
         {
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         NLogLogger.PublishException(ex);
         return(false);
     }
 }
Ejemplo n.º 2
0
        public long GetAccouuntId(string connectionId)
        {
            const long accountId = 0;

            try
            {
                if (string.IsNullOrEmpty(connectionId))
                {
                    return(accountId);
                }
                var lst    = _mapHubAccount.ToList();
                var player = lst.FindAll(c => c.Key == connectionId);
                if (player.Count <= 0)
                {
                    return(accountId);
                }
                return(player.FirstOrDefault().Value);
            }
            catch (Exception exception)
            {
                NLogLogger.PublishException(exception);
            }
            return(accountId);
        }