protected override void ScheduleDo(SchedulerTimer timer) { var todayRecord = GlobalVarRecord.Get("TodayShopInfo"); if (!string.IsNullOrEmpty(todayRecord.Value)) { return; } var records = GetHours(3).Select(hour => { var isHalfHour = Rander.RandBool(); var dateTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, isHalfHour ? 30 : 0, 0); var goods = ArmerSvc.GetRandArmers(5).Select(p => p.Name); return(new ShopTimeRecord() { OpenTime = dateTime, SellingGoods = goods.ToArray() }); }).ToList(); todayRecord.Value = JsonConvert.SerializeObject(records); todayRecord.ExpiryTime = CommonUtil.UntilTommorow(); todayRecord.Update(); RandShopperSvc.Refresh(); }
private void JudgeFirst() { if (Rander.RandBool()) { return; } SwitchPet(); }
private TarotCacheModel GetRandTarotFortune() { return(new TarotCacheModel() { CardName = ModelList.RandElement().Name, IsPos = Rander.RandBool(), SerialName = TarotSerialNames.RandElement() }); }