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"); }
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); }
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); }
private void OnLevelChange(LevelRewardsStatus status) { m_max = BalanceResourceUtil.GetUserVigorMax(); }