From 469866975156c12945f65f0d6f7e6d57ec4f782f Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期一, 29 四月 2019 09:38:44 +0800
Subject: [PATCH] Merge branch 'master' into SubWindow

---
 System/MainInterfacePanel/TaskModel.cs |  122 +++++++++++++++++++++++++++-------------
 1 files changed, 83 insertions(+), 39 deletions(-)

diff --git a/System/MainInterfacePanel/TaskModel.cs b/System/MainInterfacePanel/TaskModel.cs
index a6faf4e..e52b5d1 100644
--- a/System/MainInterfacePanel/TaskModel.cs
+++ b/System/MainInterfacePanel/TaskModel.cs
@@ -69,6 +69,9 @@
     public Dictionary<int, Dictionary<string, int>> ReplaceDic = new Dictionary<int, Dictionary<string, int>>();//key鍊兼浛鎹㈠瓧鍏�
     public Dictionary<int, RunTaskAwardRecord> AwardRecordDic = new Dictionary<int, RunTaskAwardRecord>();//璺戠幆濂栧姳璁板綍
     public Dictionary<int, int> NPCShowDic = new Dictionary<int, int>();//鍏充簬NPC鐨勬樉闅愰棶棰�
+
+    Dictionary<int, int> m_ShowNpcCache = new Dictionary<int, int>();
+
     public delegate void OnTaskToAdd(int MissionID, int MissionState, int DiscriptionIndex);
     public static event OnTaskToAdd Event_TaskToAdd;//浠诲姟娣诲姞
     public delegate void OnTaskRefreshes(int _taskId);
@@ -186,6 +189,7 @@
         ReplaceDic.Clear();
         AwardRecordDic.Clear();
         NPCShowDic.Clear();
+        m_ShowNpcCache.Clear();
         _conversation = null;
         _DefaultDialogContent = null;
         _TaskNow = 0;
@@ -242,10 +246,10 @@
                 currentMissionState = MissionState;
             }
             //浠欑洘浠诲姟瀹屾垚
-            if ((pytaskM.type == 12||pytaskM.type == 14) && TaskAllocation.Instance.FairyAuAllNumber() >= FairyAuTaskCount_Day)
-            {
-                Event_FairyAuTask();
-                return;
+            if ((pytaskM.type == 12 || pytaskM.type == 14) && TaskAllocation.Instance.FairyAuAllNumber() >= FairyAuTaskCount_Day)
+            {
+                Event_FairyAuTask();
+                return;
             }
 
 
@@ -1361,12 +1365,12 @@
             yield return WaitingForSecondConst.WaitMS800;//缂撳啿涓�绉掑啀杩涜
         }
 
-        if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎绛夊緟琛ㄧ幇
-        {
-            if (taskWait.wait)
-            {
-                yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime);
-            }
+        if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎绛夊緟琛ㄧ幇
+        {
+            if (taskWait.wait)
+            {
+                yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime);
+            }
         }
 
         if (GA_Hero.s_MapSwitching)
@@ -1388,6 +1392,10 @@
     {
         foreach (string key in _Dic.Keys)
         {
+            if (key.Equals("Show_{visit_npc_id}"))
+            {
+                continue;
+            }
             string[] str = key.Split('_');
             if (str[0] == "Show")
             {
@@ -1397,8 +1405,44 @@
         return 0;
     }
 
+    private int CacheNpcID = 0;
+
     private void StorageNPCDic(uint taskId, string key, int Value)//鍏充簬NPC鐨勬樉闅�
     {
+        if (key.Equals("Show_{visit_npc_id}"))
+        {
+            m_ShowNpcCache[(int)taskId] = Value;
+            if (CacheNpcID != 0)
+            {
+                Task0820(new H0820_tagMissionDict()
+                {
+                    MissionID = taskId,
+                    DictKey = "Show_" + CacheNpcID,
+                    DictValue = (uint)m_ShowNpcCache[(int)taskId],
+                });
+                m_ShowNpcCache.Remove(CacheNpcID);
+                CacheNpcID = 0;
+            }
+            return;
+        }
+
+        if (key.Equals("visit_npc_id"))
+        {
+            CacheNpcID = Value;
+            if (m_ShowNpcCache.ContainsKey((int)taskId))
+            {
+                Task0820(new H0820_tagMissionDict()
+                {
+                    MissionID = taskId,
+                    DictKey = "Show_" + CacheNpcID,
+                    DictValue = (uint)m_ShowNpcCache[(int)taskId],
+                });
+                m_ShowNpcCache.Remove((int)taskId);
+                CacheNpcID = 0;
+            }
+            return;
+        }
+
         string[] str = key.Split('_');
         if (str[0] == "Show")
         {
@@ -1688,36 +1732,36 @@
         }
     }
 
-    public class TaskWait
-    {
-        public bool wait
-        {
-            get
-            {
-                foreach (var key in taskWaits.Keys)
-                {
-                    if ((TimeUtility.ServerNow - taskWaits[key]).TotalSeconds < 1f)
-                    {
-                        return true;
-                    }
-                }
-                return false;
-            }
-        }
-
-        Dictionary<TaskWaitType, DateTime> taskWaits = new Dictionary<TaskWaitType, DateTime>();
-
-        public void Push(TaskWaitType type)
-        {
-            taskWaits[type] = TimeUtility.ServerNow;
-        }
+    public class TaskWait
+    {
+        public bool wait
+        {
+            get
+            {
+                foreach (var key in taskWaits.Keys)
+                {
+                    if ((TimeUtility.ServerNow - taskWaits[key]).TotalSeconds < 1f)
+                    {
+                        return true;
+                    }
+                }
+                return false;
+            }
+        }
+
+        Dictionary<TaskWaitType, DateTime> taskWaits = new Dictionary<TaskWaitType, DateTime>();
+
+        public void Push(TaskWaitType type)
+        {
+            taskWaits[type] = TimeUtility.ServerNow;
+        }
     }
 
-    public enum TaskWaitType
-    {
-        TaskComplete,
-        LevelUp,
-        TreasureProgress,
-        BetterEquip,
+    public enum TaskWaitType
+    {
+        TaskComplete,
+        LevelUp,
+        TreasureProgress,
+        BetterEquip,
     }
 }

--
Gitblit v1.8.0