public void LoadFromDatabase(int playerId) { object @lock; Monitor.Enter(@lock = this.m_lock); try { this.m_states = ((this.m_player.PlayerCharacter.QuestSite.Count <byte>() == 0) ? this.InitQuest() : this.m_player.PlayerCharacter.QuestSite); using (PlayerBussiness db = new PlayerBussiness()) { QuestDataInfo[] datas = db.GetUserQuest(playerId); this.BeginChanges(); QuestDataInfo[] array = datas; for (int i = 0; i < array.Length; i++) { QuestDataInfo dt = array[i]; QuestInfo info = QuestMgr.GetSingleQuest(dt.QuestID); if (info != null && this.CheckQuest(info)) { this.AddQuest(new BaseQuest(info, dt)); } } this.CommitChanges(); } } finally { Monitor.Exit(@lock); } }
public void LoadFromDatabase(int playerId) { object @lock; Monitor.Enter(@lock = this.m_lock); try { this.m_states = ((this.m_player.PlayerCharacter.QuestSite.Count <byte>() == 0) ? this.InitQuest() : this.m_player.PlayerCharacter.QuestSite); using (PlayerBussiness playerBussiness = new PlayerBussiness()) { QuestDataInfo[] userQuest = playerBussiness.GetUserQuest(playerId); this.BeginChanges(); QuestDataInfo[] array = userQuest; for (int i = 0; i < array.Length; i++) { QuestDataInfo questDataInfo = array[i]; QuestInfo singleQuest = QuestMgr.GetSingleQuest(questDataInfo.QuestID); if (singleQuest != null) { this.AddQuest(new BaseQuest(singleQuest, questDataInfo)); } this.AddQuestData(questDataInfo); } this.CommitChanges(); } List <BaseQuest> arg_B0_0 = this.m_list; } finally { Monitor.Exit(@lock); } }
public int HandlePacket(GameClient client, GSPacketIn packet) { int num = packet.ReadInt(); for (int i = 0; i < num; i++) { int id = packet.ReadInt(); QuestInfo singleQuest = QuestMgr.GetSingleQuest(id); string text; client.Player.QuestInventory.AddQuest(singleQuest, out text); } return(0); }
public override int HandlePacket(GamePlayer player, GSPacketIn packet) { int count = packet.ReadInt(); for (int i = 0; i < count; i++) { int id = packet.ReadInt(); QuestInfo info = QuestMgr.GetSingleQuest(id); string msg; player.QuestInventory.AddQuest(info, out msg); } return(0); }
/// <summary> /// 初始化用户任务记录 [操作:加载有效用户任务列表;加载监听事件] /// </summary> /// <param name="playerId"></param> public void LoadFromDatabase(int playerId) { lock (m_lock) { m_states = m_player.PlayerCharacter.QuestSite.Count() == 0 ? InitQuest() : m_player.PlayerCharacter.QuestSite; using (PlayerBussiness db = new PlayerBussiness()) { QuestDataInfo[] datas = db.GetUserQuest(playerId); BeginChanges(); foreach (QuestDataInfo dt in datas) { QuestInfo info = QuestMgr.GetSingleQuest(dt.QuestID); if (info != null) { AddQuest(new BaseQuest(info, dt)); } } CommitChanges(); } if (m_list != null) { } } }