コード例 #1
0
 public int GetIndulgeMinutes(string account, Guid managerId, string siteId = "")
 {
     try
     {
         if (!CheckOpenIndulge(siteId))
         {
             return(-1);
         }
         if (string.IsNullOrEmpty(siteId) && _onlineClient != null)
         {
             return(_onlineClient.GetIndulgeMinutes(account, managerId));
         }
         else
         {
             var userreg = NbUserregMgr.GetById(account, siteId);
             if (userreg != null)
             {
                 var adultTime = DateTime.Now.AddYears(-18);
                 if (userreg.Birthday <= adultTime)
                 {
                     return(-1);
                 }
             }
             var online = GetOnlineMinutes(managerId, siteId);
             if (userreg != null && userreg.RecordDate == DateTime.Today && userreg.LastOnlineMinutes > 0)
             {
                 online -= userreg.LastOnlineMinutes;
             }
             if (online < 0)
             {
                 online = 0;
             }
             return(online);
         }
     }
     catch (Exception ex)
     {
         SystemlogMgr.Error("Onlinecore GetIndulgeMinutes", ex);
         return(-1);
     }
 }