public bool ResetDailyQuestInfo() { if (!GameUtils.NeedRefresh(m_DailyQuestInfo.LastRefreshTime, GameConsts.DailyQuest.RefreshTime)) { return(false); } PlayerLogic player = new PlayerLogic(); player.SetUser(m_UserId); var initialDailyQuests = CacheSet.DailyQuestTable.GetAllData(dq => dq.PrePlayerLevel <= player.MyPlayer.Level); m_DailyQuestInfo.TrackingDailyQuests.Clear(); m_DailyQuestInfo.CompletedDailyQuests.Clear(); foreach (var quest in initialDailyQuests) { TrackingDailyQuest tdq = new TrackingDailyQuest() { Id = quest.Id, Type = quest.QuestType, Progress = 0, RequiredProgress = quest.TargetProgressCount, }; tdq.Params.AddRange(quest.Params); m_DailyQuestInfo.TrackingDailyQuests.Add(quest.Id, tdq); } m_DailyQuestInfo.LastRefreshTime = DateTime.UtcNow.Ticks; return(true); }
private void UpdateCommonQuest(TrackingDailyQuest beingUpdatedQuest, object[] param) { beingUpdatedQuest.Progress += (int)param[0]; PushProgressModified(new List <TrackingDailyQuest>() { beingUpdatedQuest }); }