/// <summary> /// 保存到数据库中 /// </summary> public void SaveToDatabase() { lock (_lock) { using (PlayerBussiness pb = new PlayerBussiness()) { foreach (QuestDataInfo info in _currentQuest.Values) { if (info.IsDirty) { pb.UpdateDbQuestDataInfo(info); } } } } }
/// <summary> /// 保存到数据库中 [操作:更新到数据库中全部有效任务记录与过期任务记录] /// </summary> public void SaveToDatabase() { lock (m_lock) { using (PlayerBussiness pb = new PlayerBussiness()) { foreach (BaseQuest q in m_list) { q.SaveData(); if (q.Data.IsDirty) { pb.UpdateDbQuestDataInfo(q.Data); } } foreach (BaseQuest q in m_clearList) { q.SaveData(); pb.UpdateDbQuestDataInfo(q.Data); } m_clearList.Clear(); } } }