示例#1
0
        public string GetVigorRecoverAllCountDown()
        {
            int current_value;

            if (DataLookupsCache.Instance.SearchIntByID(m_dataPath, out current_value))
            {
                int residueVigor = BalanceResourceUtil.GetUserVigorMax() - current_value - 1;

                if (residueVigor <= 0)
                {
                    return(string.Empty);
                }

                int totalSeconds = residueVigor * m_delta;

                System.TimeSpan ts = EB.Time.FromPosixTime(m_nextRequestTime) - EB.Time.FromPosixTime(EB.Time.Now);  //减去7点半
                ts += System.TimeSpan.FromSeconds(totalSeconds);
                int hours   = ts.Hours + ts.Days * 24;
                int minutes = ts.Minutes;
                int seconds = ts.Seconds;

                string timeS = string.Format("{0:00}:{1:00}:{2:00}", hours, minutes, seconds);
                return(timeS);
            }
            return("00:00:00");
        }
示例#2
0
        void AddVigorRefresh()
        {
            RemoveDeltaRefresher <VigorDeltaTimeRefresher>();
            var ht = Johny.HashtablePool.Claim();

            ht.Add("data_path", "res.vigor.v");
            ht.Add("time_path", "res.vigor.nextGrowthTime");
            ht.Add("min", 0);
            ht.Add("max", BalanceResourceUtil.GetUserVigorMax());
            ht.Add("delta", VigorDeltaTimeRefresher.GetVigorFreshDeltaTime());
            ht.Add("offset", 1);
            AddDeltaRefresher <VigorDeltaTimeRefresher>(ht);
        }
示例#3
0
        public string GetVigorRecoverOneCountDown()
        {
            int current_value;

            DataLookupsCache.Instance.SearchIntByID(m_dataPath, out current_value);
            if (current_value >= BalanceResourceUtil.GetUserVigorMax())
            {
                return(EB.Localizer.GetString("ID_HAVE_RECOVER_FULL"));
            }

            System.TimeSpan ts      = EB.Time.FromPosixTime(m_nextRequestTime) - EB.Time.FromPosixTime(EB.Time.Now); //减去7点半
            int             hours   = ts.Hours;
            int             minutes = ts.Minutes;
            int             seconds = ts.Seconds;
            string          timeS   = string.Format("{0:00}:{1:00}:{2:00}", hours, minutes, seconds);

            return(timeS);
        }
示例#4
0
 private void OnLevelChange(LevelRewardsStatus status)
 {
     m_max = BalanceResourceUtil.GetUserVigorMax();
 }