Ejemplo n.º 1
0
        /// <summary>
        /// 获取游戏倍率
        /// </summary>
        /// <param name="eType">倍率类型</param>
        /// <returns></returns>
        public static float GetRate(eRateType eType)
        {
            float rate = 1;
            m_lock.AcquireReaderLock(Timeout.Infinite);
            try
            {
                RateInfo _RateInfo = GetRateInfoWithType((int)eType);
                if (_RateInfo == null)
                {
                    return rate;
                }
                if (_RateInfo.Rate == 0)
                {
                    return 1;
                }

                if (IsValid(_RateInfo))
                {
                    rate = _RateInfo.Rate;
                }
            }
            catch { }
            finally
            {
                m_lock.ReleaseReaderLock();
            }

            return rate;
        }
Ejemplo n.º 2
0
        public static float GetRate(eRateType eType)
        {
            float rate = 1f;

            RateMgr.m_lock.AcquireReaderLock(-1);
            float result;

            try
            {
                RateInfo _RateInfo = RateMgr.GetRateInfoWithType((int)eType);
                if (_RateInfo == null)
                {
                    result = rate;
                    return(result);
                }
                if (_RateInfo.Rate == 0f)
                {
                    result = 1f;
                    return(result);
                }
                if (RateMgr.IsValid(_RateInfo))
                {
                    rate = _RateInfo.Rate;
                }
            }
            catch
            {
            }
            finally
            {
                RateMgr.m_lock.ReleaseReaderLock();
            }
            result = rate;
            return(result);
        }
Ejemplo n.º 3
0
        public static float GetRate(eRateType eType)
        {
            float num = 1f;

            RateMgr.m_lock.AcquireReaderLock(15000);
            try
            {
                RateInfo rateInfoWithType = RateMgr.GetRateInfoWithType((int)eType);
                if (rateInfoWithType == null)
                {
                    float result = num;
                    return(result);
                }
                if (rateInfoWithType.Rate == 0f)
                {
                    float result = 1f;
                    return(result);
                }
                if (RateMgr.IsValid(rateInfoWithType))
                {
                    num = rateInfoWithType.Rate;
                }
            }
            catch
            {
            }
            finally
            {
                RateMgr.m_lock.ReleaseReaderLock();
            }
            return(num);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取游戏倍率
        /// </summary>
        /// <param name="eType">倍率类型</param>
        /// <returns></returns>
        public static float GetRate(eRateType eType)
        {
            float rate = 1;

            m_lock.AcquireReaderLock(Timeout.Infinite);
            try
            {
                RateInfo _RateInfo = GetRateInfoWithType((int)eType);
                if (_RateInfo == null)
                {
                    return(rate);
                }
                if (_RateInfo.Rate == 0)
                {
                    return(1);
                }

                if (IsValid(_RateInfo))
                {
                    rate = _RateInfo.Rate;
                }
            }
            catch { }
            finally
            {
                m_lock.ReleaseReaderLock();
            }

            return(rate);
        }
Ejemplo n.º 5
0
 public RateType(string s)
 {
     try
     {
         _ratetype = (eRateType)Enum.Parse(typeof(eRateType), s, true);
     }
     catch
     {
         _ratetype = eRateType.None;
     }
 }
Ejemplo n.º 6
0
        public static float GetRate(GamePlayer player, eRateType eType)
        {
            float result;

            if (eType == eRateType.Auncher_Experience_Rate || eType == eRateType.Auncher_Offer_Rate || eType == eRateType.Auncher_Riches_Rate)
            {
                if (player.ClientType != eClientType.Auncher)
                {
                    result = 1f;
                    return(result);
                }
            }
            result = RateMgr.GetRate(eType);
            return(result);
        }
Ejemplo n.º 7
0
 public RateType(eRateType r)
 {
     _ratetype = r;
 }
Ejemplo n.º 8
0
 public RateType()
 {
     _ratetype = eRateType.None;
 }