using System.Collections.Concurrent; using GameServer; using ServerCommon; using ServerCore; using ServerBase; namespace GameServer; public class QuestRentalVisit : QuestBase { private string m_pair_guid { get; set; } = string.Empty; private RentalInstanceVisitAttribute m_attribute_nullable { get; } public QuestRentalVisit(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string myhomeGuid, string ownerGuid, RentalInstanceVisitAttribute attribute) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty) { m_pair_guid = myhomeGuid + ":" + ownerGuid; m_attribute_nullable = attribute; } public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events) { if (true == m_attribute_nullable.m_rental_instance_visit.ContainsKey(m_pair_guid)) return false; var now = DateTimeHelper.Current; m_attribute_nullable.m_rental_instance_visit.AddOrUpdate(m_pair_guid, now, (key, old) => now); m_attribute_nullable.modifiedEntityAttribute(true); return true; } public override async Task postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler) { return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler); } }