private void UpdateDays(bool init = false) { var t = TimeManager.LocalUrmobiServerDT; if (t >= NextDate.AddDays(1d)) { CurrentDailyDay = 0; NextDailyDay = 1; //SetupCurrentRewards(); NextDate = new System.DateTime(t.Year, t.Month, t.Day, 0, 0, 0).AddDays(1); UserDataControl.Instance.UserData.RewardsData.nextDate = NextDate.ToString(); } else if (t >= NextDate && t < NextDate.AddDays(1)) { CurrentDailyDay = NextDailyDay; NextDailyDay = NextDailyDay < daysCycle - 1 ? (byte)(CurrentDailyDay + 1) : (byte)0; //SetupCurrentRewards(); NextDate = new System.DateTime(t.Year, t.Month, t.Day, 0, 0, 0).AddDays(1); UserDataControl.Instance.UserData.RewardsData.currentDailyDay = CurrentDailyDay; UserDataControl.Instance.UserData.RewardsData.nextDate = NextDate.ToString(); EventManager.Notify(this, new GameEventArgs(Events.Daily.NEX_DAY)); } else if (t >= NextDate) { //SetupCurrentRewards(); } if (init) { Inited?.Invoke(); } }
public void Init() { if (!this._isInited) { lock (this._locker) { if (!this._isInited) { BootLog.Log("SystemRoo.PrivateInit start"); this.PackageDownloader = new PackageDownloader(this); this.SysDicSet = new SysDicSet(this); this.SysDicItemSet = new SysDicItemSet(this); this.CoinSet = new CoinSet(this); this.GroupSet = new GroupSet(this); this.CoinGroupSet = new CoinGroupSet(this); this.CalcConfigSet = new CalcConfigSet(this); this.WalletSet = new WalletSet(this); this.PoolSet = new PoolSet(this); this.CoinKernelSet = new CoinKernelSet(this); this.KernelSet = new KernelSet(this); this.KernelProfileSet = new KernelProfileSet(this); this.KernelOutputFilterSet = new KernelOutputFilterSet(this); this.KernelOutputTranslaterSet = new KernelOutputTranslaterSet(this); this.GpusSpeed = new GpusSpeed(this); this.CoinShareSet = new CoinShareSet(this); this.MineWorkSet = new MineWorkSet(this); this.MinerGroupSet = new MinerGroupSet(this); this._minerProfile = new MinerProfile(this); this.CoinProfileSet = new CoinProfileSet(this); this.CoinKernelProfileSet = new CoinKernelProfileSet(this); Inited?.Invoke(); BootLog.Log("SystemRoo.PrivateInit end"); this._isInited = true; } } } }