From 746dec7b2deec0d87a90153997a47d797f6d9b81 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 26 六月 2025 22:07:23 +0800
Subject: [PATCH] 0312 主界面功能 增加真机debug模块:1.输出日志 2.支持非SDK登录 3.GM命令 4.分支下载
---
Main/Core/GameEngine/Player/PlayerBaseData.cs | 111
Main/System/AssetVersion/InGameDownLoad.cs | 19
Main/Core/GameEngine/Player/PlayerDatas.cs | 47
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs | 14
Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs.meta | 2
Main/System/GMCommand/GMInputWin.cs | 13
Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function.meta | 8
Main/Component/UI/Common/SmoothSlider.cs | 120
Main/Utility/ComponentExtersion.cs | 2
Main/Config/Configs/RealmLVUPTaskConfig.cs.meta | 2
Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs.meta | 2
Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs | 24
Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs.meta | 2
Main/System/Message/SysNotifyMgr.cs | 4
Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs | 20
Main/Config/Configs/RealmLVUPTaskConfig.cs | 62
Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs.meta | 2
Main/Utility/EnumHelper.cs | 6
Main/System/OfficialRank.meta | 8
Main/System/Task/TaskManager.cs | 1787 ------------------------
Main/Manager/UIManager.cs | 15
Main/Config/Configs/RealmConfig.cs.meta | 2
Main/Config/Configs/PlayerLVConfig.cs | 94
Main/System/Debug/DebugUtility.cs | 126 -
Main/Core/NetworkPackage/ServerPack/H32_GM/H3202_tagServerResponse.cs | 48
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs.meta | 2
Main/System/Login/LoginManager.cs | 36
Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs | 13
Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs | 31
Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs | 17
Main/System/OfficialRank/OfficialRankManager.cs | 131 +
Main/Config/ConfigManager.cs | 11
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs | 33
Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs | 37
Main/Config/Configs/TaskConfig.cs | 65
Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs.meta | 2
Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs.meta | 2
Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs.meta | 2
Main/System/Message/RichTableEvent.cs | 784 ++++------
Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs.meta | 2
Main/System/Main/HomeWin.cs | 146 +
Main/Main.cs | 1
Main/Config/Configs/RealmConfig.cs | 74 +
Main/Core/Frame/UIFrameMgr.cs | 128 +
Main/Config/Configs/TaskConfig.cs.meta | 2
Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs | 24
Main/System/Debug/DebugController.cs | 70
Main/System/PhantasmPavilion/PhantasmPavilionModel.cs | 4
Main/System/OfficialRank/OfficialRankManager.cs.meta | 2
/dev/null | 12
Main/Utility/UIHelper.cs | 92
Main/System/GMCommand/GMCmdPanel.cs | 7
Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs | 39
Main/Core/NetworkPackage/Socket/ClientSocket.cs | 16
Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs | 5
Main/System/Main/MainWin.cs | 27
Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM.meta | 8
Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs.meta | 2
58 files changed, 1,524 insertions(+), 2,843 deletions(-)
diff --git a/Main/Component/UI/Common/SmoothSlider.cs b/Main/Component/UI/Common/SmoothSlider.cs
index 043f5a3..fc9cac3 100644
--- a/Main/Component/UI/Common/SmoothSlider.cs
+++ b/Main/Component/UI/Common/SmoothSlider.cs
@@ -4,65 +4,67 @@
using UnityEngine.UI;
- [DisallowMultipleComponent]
-
- public class SmoothSlider : MonoBehaviour
- {
+[DisallowMultipleComponent]
- [SerializeField]
- Slider m_Slider;
- public Slider slider {
- get { return m_Slider; }
- }
+public class SmoothSlider : MonoBehaviour
+{
- [SerializeField]
- [Range(0, 10)]
- float m_Delay = 0.2f;
- public float delay {
- get { return m_Delay; }
- set {
- m_Delay = Mathf.Clamp(value, 0, 10);
- }
- }
-
- [SerializeField]
- [Range(0, 1)]
- float m_Value = 0f;
- public float value {
- get {
- return m_Value;
- }
- set {
- m_Value = Mathf.Clamp01(value);
- }
- }
-
- float refSpeed = 0f;
-
- public void ResetValue(float _value)
- {
- value = _value;
- if (slider != null)
- {
- slider.value = Mathf.Clamp01(_value);
- }
- }
-
- void OnEnable()
- {
- refSpeed = 0f;
- }
-
- void LateUpdate()
- {
- if (slider == null)
- {
- return;
- }
- if (Mathf.Abs(slider.value - value) > 0.001f)
- {
- slider.value = Mathf.SmoothDamp(slider.value, value, ref refSpeed, delay);
- }
- }
-
+ [SerializeField]
+ Slider m_Slider;
+ public Slider slider {
+ get { return m_Slider; }
}
+
+ [SerializeField]
+ [Range(0, 10)]
+ float m_Delay = 0.2f;
+ public float delay {
+ get { return m_Delay; }
+ set {
+ m_Delay = Mathf.Clamp(value, 0, 10);
+ }
+ }
+
+ [SerializeField]
+ [Range(0, 1)]
+ float m_Value = 0f;
+ public float value {
+ get {
+ return m_Value;
+ }
+ set {
+ m_Value = Mathf.Clamp01(value);
+ }
+ }
+
+ [SerializeField] public Text Text;
+
+ float refSpeed = 0f;
+
+ public void ResetValue(float _value)
+ {
+ value = _value;
+ if (slider != null)
+ {
+ slider.value = Mathf.Clamp01(_value);
+ }
+ }
+
+ void OnEnable()
+ {
+ refSpeed = 0f;
+ }
+
+ void LateUpdate()
+ {
+ if (slider == null)
+ {
+ return;
+ }
+ if (Mathf.Abs(slider.value - value) > 0.001f)
+ {
+ slider.value = Mathf.SmoothDamp(slider.value, value, ref refSpeed, delay);
+ }
+ }
+
+}
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index cb9c38e..273f00e 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -33,7 +33,7 @@
isLoadFinished = false;
// 鍔犺浇閰嶇疆鏂囦欢
- int totalConfigs = 60;
+ int totalConfigs = 63;
Type[] configTypes = new Type[] {
typeof(AppointItemConfig),
typeof(AudioConfig),
@@ -84,12 +84,15 @@
typeof(PlayerLVConfig),
typeof(PlayerPropertyConfig),
typeof(priorbundleConfig),
+ typeof(RealmConfig),
+ typeof(RealmLVUPTaskConfig),
typeof(RichTextMsgReplaceConfig),
typeof(RuleConfig),
typeof(SkillConfig),
typeof(StoreConfig),
typeof(SuccessConfig),
typeof(SysInfoConfig),
+ typeof(TaskConfig),
typeof(TitleStarUpConfig),
typeof(TreasureCntAwardConfig),
typeof(TreasureItemLibConfig),
@@ -289,6 +292,10 @@
ClearConfigDictionary<PlayerPropertyConfig>();
// 娓呯┖ priorbundleConfig 瀛楀吀
ClearConfigDictionary<priorbundleConfig>();
+ // 娓呯┖ RealmConfig 瀛楀吀
+ ClearConfigDictionary<RealmConfig>();
+ // 娓呯┖ RealmLVUPTaskConfig 瀛楀吀
+ ClearConfigDictionary<RealmLVUPTaskConfig>();
// 娓呯┖ RichTextMsgReplaceConfig 瀛楀吀
ClearConfigDictionary<RichTextMsgReplaceConfig>();
// 娓呯┖ RuleConfig 瀛楀吀
@@ -301,6 +308,8 @@
ClearConfigDictionary<SuccessConfig>();
// 娓呯┖ SysInfoConfig 瀛楀吀
ClearConfigDictionary<SysInfoConfig>();
+ // 娓呯┖ TaskConfig 瀛楀吀
+ ClearConfigDictionary<TaskConfig>();
// 娓呯┖ TitleStarUpConfig 瀛楀吀
ClearConfigDictionary<TitleStarUpConfig>();
// 娓呯┖ TreasureCntAwardConfig 瀛楀吀
diff --git a/Main/Config/Configs/PlayerLVConfig.cs b/Main/Config/Configs/PlayerLVConfig.cs
index a996a26..42a8c16 100644
--- a/Main/Config/Configs/PlayerLVConfig.cs
+++ b/Main/Config/Configs/PlayerLVConfig.cs
@@ -1,56 +1,38 @@
-锘�//--------------------------------------------------------
-// [Author]: YYL
-// [ Date ]: 2025骞�5鏈�22鏃�
-//--------------------------------------------------------
-
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using System;
-using UnityEngine;
-using LitJson;
-
-public partial class PlayerLVConfig : ConfigBase<int, PlayerLVConfig>
-{
-
- public int LV;
- public int EXP1;
- public int EXP2;
- public int TalentPoint;
- public int ReExp;
- public int ReMaxHP;
- public int fightPower;
- public int IceLodeFightPower;
-
- public override int LoadKey(string _key)
- {
- int key = GetKey(_key);
- return key;
- }
-
- public override void LoadConfig(string input)
- {
- try {
- string[] tables = input.Split('\t');
- int.TryParse(tables[0],out LV);
-
- int.TryParse(tables[1],out EXP1);
-
- int.TryParse(tables[2],out EXP2);
-
- int.TryParse(tables[3],out TalentPoint);
-
- int.TryParse(tables[4],out ReExp);
-
- int.TryParse(tables[5],out ReMaxHP);
-
- int.TryParse(tables[6],out fightPower);
-
- int.TryParse(tables[7],out IceLodeFightPower);
- }
- catch (Exception exception)
- {
- Debug.LogError(exception);
- }
- }
-}
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2025骞�6鏈�25鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class PlayerLVConfig : ConfigBase<int, PlayerLVConfig>
+{
+
+ public int LV;
+ public long EXP;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out LV);
+
+ long.TryParse(tables[1],out EXP);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/RealmConfig.cs b/Main/Config/Configs/RealmConfig.cs
new file mode 100644
index 0000000..5fa4b44
--- /dev/null
+++ b/Main/Config/Configs/RealmConfig.cs
@@ -0,0 +1,74 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2025骞�6鏈�25鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class RealmConfig : ConfigBase<int, RealmConfig>
+{
+
+ public int Lv;
+ public string Name;
+ public int LVMax;
+ public int[] AddAttrType;
+ public int[] AddAttrNum;
+ public int Quality;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out Lv);
+
+ Name = tables[1];
+
+ int.TryParse(tables[2],out LVMax);
+
+ if (tables[3].Contains("["))
+ {
+ AddAttrType = JsonMapper.ToObject<int[]>(tables[3]);
+ }
+ else
+ {
+ string[] AddAttrTypeStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ AddAttrType = new int[AddAttrTypeStringArray.Length];
+ for (int i=0;i<AddAttrTypeStringArray.Length;i++)
+ {
+ int.TryParse(AddAttrTypeStringArray[i],out AddAttrType[i]);
+ }
+ }
+
+ if (tables[4].Contains("["))
+ {
+ AddAttrNum = JsonMapper.ToObject<int[]>(tables[4]);
+ }
+ else
+ {
+ string[] AddAttrNumStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ AddAttrNum = new int[AddAttrNumStringArray.Length];
+ for (int i=0;i<AddAttrNumStringArray.Length;i++)
+ {
+ int.TryParse(AddAttrNumStringArray[i],out AddAttrNum[i]);
+ }
+ }
+
+ int.TryParse(tables[5],out Quality);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Config/Configs/RealmConfig.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Config/Configs/RealmConfig.cs.meta
index d92abdf..4b19c5a 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Config/Configs/RealmConfig.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 0d1d159b5ea4e8f48bedf080edf20ad7
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Config/Configs/RealmLVUPTaskConfig.cs b/Main/Config/Configs/RealmLVUPTaskConfig.cs
new file mode 100644
index 0000000..00e6964
--- /dev/null
+++ b/Main/Config/Configs/RealmLVUPTaskConfig.cs
@@ -0,0 +1,62 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2025骞�6鏈�25鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class RealmLVUPTaskConfig : ConfigBase<int, RealmLVUPTaskConfig>
+{
+
+ public int ID;
+ public int Lv;
+ public int TaskID;
+ public int TaskType;
+ public int[] NeedValueList;
+ public int[][] AwardItemList;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out ID);
+
+ int.TryParse(tables[1],out Lv);
+
+ int.TryParse(tables[2],out TaskID);
+
+ int.TryParse(tables[3],out TaskType);
+
+ if (tables[4].Contains("["))
+ {
+ NeedValueList = JsonMapper.ToObject<int[]>(tables[4]);
+ }
+ else
+ {
+ string[] NeedValueListStringArray = tables[4].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ NeedValueList = new int[NeedValueListStringArray.Length];
+ for (int i=0;i<NeedValueListStringArray.Length;i++)
+ {
+ int.TryParse(NeedValueListStringArray[i],out NeedValueList[i]);
+ }
+ }
+
+ AwardItemList = JsonMapper.ToObject<int[][]>(tables[5].Replace("(", "[").Replace(")", "]"));
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Config/Configs/RealmLVUPTaskConfig.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Config/Configs/RealmLVUPTaskConfig.cs.meta
index d92abdf..a8120e5 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Config/Configs/RealmLVUPTaskConfig.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 2f6b0dd2330349748b9e24c850c39554
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Config/Configs/TaskConfig.cs b/Main/Config/Configs/TaskConfig.cs
new file mode 100644
index 0000000..0dd4368
--- /dev/null
+++ b/Main/Config/Configs/TaskConfig.cs
@@ -0,0 +1,65 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: 2025骞�6鏈�26鏃�
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class TaskConfig : ConfigBase<int, TaskConfig>
+{
+
+ public int TaskID;
+ public int Index;
+ public int TaskType;
+ public int[] TaskConds;
+ public int NeedValue;
+ public string TaskDescribe;
+ public int[][] AwardItemList;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out TaskID);
+
+ int.TryParse(tables[1],out Index);
+
+ int.TryParse(tables[2],out TaskType);
+
+ if (tables[3].Contains("["))
+ {
+ TaskConds = JsonMapper.ToObject<int[]>(tables[3]);
+ }
+ else
+ {
+ string[] TaskCondsStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
+ TaskConds = new int[TaskCondsStringArray.Length];
+ for (int i=0;i<TaskCondsStringArray.Length;i++)
+ {
+ int.TryParse(TaskCondsStringArray[i],out TaskConds[i]);
+ }
+ }
+
+ int.TryParse(tables[4],out NeedValue);
+
+ TaskDescribe = tables[5];
+
+ AwardItemList = JsonMapper.ToObject<int[][]>(tables[6].Replace("(", "[").Replace(")", "]"));
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Config/Configs/TaskConfig.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Config/Configs/TaskConfig.cs.meta
index d92abdf..e99231d 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Config/Configs/TaskConfig.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 50f99bcf5e945de479ec59c4f7ba2679
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs
new file mode 100644
index 0000000..88afc81
--- /dev/null
+++ b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs
@@ -0,0 +1,39 @@
+using System.Collections.Generic;
+using System.Linq;
+
+public partial class RealmLVUPTaskConfig : ConfigBase<int, RealmLVUPTaskConfig>
+{
+ //瀹樿亴锛氫换鍔D锛氱储寮昳d
+ private static Dictionary<int, Dictionary<int, int>> missionDict = new Dictionary<int, Dictionary<int, int>>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ if (!missionDict.ContainsKey(Lv))
+ {
+ missionDict.Add(Lv, new Dictionary<int, int>());
+ }
+ missionDict[Lv][TaskID] = ID;
+ }
+
+ public static int GetID(int realmLV, int taskID)
+ {
+ if (missionDict.ContainsKey(realmLV) && missionDict[realmLV].ContainsKey(taskID))
+ {
+ return missionDict[realmLV][taskID];
+ }
+ return -1;
+ }
+
+ public static List<int> GetMissionIDs(int lv)
+ {
+ List<int> list = new List<int>();
+ if (missionDict.ContainsKey(lv))
+ {
+ list = missionDict[lv].Keys.ToList();
+ list.Sort();
+ return list;
+ }
+
+ return list;
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs.meta
index d92abdf..198f4ca 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Config/PartialConfigs/RealmLVUPTaskConfig.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 1a5f9e407e52f6b499ba29ba0d8f1483
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs b/Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs
new file mode 100644
index 0000000..561e042
--- /dev/null
+++ b/Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using UnityEngine;
+using LitJson;
+
+public partial class RichTextMsgReplaceConfig : ConfigBase<int, RichTextMsgReplaceConfig>
+{
+ private static Dictionary<string, RichTextMsgReplaceConfig> m_ReplaceCfgs = new Dictionary<string, RichTextMsgReplaceConfig>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ m_ReplaceCfgs.Add(StringUtility.Contact(Identification, Number).ToString(), this);
+ }
+
+ public static string GetRichReplace(string identify, int number)
+ {
+ RichTextMsgReplaceConfig replace = null;
+ m_ReplaceCfgs.TryGetValue(StringUtility.Contact(identify, number).ToString(), out replace);
+ if (replace != null)
+ {
+ return replace.Content;
+ }
+ return string.Empty;
+ }
+}
\ No newline at end of file
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs.meta
index d92abdf..5c5e7fc 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Config/PartialConfigs/RichTextMsgReplaceConfig.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: a840a1e0c4a502646aac085f98f174d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/Frame/UIFrameMgr.cs b/Main/Core/Frame/UIFrameMgr.cs
index b0f994b..87d6ad3 100644
--- a/Main/Core/Frame/UIFrameMgr.cs
+++ b/Main/Core/Frame/UIFrameMgr.cs
@@ -1,84 +1,112 @@
-锘縰sing System.Collections;
+锘匡豢using System.Collections;
using System.Collections.Generic;
using UnityEngine;
-
-public class UIFrameMgr {
+/// <summary>
+/// UI甯у姩鐢荤鐞嗗櫒 - 璐熻矗甯у姩鐢昏祫婧愮殑鍔犺浇鍜岀鐞�
+/// </summary>
+public class UIFrameMgr {
private static UIFrameMgr _inst = null;
+ private static readonly object _lock = new object();
+
public static UIFrameMgr Inst {
get {
if (_inst == null) {
- _inst = new UIFrameMgr();
+ lock (_lock) {
+ if (_inst == null) {
+ _inst = new UIFrameMgr();
+ }
+ }
}
return _inst;
}
}
- // 琛ㄤ腑鐨勬墍鏈夎褰�
+ // 甯у姩鐢昏祫婧愮紦瀛�
private Dictionary<string, List<Sprite>> allFrameDic = new Dictionary<string, List<Sprite>>();
- //鍙湁鑱婂ぉ琛ㄦ儏鐢ㄥ埌鐨� 鏍规嵁璺緞frame鏉ュ垝鍒�
- private List<string> chatFaces = new List<string>();
+ // 鏄惁宸插垵濮嬪寲
+ private bool isInitialized = false;
public UIFrameMgr()
{
Init();
}
+ /// <summary>
+ /// 鍒濆鍖栫鐞嗗櫒
+ /// </summary>
public void Init()
{
+ if (isInitialized)
+ return;
+
allFrameDic.Clear();
- chatFaces.Clear();
- var dic = FaceConfig.dic.Values;
- foreach (var cfg in dic)
+ isInitialized = true;
+ }
+
+ /// <summary>
+ /// 鍔犺浇鎸囧畾甯у姩鐢昏祫婧�
+ /// </summary>
+ private void LoadFrameSprites(FaceConfig cfg)
+ {
+ if (allFrameDic.ContainsKey(cfg.name))
+ return;
+
+ List<Sprite> spriteList = new List<Sprite>();
+
+ for (int i = 1; i <= cfg.frameCnt; i++)
{
- if (cfg.frameType == 1 && !chatFaces.Contains(cfg.name))
+ string spritePath = "Sprite/" + cfg.folder;
+ string spriteName = StringUtility.Contact(cfg.name, "_", i);
+
+ Sprite sprite = ResManager.Instance.LoadAsset<Sprite>(spritePath, spriteName);
+ if (sprite != null)
{
- chatFaces.Add(cfg.name);
+ spriteList.Add(sprite);
}
- for (int i = 1; i <= cfg.frameCnt; i++)
- {
- Sprite sprite = ResManager.Instance.LoadAsset<Sprite>("Sprite/" + cfg.folder, StringUtility.Contact(cfg.name, "_", i));
- if (sprite != null)
- {
- List<Sprite> list = null;
- allFrameDic.TryGetValue(cfg.name, out list);
- if (list != null)
- {
- list.Add(sprite);
- }
- else
- {
- list = new List<Sprite>();
- list.Add(sprite);
- allFrameDic.Add(cfg.name, list);
- }
- }
- }
+ }
+
+ if (spriteList.Count > 0)
+ {
+ allFrameDic.Add(cfg.name, spriteList);
}
}
- //鎵�鏈夊姩鎬佸抚
- public Dictionary<string, List<UnityEngine.Sprite>> GetAllFrame()
+ /// <summary>
+ /// 鑾峰彇甯у姩鐢昏祫婧�
+ /// </summary>
+ public List<Sprite> GetDynamicImage(string key)
{
- return allFrameDic;
+ // 鎸夐渶鍔犺浇璧勬簮
+ if (!allFrameDic.ContainsKey(key))
+ {
+ LoadFrameSprites(FaceConfig.Get(key));
+ }
+
+ if (allFrameDic.TryGetValue(key, out var list))
+ {
+ return list;
+ }
+ return null;
}
- //鍙湁鑱婂ぉ琛ㄦ儏
- public List<string> GetAllFace()
- {
- return chatFaces;
- }
-
- public List<UnityEngine.Sprite> GetDynamicImage(string key)
- {
- List<UnityEngine.Sprite> list = null;
- allFrameDic.TryGetValue(key, out list);
- return list;
- }
-
+ /// <summary>
+ /// 妫�鏌ユ槸鍚﹀寘鍚寚瀹氬抚鍔ㄧ敾
+ /// </summary>
public bool ContainsDynamicImage(string key)
{
- return allFrameDic.ContainsKey(key);
+ return FaceConfig.HasKey(key);
}
-
-}
+
+
+ /// <summary>
+ /// 棰勫姞杞芥寚瀹氬抚鍔ㄧ敾
+ /// </summary>
+ public void PreloadDynamicImage(string key)
+ {
+ if (!allFrameDic.ContainsKey(key))
+ {
+ LoadFrameSprites(FaceConfig.Get(key));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/Core/GameEngine/Player/PlayerBaseData.cs b/Main/Core/GameEngine/Player/PlayerBaseData.cs
index 1d85dec..95a26de 100644
--- a/Main/Core/GameEngine/Player/PlayerBaseData.cs
+++ b/Main/Core/GameEngine/Player/PlayerBaseData.cs
@@ -9,8 +9,9 @@
public byte Job; //鑱屼笟,
public ushort LV; //绛夌骇
public int TitleID;
- public uint ExpPoint; //鎵╁厖缁忛獙鐐规暟
- public uint TotalExp; //鎬荤粡楠�
+ public uint ExpPoint; //鎵╁厖缁忛獙鐐规暟锛堜嚎锛�
+ public uint TotalExp; //鎬荤粡楠�(灏忎簬浜块儴鍒�)
+ public ulong curExp { get { return ExpPoint + TotalExp * Constants.ExpPointValue; } }
public uint FamilyId; //瀹舵棌
public string FamilyName; //瀹舵棌鍚嶇О
public uint diamond; //浠欑帀
@@ -31,7 +32,7 @@
public string Setting; //璁惧畾
public byte AttackMode; //鏀诲嚮妯″紡
public byte FBID; //fb id
- public byte realmLevel; //鏃ф湇鍔$瀹橀樁锛岀幇椤圭洰鐢ㄤ簬澧冪晫
+ public byte realmLevel; //瀹樿亴
public byte VIPLv; //VIP绛夌骇
public uint ExAttr1; // 鍗忓姪鐩爣鐜╁ID锛岄潪0鍙�0閫�鍑哄崗鍔�
public uint teamAutoOperateFlag; //鎵╁睍灞炴��2锛屽悇椤圭洰涓撶敤
@@ -137,58 +138,58 @@
}
public void UpdateData(H0102_tagCDBPlayer _serverInfo)
- {
-
- AccID = _serverInfo.AccID;
- PlayerID = _serverInfo.PlayerID;
- PlayerName = _serverInfo.PlayerName.Trim().Replace("\0", "");
- GMLevel = _serverInfo.GMLevel;
- Job = _serverInfo.Job;
- LV = _serverInfo.LV;
- ExpPoint = _serverInfo.ExpPoint;
- TotalExp = _serverInfo.TotalExp;
- FamilyId = _serverInfo.Family;
- FamilyName = _serverInfo.FamilyName.Trim().Replace("\0", "");
- diamond = _serverInfo.Gold;
- bindDiamond = _serverInfo.GoldPaper;
- copper = _serverInfo.Silver;
- MapID = _serverInfo.MapID;
- PosX = _serverInfo.PosX;
- PosY = _serverInfo.PosY;
- FreePoint = _serverInfo.FreePoint;
- FreeSkillPoint = _serverInfo.FreeSkillPoint;
- STR = _serverInfo.STR;
- PNE = _serverInfo.PNE;
- PHY = _serverInfo.PHY;
- CON = _serverInfo.CON;
- Setting = _serverInfo.Setting;
- FBID = _serverInfo.FBID;
- ExAttr1 = _serverInfo.ExAttr1;
- teamAutoOperateFlag = _serverInfo.ExAttr2;
- dungeonLineId = (int)_serverInfo.ExAttr3 % 1000;
- dungeonMapId = (int)_serverInfo.ExAttr3 / 1000;
- shield = _serverInfo.ExAttr4;
- CrossServerFlag = _serverInfo.ExAttr5;
- realmLevel = _serverInfo.OfficialRank;
- VIPLv = _serverInfo.VIPLv;
- copperExtend = _serverInfo.ExAttr6;
- sp = _serverInfo.ExAttr7;
- spExtend = _serverInfo.ExAttr8;
- bubbleId = _serverInfo.ExAttr10;
- ExAttr11 = _serverInfo.ExAttr11;
- ExAttr16 = _serverInfo.ExAttr16;
- ServerGroupId = _serverInfo.ExAttr13;
- faction = _serverInfo.Faction;
- coinPointTotal = _serverInfo.ChangeCoinPointTotal;
- equipShowSwitch = _serverInfo.EquipShowSwitch;
- mapRealmSelect = (int)_serverInfo.ExAttr18;
- leaveFamilyTime = (int)_serverInfo.ExAttr19;
- face = (int)_serverInfo.Face;
- facePic = (int)_serverInfo.FacePic;
-
- HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue;
- AttackMode = _serverInfo.AttackMode;
-
+ {
+
+ AccID = _serverInfo.AccID.Trim().Replace("\0", "");
+ PlayerID = _serverInfo.PlayerID;
+ PlayerName = _serverInfo.PlayerName.Trim().Replace("\0", "");
+ GMLevel = _serverInfo.GMLevel;
+ Job = _serverInfo.Job;
+ LV = _serverInfo.LV;
+ ExpPoint = _serverInfo.ExpPoint;
+ TotalExp = _serverInfo.TotalExp;
+ FamilyId = _serverInfo.Family;
+ FamilyName = _serverInfo.FamilyName.Trim().Replace("\0", "");
+ diamond = _serverInfo.Gold;
+ bindDiamond = _serverInfo.GoldPaper;
+ copper = _serverInfo.Silver;
+ MapID = _serverInfo.MapID;
+ PosX = _serverInfo.PosX;
+ PosY = _serverInfo.PosY;
+ FreePoint = _serverInfo.FreePoint;
+ FreeSkillPoint = _serverInfo.FreeSkillPoint;
+ STR = _serverInfo.STR;
+ PNE = _serverInfo.PNE;
+ PHY = _serverInfo.PHY;
+ CON = _serverInfo.CON;
+ Setting = _serverInfo.Setting;
+ FBID = _serverInfo.FBID;
+ ExAttr1 = _serverInfo.ExAttr1;
+ teamAutoOperateFlag = _serverInfo.ExAttr2;
+ dungeonLineId = (int)_serverInfo.ExAttr3 % 1000;
+ dungeonMapId = (int)_serverInfo.ExAttr3 / 1000;
+ shield = _serverInfo.ExAttr4;
+ CrossServerFlag = _serverInfo.ExAttr5;
+ realmLevel = _serverInfo.OfficialRank;
+ VIPLv = _serverInfo.VIPLv;
+ copperExtend = _serverInfo.ExAttr6;
+ sp = _serverInfo.ExAttr7;
+ spExtend = _serverInfo.ExAttr8;
+ bubbleId = _serverInfo.ExAttr10;
+ ExAttr11 = _serverInfo.ExAttr11;
+ ExAttr16 = _serverInfo.ExAttr16;
+ ServerGroupId = _serverInfo.ExAttr13;
+ faction = _serverInfo.Faction;
+ coinPointTotal = _serverInfo.ChangeCoinPointTotal;
+ equipShowSwitch = _serverInfo.EquipShowSwitch;
+ mapRealmSelect = (int)_serverInfo.ExAttr18;
+ leaveFamilyTime = (int)_serverInfo.ExAttr19;
+ face = (int)_serverInfo.Face;
+ facePic = (int)_serverInfo.FacePic;
+
+ HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue;
+ AttackMode = _serverInfo.AttackMode;
+
}
// 閮ㄥ垎鎯呭喌闇�瑕佹湇鍔$闈為噸鐧绘儏鍐典笅鍚屾鎵�鏈夋暟鎹�
diff --git a/Main/Core/GameEngine/Player/PlayerDatas.cs b/Main/Core/GameEngine/Player/PlayerDatas.cs
index f20f80e..7c74965 100644
--- a/Main/Core/GameEngine/Player/PlayerDatas.cs
+++ b/Main/Core/GameEngine/Player/PlayerDatas.cs
@@ -49,44 +49,11 @@
}
}
- public void UpdatePlayerData(/*HA112_tagMCDBPlayer data*/)
- {
- // baseData.UpdateData(data);
- // if (hero != null)
- // {
- // hero.InitBornPos(baseData.PosX, baseData.PosY);
- // CameraController.Instance.Apply();
- // }
-
- // if (playerDataUpdateEvent != null)
- // {
- // playerDataUpdateEvent();
- // }
- }
-
- public void FightRefreshPlayerHp(ulong hp)
- {
- RefreshProperty(PlayerDataType.HP, (uint)(hp % Constants.ExpPointValue), (uint)(hp/Constants.ExpPointValue));
-
- if (playerDataUpdateEvent != null)
- {
- playerDataUpdateEvent();
- }
-
- if (playerDataRefreshEvent != null)
- {
- playerDataRefreshEvent(PlayerDataType.HP);
- }
- }
-
public void RefreshPlayerData(H0418_tagObjInfoRefresh vNetData)
{
UpdatePlayerData(vNetData);
//StoreModel.RefreshTCBPlayerData(vNetData);
- if (playerDataUpdateEvent != null)
- {
- playerDataUpdateEvent();
- }
+
}
@@ -139,7 +106,7 @@
case PlayerDataType.Family:
baseData.FamilyId = value;
if (LocalSave.GetInt("FimilyReport" + PlayerDatas.Instance.baseData.PlayerID) == 0)
- {
+ {
SDKUtils.Instance.TraceEvent("joinalliance", "", false);
LocalSave.SetInt("FimilyReport" + PlayerDatas.Instance.baseData.PlayerID, 1);
}
@@ -276,7 +243,7 @@
case PlayerDataType.ExAttr4:
baseData.shield = value;
break;
-
+
case PlayerDataType.Faction:
baseData.faction = value;
break;
@@ -450,7 +417,7 @@
case PlayerDataType.CDBPlayerRefresh_TalentPoint:
extersion.talentPoint = (int)value;
break;
-
+
case PlayerDataType.CDBPlayerRefresh_SoulDust:
extersion.soulDust = value;
break;
@@ -550,6 +517,12 @@
case PlayerDataType.default10:
baseData.leaveFamilyTime = (int)value;
break;
+ case PlayerDataType.Face:
+ baseData.face = (int)value;
+ break;
+ case PlayerDataType.FacePic:
+ baseData.facePic = (int)value;
+ break;
}
}
diff --git a/Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs b/Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs
new file mode 100644
index 0000000..6655b10
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs
@@ -0,0 +1,24 @@
+using UnityEngine;
+using System.Collections;
+
+//A1 22 瑙掕壊鏀瑰悕 #tagUpdatePlayerName
+
+public class CA122_tagUpdatePlayerName : GameNetPackBasic {
+ public byte NewNameLen;
+ public string NewName;
+ public byte ItemIndex; //鏀瑰悕鐗╁搧鍦ㄨ儗鍖呬腑鐨勪綅缃�
+ public uint ServerID;
+
+ public CA122_tagUpdatePlayerName () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xA122;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (NewNameLen, NetDataType.BYTE);
+ WriteBytes (NewName, NetDataType.Chars, NewNameLen);
+ WriteBytes (ItemIndex, NetDataType.BYTE);
+ WriteBytes (ServerID, NetDataType.DWORD);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs.meta
index d92abdf..c36518f 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/ClientPack/CA1_Sys/CA122_tagUpdatePlayerName.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: bfd244f765fbd414db05f791c73e38d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM.meta
new file mode 100644
index 0000000..7d3c262
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7fb3a2dfae86c3b46b56e9cd44cf514e
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs
new file mode 100644
index 0000000..63a658f
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+//32 02 鏈嶅姟鍣ㄥ洖搴斿鎴风娑堟伅#tagServerResponse
+
+public class DTC3202_tagServerResponse : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ H3202_tagServerResponse vNetData = vNetPack as H3202_tagServerResponse;
+ #if UNITY_EDITOR
+
+ if (vNetData != null)
+ {
+ Debug.LogFormat("---------- 鏀跺埌鏈嶅姟绔俊鎭�: {0}", vNetData.Message);
+ ServerTipDetails.ReceivePackage(vNetData.Message);
+ }
+ #endif
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs.meta
similarity index 83%
rename from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
rename to Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs.meta
index d92abdf..4c0a4f0 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/H32_GM/DTC3202_tagServerResponse.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 11c9910fc0e719b438f17c3ed8b6fdee
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs
new file mode 100644
index 0000000..7001f57
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 11 閫氱煡鐜╁澧冪晫淇℃伅 #tagMCSyncRealmInfo
+
+public class DTCA311_tagMCSyncRealmInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA311_tagMCSyncRealmInfo vNetData = vNetPack as HA311_tagMCSyncRealmInfo;
+ OfficialRankManager.Instance.ReceivePackage(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs.meta
index d92abdf..6c8370c 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA311_tagMCSyncRealmInfo.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: eddef92c6bd46be47aba126094ae9885
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function.meta
new file mode 100644
index 0000000..709fdee
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 18c84983810679b419c9e2b6ea25534f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs
new file mode 100644
index 0000000..33a6ebc
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs
@@ -0,0 +1,37 @@
+using UnityEngine;
+using System.Collections;
+
+//A9 21 瑙掕壊鏀瑰悕缁撴灉 #tagUpdatePlayerNameResult
+
+public class DTCA921_tagUpdatePlayerNameResult : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA921_tagUpdatePlayerNameResult vNetData = vNetPack as HA921_tagUpdatePlayerNameResult;
+
+ switch ((RoleRenameResult)vNetData.Result)
+ {
+ case RoleRenameResult.MoneyErr:
+ SysNotifyMgr.Instance.ShowTip("GoldErr");
+ break;
+ case RoleRenameResult.NameRuleErr:
+ ServerTipDetails.DisplayNormalTip(Language.Get("L1007"));
+ break;
+ case RoleRenameResult.NameLengErr:
+ break;
+ case RoleRenameResult.NameRepeatErr:
+ SysNotifyMgr.Instance.ShowTip("RepeatName");
+ break;
+ case RoleRenameResult.RenameFailErr:
+ break;
+ case RoleRenameResult.RenameSuccess:
+ SysNotifyMgr.Instance.ShowTip("RenameSuccess01");
+ // if(WindowCenter.Instance.IsOpen<RoleRenameWin>())
+ // {
+ // WindowCenter.Instance.Close<RoleRenameWin>();
+ // }
+ GameNetSystem.Instance.Reconnect();
+ break;
+ }
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs.meta
index d92abdf..fa03820 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HA9_Function/DTCA921_tagUpdatePlayerNameResult.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 98e9e571f8e9a7341acc80bdab67d3bd
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs
new file mode 100644
index 0000000..d66b861
--- /dev/null
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs
@@ -0,0 +1,14 @@
+using UnityEngine;
+using System.Collections;
+using System.Threading.Tasks;
+
+// B1 10 褰撳墠浠诲姟淇℃伅 #tagMCTaskInfo
+
+public class DTCB110_tagMCTaskInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HB110_tagMCTaskInfo vNetData = vNetPack as HB110_tagMCTaskInfo;
+ TaskManager.Instance.UpdateTask(vNetData);
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs.meta
index d92abdf..cabf4d2 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB110_tagMCTaskInfo.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 211fc658a1790544faff232ed7b0db28
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index aff3f24..fcbab53 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -89,7 +89,10 @@
Register(typeof(HB117_tagMCFaceInfo), typeof(DTCB117_tagMCFaceInfo));
Register(typeof(HB118_tagMCFacePicInfo), typeof(DTCB118_tagMCFacePicInfo));
Register(typeof(HB120_tagMCZhanlingInfo), typeof(DTCB120_tagMCZhanlingInfo));
-
+ Register(typeof(HA311_tagMCSyncRealmInfo), typeof(DTCA311_tagMCSyncRealmInfo));
+ Register(typeof(HB110_tagMCTaskInfo), typeof(DTCB110_tagMCTaskInfo));
+ Register(typeof(HA921_tagUpdatePlayerNameResult), typeof(DTCA921_tagUpdatePlayerNameResult));
+ Register(typeof(H3202_tagServerResponse), typeof(DTC3202_tagServerResponse));
}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0801_tagEventTalk.cs b/Main/Core/NetworkPackage/ServerPack/H08_Event/H0801_tagEventTalk.cs
deleted file mode 100644
index 609cb76..0000000
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0801_tagEventTalk.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using UnityEngine;
-using System.Collections;
-
-//08 01 事件选择#tagEventTalk
-
-public class H0801_tagEventTalk : GameNetPackBasic {
- public byte Type; //1.单回答 2:多回答 3:图片通知 4:弹出通知
- public uint MissionID;
- public tagMsgStr[] Msg = null;
- public byte MsgParStrCount; //参数数目
- public tagMsgParStr[] MsgParStr = null; //size = MsgParStrCount
- public uint NPCID;
- public byte NameLen;
- public string Name; //size = NameLen
- public byte AnswerCount;
- public tagMsgStr[] Answer = null; //size = AnswerCount
-
- public H0801_tagEventTalk () {
- _cmd = (ushort)0x0801;
- }
-
- public override void ReadFromBytes (byte[] vBytes) {
- TransBytes (out Type, vBytes, NetDataType.BYTE);
- TransBytes (out MissionID, vBytes, NetDataType.DWORD);
- Msg = new tagMsgStr[1];
- for (int i = 0; i < 1; i ++) {
- Msg[i] = new tagMsgStr();
- TransBytes (out Msg[i].MsgLen, vBytes, NetDataType.WORD);
- TransBytes (out Msg[i].Msg, vBytes, NetDataType.Chars, Msg[i].MsgLen);
- }
- TransBytes (out MsgParStrCount, vBytes, NetDataType.BYTE);
- MsgParStr = new tagMsgParStr[MsgParStrCount];
- for (int i = 0; i < MsgParStrCount; i ++) {
- MsgParStr[i] = new tagMsgParStr();
- TransBytes (out MsgParStr[i].MsgInt, vBytes, NetDataType.DWORD);
- TransBytes (out MsgParStr[i].Len, vBytes, NetDataType.BYTE);
- TransBytes (out MsgParStr[i].Msg, vBytes, NetDataType.Chars, MsgParStr[i].Len);
- }
- TransBytes (out NPCID, vBytes, NetDataType.DWORD);
- TransBytes (out NameLen, vBytes, NetDataType.BYTE);
- TransBytes (out Name, vBytes, NetDataType.Chars, NameLen);
- TransBytes (out AnswerCount, vBytes, NetDataType.BYTE);
- Answer = new tagMsgStr[AnswerCount];
- for (int i = 0; i < AnswerCount; i ++) {
- Answer[i] = new tagMsgStr();
- TransBytes (out Answer[i].MsgLen, vBytes, NetDataType.WORD);
- TransBytes (out Answer[i].Msg, vBytes, NetDataType.Chars, Answer[i].MsgLen);
- }
- }
-
- public class tagMsgStr {
- public ushort MsgLen;
- public string Msg; //size = MsgLen
- }
-
- public class tagMsgParStr {
- public uint MsgInt; //int类型
- public byte Len;
- public string Msg; //size = Len
- }
-
-}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0801_tagEventTalk.cs.meta b/Main/Core/NetworkPackage/ServerPack/H08_Event/H0801_tagEventTalk.cs.meta
deleted file mode 100644
index 8ded1c0..0000000
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0801_tagEventTalk.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 0ba560a44e3fa4c439673159bdc95352
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs b/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs
deleted file mode 100644
index a797226..0000000
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using UnityEngine;
-using System.Collections;
-
-//08 20 任务字典信息#tagMissionDict
-
-
-
-public class H0820_tagMissionDict : GameNetPackBasic {
-
- public uint MissionID;//任务ID
-
- public byte DictKeyLen;//任务中的某个字典Key
-
- public string DictKey; //key的长度 //size = DictKeyLen
-
- public uint DictValue;//该key对应的值
-
-
-
- public H0820_tagMissionDict () {
-
- _cmd = (ushort)0x0820;
-
- }
-
-
-
- public override void ReadFromBytes (byte[] vBytes) {
-
- TransBytes (out MissionID, vBytes, NetDataType.DWORD);
-
- TransBytes (out DictKeyLen, vBytes, NetDataType.BYTE);
-
- TransBytes (out DictKey, vBytes, NetDataType.Chars, DictKeyLen);
-
- TransBytes (out DictValue, vBytes, NetDataType.DWORD);
-
- }
-
-
-
-}
-
diff --git a/Main/Core/NetworkPackage/ServerPack/H32_GM/H3202_tagServerResponse.cs b/Main/Core/NetworkPackage/ServerPack/H32_GM/H3202_tagServerResponse.cs
index be3bded..b9bdf7e 100644
--- a/Main/Core/NetworkPackage/ServerPack/H32_GM/H3202_tagServerResponse.cs
+++ b/Main/Core/NetworkPackage/ServerPack/H32_GM/H3202_tagServerResponse.cs
@@ -1,35 +1,19 @@
using UnityEngine;
using System.Collections;
-//32 02 服务器回应客户端消息#tagServerResponse
-
-
-
-public class H3202_tagServerResponse : GameNetPackBasic {
-
- public ushort Len;
-
- public string Message; //size = Len
-
-
-
- public H3202_tagServerResponse () {
-
- _cmd = (ushort)0x3202;
-
- }
-
-
-
- public override void ReadFromBytes (byte[] vBytes) {
-
- TransBytes (out Len, vBytes, NetDataType.WORD);
-
- TransBytes (out Message, vBytes, NetDataType.Chars, Len);
-
- }
-
-
-
-}
-
+//32 02 鏈嶅姟鍣ㄥ洖搴斿鎴风娑堟伅#tagServerResponse
+
+public class H3202_tagServerResponse : GameNetPackBasic {
+ public ushort Len;
+ public string Message; //size = Len
+
+ public H3202_tagServerResponse () {
+ _cmd = (ushort)0x3202;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Len, vBytes, NetDataType.WORD);
+ TransBytes (out Message, vBytes, NetDataType.Chars, Len);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs b/Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs
new file mode 100644
index 0000000..60c83d9
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs
@@ -0,0 +1,31 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 11 閫氱煡鐜╁澧冪晫淇℃伅 #tagMCSyncRealmInfo
+
+public class HA311_tagMCSyncRealmInfo : GameNetPackBasic {
+ public uint TaskAwardState; //杩涢樁浠诲姟棰嗗鐘舵�侊紱鎸変换鍔D浜岃繘鍒朵綅瀛樺偍鏄惁宸查鍙�
+ public byte TaskValueCount;
+ public tagMCSyncRealmTask[] TaskValueList; //杩涢樁浠诲姟鍊煎垪琛紝浠呮湁闇�瑕佽褰曠殑浠诲姟鎵嶄細閫氱煡
+
+ public HA311_tagMCSyncRealmInfo () {
+ _cmd = (ushort)0xA311;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out TaskAwardState, vBytes, NetDataType.DWORD);
+ TransBytes (out TaskValueCount, vBytes, NetDataType.BYTE);
+ TaskValueList = new tagMCSyncRealmTask[TaskValueCount];
+ for (int i = 0; i < TaskValueCount; i ++) {
+ TaskValueList[i] = new tagMCSyncRealmTask();
+ TransBytes (out TaskValueList[i].TaskID, vBytes, NetDataType.BYTE);
+ TransBytes (out TaskValueList[i].TaskValue, vBytes, NetDataType.DWORD);
+ }
+ }
+
+ public struct tagMCSyncRealmTask {
+ public byte TaskID;
+ public uint TaskValue;
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs.meta
index d92abdf..e30b40e 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/ServerPack/HA3_Function/HA311_tagMCSyncRealmInfo.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 236116d721b320347808b7aca2466b47
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs
new file mode 100644
index 0000000..cb08a99
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+
+//A9 21 瑙掕壊鏀瑰悕缁撴灉 #tagUpdatePlayerNameResult
+
+public class HA921_tagUpdatePlayerNameResult : GameNetPackBasic {
+ public byte Result; //瑙掕壊鏀瑰悕缁撴灉
+
+ public HA921_tagUpdatePlayerNameResult () {
+ _cmd = (ushort)0xA921;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Result, vBytes, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs.meta
index d92abdf..45353b2 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/ServerPack/HA9_Function/HA921_tagUpdatePlayerNameResult.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: bdc9e0587c135cc49a8b9b2ba79329e5
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs
new file mode 100644
index 0000000..3c05e98
--- /dev/null
+++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs
@@ -0,0 +1,33 @@
+using UnityEngine;
+using System.Collections;
+
+// B1 10 褰撳墠浠诲姟淇℃伅 #tagMCTaskInfo
+
+public class HB110_tagMCTaskInfo : GameNetPackBasic {
+ public byte TaskCount;
+ public tagMCTask[] TaskList;
+
+ public HB110_tagMCTaskInfo () {
+ _cmd = (ushort)0xB110;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out TaskCount, vBytes, NetDataType.BYTE);
+ TaskList = new tagMCTask[TaskCount];
+ for (int i = 0; i < TaskCount; i ++) {
+ TaskList[i] = new tagMCTask();
+ TransBytes (out TaskList[i].TaskGroup, vBytes, NetDataType.BYTE);
+ TransBytes (out TaskList[i].TaskID, vBytes, NetDataType.DWORD);
+ TransBytes (out TaskList[i].CurValue, vBytes, NetDataType.DWORD);
+ TransBytes (out TaskList[i].State, vBytes, NetDataType.BYTE);
+ }
+ }
+
+ public struct tagMCTask {
+ public byte TaskGroup; // 浠诲姟缁勶紝0-涓荤嚎
+ public uint TaskID; // 褰撳墠浠诲姟ID锛屽彲鑳戒负0锛岃〃绀鸿鍒嗙粍鏆傛椂娌℃湁浠诲姟
+ public uint CurValue; // 褰撳墠杩涘害鍊�
+ public byte State; // 浠诲姟鐘舵�� 1-杩涜涓� 2-鍙鍙�
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs.meta
index d92abdf..2957a65 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/Core/NetworkPackage/ServerPack/HB1_Role/HB110_tagMCTaskInfo.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: a4f9527e3b17c574b8c37e8594eb2ef2
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/Core/NetworkPackage/Socket/ClientSocket.cs b/Main/Core/NetworkPackage/Socket/ClientSocket.cs
index 6639be3..3055fe0 100644
--- a/Main/Core/NetworkPackage/Socket/ClientSocket.cs
+++ b/Main/Core/NetworkPackage/Socket/ClientSocket.cs
@@ -317,10 +317,10 @@
vNetpack = PackageRegedit.TransPack(socketType, cmd, vPackBytes);
if (vNetpack != null)
{
- if (Launch.Instance.EnableNetLog)
- {
- Debug.LogFormat("鏀跺寘锛歿0}", vNetpack.GetType().Name);
- }
+ // if (Launch.Instance.EnableNetLog)
+ // {
+ // Debug.LogFormat("鏀跺寘锛歿0}", vNetpack.GetType().Name);
+ // }
m_LastPackageTime = DateTime.Now;
GameNetSystem.Instance.PushPackage(vNetpack, this.socketType);
isRegist = true;
@@ -362,10 +362,10 @@
return;
}
- if (Launch.Instance.EnableNetLog)
- {
- Debug.LogFormat("鍙戝寘锛歿0}", protocol.GetType().Name);
- }
+ // if (Launch.Instance.EnableNetLog)
+ // {
+ // Debug.LogFormat("鍙戝寘锛歿0}", protocol.GetType().Name);
+ // }
if (protocol.combineBytes == null)
{
diff --git a/Main/Main.cs b/Main/Main.cs
index 9500691..abc05e0 100644
--- a/Main/Main.cs
+++ b/Main/Main.cs
@@ -67,6 +67,7 @@
managers.Add(CustomizedGiftModel.Instance);
managers.Add(ChatManager.Instance);
managers.Add(ChatBubbleManager.Instance);
+ managers.Add(OfficialRankManager.Instance);
foreach (var manager in managers)
{
diff --git a/Main/Manager/UIManager.cs b/Main/Manager/UIManager.cs
index 21187f3..b7a1d14 100644
--- a/Main/Manager/UIManager.cs
+++ b/Main/Manager/UIManager.cs
@@ -446,7 +446,9 @@
foreach (var ui in uiToClose)
{
// 璁板綍鏃ュ織
+#if UNITY_EDITOR
Debug.Log($"閿�姣侀暱鏃堕棿鏈娇鐢ㄧ殑UI: {ui.uiName}, 绌洪棽鍥炲悎鏁�: {currentRound - ui.lastUsedRound}");
+#endif
// 閿�姣乁I瀵硅薄
GameObject.Destroy(ui.gameObject);
}
@@ -614,7 +616,9 @@
if (closedUIDict.TryGetValue(uiName, out closedUIList) && closedUIList.Count > 0)
{
+ #if UNITY_EDITOR
Debug.Log("OpenWindow getFromClosedDict " + uiName);
+ #endif
returnValue = closedUIList[0] as UIBase;
closedUIList.RemoveAt(0);
@@ -626,7 +630,9 @@
}
else
{
+ #if UNITY_EDITOR
Debug.Log("OpenWindow getNewLoad " + uiName);
+ #endif
returnValue = LoadUIResource(uiName);
if (returnValue == null)
{
@@ -752,8 +758,9 @@
// 鑾峰彇UI绫诲瀷鍚嶇О
string uiName = ui.uiName;
-
+#if UNITY_EDITOR
Debug.Log("CloseWindow " + uiName + " destroy : " + destroy.ToString());
+#endif
// 鏀堕泦鎵�鏈夊瓙UI
List<UIBase> childrenUI = new List<UIBase>();
@@ -810,7 +817,7 @@
// 鍏抽棴UI
ui.HandleClose();
OnCloseWindow?.Invoke(ui);
-
+
if (destroy)
{
// 閿�姣乁I瀵硅薄
@@ -824,8 +831,10 @@
closedUIDict[uiName] = new List<UIBase>();
}
closedUIDict[uiName].Add(ui);
-
+
+#if UNITY_EDITOR
Debug.Log("CloseWindow " + uiName + " destroy : " + destroy.ToString() + " push to closedUIDict");
+#endif
// 闅愯棌UI (浜ょ粰handle close鍐呴儴鑷繁鍘诲仛)
// ui.gameObject.SetActive(false);
diff --git a/Main/System/AssetVersion/InGameDownLoad.cs b/Main/System/AssetVersion/InGameDownLoad.cs
index aab5dd9..dfcc104 100644
--- a/Main/System/AssetVersion/InGameDownLoad.cs
+++ b/Main/System/AssetVersion/InGameDownLoad.cs
@@ -169,10 +169,6 @@
state = State.None;
- // TODO YYL
- TaskManager.Event_MainlineTask -= OnMainTaskChange;
- TaskManager.Event_MainlineTask += OnMainTaskChange;
-
PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerLevelChange;
PlayerDatas.Instance.playerDataRefreshEvent += OnPlayerLevelChange;
}
@@ -311,8 +307,6 @@
//鎵�鏈変换鍔″畬鎴�
private void OnDownLoadFinished()
{
- // TODO YYL
- TaskManager.Event_MainlineTask -= OnMainTaskChange;
PlayerDatas.Instance.playerDataRefreshEvent -= OnPlayerLevelChange;
UIManager.Instance.CloseWindow<InGameDownLoadWin>();
@@ -578,19 +572,6 @@
}
}
- //涓荤嚎浠诲姟浠诲姟鐘舵�佸彉鏇村拰鍒锋柊
- private void OnMainTaskChange(int _taskId, int _state)
- {
- var mainTaskId = TaskManager.Instance.currentMission;
- if (GeneralDefine.inGameDownLoadTaskCheckPoints.Contains(mainTaskId)
- && TaskManager.Instance.currentMissionState == 1)
- {
- if (CheckDominantDownLoad())
- {
- TryDownLoad(Dominant.Whole);
- }
- }
- }
//鑾峰彇鏈�澶т笅杞戒换鍔℃暟
public int GetMaxTask()
diff --git a/Main/System/Debug/DebugController.cs b/Main/System/Debug/DebugController.cs
index fb8ae73..826e178 100644
--- a/Main/System/Debug/DebugController.cs
+++ b/Main/System/Debug/DebugController.cs
@@ -10,74 +10,29 @@
public class DebugController : MonoBehaviour
{
- // [SerializeField] FPS m_Fps;
- // [SerializeField] Toggle m_ToggleFPS;
+ [SerializeField] FPS m_Fps;
- // [SerializeField] DebugVersionShow m_DebugVersion;
- // [SerializeField] Toggle m_ToggleVersion;
+ [SerializeField] Text m_Version;
private void OnEnable()
{
- // if (m_Fps != null)
- // {
- // m_Fps.SetActive(m_ToggleFPS.isOn);
- // }
-
- // m_ToggleFPS.RemoveAllListeners();
- // m_ToggleFPS.AddListener(ToggleFPS);
-
- // if (m_DebugVersion != null)
- // {
- // m_DebugVersion.SetActive(m_ToggleVersion.isOn);
- // }
-
- // m_ToggleVersion.RemoveAllListeners();
- // m_ToggleVersion.AddListener(ToggleVersion);
+ m_Version.text = string.Format("{0}_{1} 鍒嗘敮:{2}",
+ VersionConfig.Get().version, VersionConfig.Get().buildIndex, VersionConfig.Get().branch);
}
- void ToggleFPS(bool _value)
- {
- // if (m_Fps != null)
- // {
- // m_Fps.SetActive(_value);
- // }
- }
-
- void ToggleVersion(bool _value)
- {
- // if (m_DebugVersion != null)
- // {
- // m_DebugVersion.SetActive(_value);
- // }
- }
public void OpenGM()
{
- // if (!WindowCenter.Instance.IsOpen<GMInputWin>())
- // {
- // WindowCenter.Instance.Open<GMInputWin>();
- // }
+ if (!UIManager.Instance.IsOpened<GMInputWin>())
+ {
+ UIManager.Instance.OpenWindow<GMInputWin>();
+ }
}
public void OpenGMCommond()
{
- // WindowCenter.Instance.Open<GMCmdPanel>();
+ UIManager.Instance.OpenWindow<GMCmdPanel>();
}
-
- // //public void SendSpecialCTG()
- // //{
- // // var model = ModelCenter.Instance.GetModel<VipModel>();
- // // var list = model.GetCTGConfigs(VersionConfig.Get().appId);
- // // for (int i = 0; i < list.Count; i++)
- // // {
- // // var config = CTGConfig.Get(list[i]);
- // // if (config.PayType == 4)
- // // {
- // // model.CTG(config.RecordID);
- // // return;
- // // }
- // // }
- // //}
public void CleanNewBranchSet()
{
@@ -85,13 +40,6 @@
ScrollTip.ShowTip("娓呯悊鍒嗘敮璁剧疆");
}
- public void PrintLastCrashLog()
- {
- // if (CrashReport.lastReport != null)
- // {
- // Debug.LogFormat("宕╂簝鏃ュ織:{0}", CrashReport.lastReport);
- // }
- }
}
diff --git a/Main/System/Debug/DebugLogRecorder.cs b/Main/System/Debug/DebugLogRecorder.cs
deleted file mode 100644
index 583d62f..0000000
--- a/Main/System/Debug/DebugLogRecorder.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-锘縰sing UnityEngine;
-using System.Collections;
-using UnityEngine.UI;
-using System.Collections.Generic;
-using System;
-
-
- public class DebugLogRecorder : MonoBehaviour
- {
-
- [SerializeField]
- Text m_LogPanel;
-
- List<LogData> logs = new List<LogData>();
- float timer = 0f;
-
- private void Awake()
- {
- }
-
- private void OnEnable()
- {
- LogRenderer();
- }
-
- private void LateUpdate()
- {
- timer += Time.deltaTime;
- if (timer > 1f)
- {
- timer = 0f;
- for (int i = logs.Count - 1; i >= 0; i--)
- {
- if (logs[i].dieTime < DateTime.Now)
- {
- logs.RemoveAt(i);
- }
- }
-
- LogRenderer();
- }
- }
-
- private void OnDisable()
- {
- logs.Clear();
- }
-
- private void OnDestroy()
- {
- }
-
- public void SetLogVisible()
- {
- Debug.developerConsoleVisible = !Debug.developerConsoleVisible;
- }
-
- void AddLogRenderer(string _log, string _callStack, LogType _type)
- {
- if (!DebugUtility.Instance.debugAccount)
- {
- return;
- }
-
- if (!LocalSave.GetBool("DebugDrawAtGameView"))
- {
- return;
- }
-
- bool allow = false;
- switch (_type)
- {
- case LogType.Log:
- allow = Launch.Instance.EnableLog || Launch.Instance.EnableNetLog;
- break;
- case LogType.Warning:
- allow = Launch.Instance.EnableLogWarning;
- break;
- case LogType.Error:
- case LogType.Exception:
- case LogType.Assert:
- allow = Launch.Instance.EnableLogError;
- break;
- }
-
- if (!allow)
- {
- return;
- }
-
- var content = string.Empty;
- if (LocalSave.GetBool("DebugCallStack"))
- {
- content = _log + "\n" + _callStack;
- }
- else
- {
- content = _log;
- }
-
- logs.Add(new LogData(_type, content, 5));
- if (logs.Count == 1)
- {
- timer = 0f;
- }
-
- LogRenderer();
- }
-
- void LogRenderer()
- {
- var contents = string.Empty;
- for (int i = logs.Count - 1; i >= 0; i--)
- {
- if (logs.Count - 1 == i)
- {
- contents += logs[i].content;
- }
- else
- {
- contents += "\n" + logs[i].content;
- }
- }
-
- if (contents.Length > 5000)
- {
- m_LogPanel.text = contents.Substring(contents.Length - 5000, 5000);
- }
- else
- {
- m_LogPanel.text = contents;
- }
-
- }
-
- struct LogData
- {
- public string content;
- public DateTime dieTime;
-
- public LogData(LogType _logType, string _content, int _seconds)
- {
- switch (_logType)
- {
- case LogType.Log:
- this.content = "[Log]: " + _content;
- break;
- case LogType.Warning:
- this.content = "[<color=yellow>Warning</color>]: " + _content;
- break;
- case LogType.Assert:
- this.content = "[<color=red>Assert</color>]: " + _content;
- break;
- case LogType.Exception:
- this.content = "[<color=red>Exception</color>]: " + _content;
- break;
- case LogType.Error:
- this.content = "[<color=red>Error</color>]: " + _content;
- break;
- default:
- this.content = _content;
- break;
- }
-
- this.dieTime = DateTime.Now + new TimeSpan(_seconds * TimeSpan.TicksPerSecond);
- }
- }
-
- }
-
-
-
-
diff --git a/Main/System/Debug/DebugLogRecorder.cs.meta b/Main/System/Debug/DebugLogRecorder.cs.meta
deleted file mode 100644
index 7e96bfc..0000000
--- a/Main/System/Debug/DebugLogRecorder.cs.meta
+++ /dev/null
@@ -1,12 +0,0 @@
-fileFormatVersion: 2
-guid: 34bc3df760d720048a9c8fe286d669bc
-timeCreated: 1502266121
-licenseType: Pro
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Main/System/Debug/DebugLogSetting.cs b/Main/System/Debug/DebugLogSetting.cs
deleted file mode 100644
index dd3b35d..0000000
--- a/Main/System/Debug/DebugLogSetting.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-锘縰sing UnityEngine;
-using System.Collections;
-using UnityEngine.UI;
-using System.Collections.Generic;
-using System;
-
-
-public class DebugLogSetting : MonoBehaviour
-{
-
- bool m_DrawLog {
- get { return LocalSave.GetBool("DebugDrawAtGameView", false); }
- set { LocalSave.SetBool("DebugDrawAtGameView", value); }
- }
-
- bool m_CallStack {
- get {
- return LocalSave.GetBool("DebugCallStack");
- }
- set {
- LocalSave.SetBool("DebugCallStack", value);
- }
- }
-
- [SerializeField]
- Toggle m_ToggleDrawLog;
- [SerializeField]
- Toggle m_ToggleLog;
- [SerializeField]
- Toggle m_ToggleWarning;
- [SerializeField]
- Toggle m_ToggleError;
-
- [SerializeField]
- Toggle m_ToggleNet;
-
- [SerializeField]
- Toggle m_ToggleCallStack;
-
- private void Awake()
- {
- m_ToggleDrawLog.isOn = m_DrawLog;
- m_ToggleLog.isOn = Launch.Instance.EnableLog;
- m_ToggleWarning.isOn = Launch.Instance.EnableLogWarning;
- m_ToggleError.isOn = Launch.Instance.EnableLogError;
- m_ToggleNet.isOn = Launch.Instance.EnableNetLog;
- m_ToggleCallStack.isOn = m_CallStack;
-
- m_ToggleDrawLog.AddListener(SetLogRenderActive);
- m_ToggleLog.AddListener(DebugUtility .SetLogAble);
- m_ToggleWarning.AddListener(DebugUtility.SetLogWarningAble);
- m_ToggleError.AddListener(DebugUtility.SetLogErrorAble);
- m_ToggleNet.AddListener(DebugUtility.SetLogNetAble);
- m_ToggleCallStack.AddListener(SetCallStackActive);
- }
-
- void SetLogRenderActive(bool _value)
- {
- m_DrawLog = _value;
- }
-
- void SetCallStackActive(bool _value)
- {
- m_CallStack = _value;
- }
-
-
-}
-
-
-
-
diff --git a/Main/System/Debug/DebugLogSetting.cs.meta b/Main/System/Debug/DebugLogSetting.cs.meta
deleted file mode 100644
index 27ee506..0000000
--- a/Main/System/Debug/DebugLogSetting.cs.meta
+++ /dev/null
@@ -1,12 +0,0 @@
-fileFormatVersion: 2
-guid: 0ea4b8d250c36c640ae1755b5f03aa4b
-timeCreated: 1504925918
-licenseType: Pro
-MonoImporter:
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Main/System/Debug/DebugUtility.cs b/Main/System/Debug/DebugUtility.cs
index 0ffdc01..01feb3f 100644
--- a/Main/System/Debug/DebugUtility.cs
+++ b/Main/System/Debug/DebugUtility.cs
@@ -12,7 +12,7 @@
GameObject debugRoot;
bool m_DebugAccount = false;
- public bool debugAccount
+ public bool debugAccount // 鏄惁寮�鍚痙ebug妯″紡
{
get { return m_DebugAccount; }
private set
@@ -20,19 +20,20 @@
if (m_DebugAccount != value)
{
m_DebugAccount = value;
- if (m_DebugAccount)
- {
- RunTimeExceptionUtility.Instance.Init();
- }
+ // if (m_DebugAccount)
+ // {
+ // RunTimeExceptionUtility.Instance.Init();
+ // }
}
}
}
public int debugBranch = -1;
-
+ //鏈嶅姟绔缃櫧鍚嶅崟锛�1.鍙墦寮�debug妯″紡 2. 鍙彁鍓嶇櫥褰曠淮鎶ゆ湇锛涚己鐐归渶瑕佽繍缁翠汉鍛橀厤鍚堜絾瀹夊叏
+ //鍏朵粬鍙傝��: 瀹㈡埛绔嚜宸辫缃殑debug妯″紡锛屽鍔燿ebug鏂囦欢锛涚己鐐癸細ios鏃犳硶鎿嶄綔
+ // 鑱婂ぉ璁剧疆鍒嗘敮鍚屾椂浼氬紑鍚痙ebug妯″紡锛屼紭鐐癸細浠讳綍鎯呭喌涓嬪彲浠ョ嫭绔嬫搷浣滐紝涓嶅畨鍏ㄤ絾鏃犲疄璐ㄦ�у奖鍝�
public bool isWhiteListAccount { get; set; }
- public bool autoLogin { get; private set; }
public void Init()
{
@@ -82,123 +83,20 @@
}
-
-
- if (debugAccount)
- {
- Launch.Instance.EnableLog = LocalSave.GetBool("DesignEnableLog", true);
- Launch.Instance.EnableLogWarning = LocalSave.GetBool("DesignEnableLogWarning", true);
- Launch.Instance.EnableLogError = LocalSave.GetBool("DesignEnableLogError", true);
- Launch.Instance.EnableNetLog = false;
- }
- else
- {
- Launch.Instance.EnableLog = false;
- Launch.Instance.EnableLogWarning = false;
- Launch.Instance.EnableLogError = false;
- Launch.Instance.EnableNetLog = false;
- }
-
- autoLogin = Resources.Load<TextAsset>("AutoLogin") != null;
- if (autoLogin)
- {
- var update = new LogicUpdate(3f);
- update.Start(OnAutoLoginUpdate);
- }
}
- private void OnAutoLoginUpdate()
- {
- // TODO YYL
- // if (StageLoad.Instance.currentStage is LoginStage)
- // {
- var loginWin = UIManager.Instance.GetUI<LoginWin>();
- if (loginWin != null)
- {
- var accountIpf = loginWin.transform.FindComponent("InputField", "Container_Account/AccountInput");
- if (accountIpf != null)
- {
- (accountIpf as InputField).text = StringUtility.Contact("Test_", UnityEngine.Random.Range(10000, 99999));
- }
-
- var enterGame = loginWin.transform.FindComponent("Button", "Container_EnterGame/LoginButton");
- (enterGame as Button).onClick.Invoke();
- }
- // }
-
-
- // if (StageLoad.Instance.currentStage is CreateRoleStage)
- // {
- // var win = WindowCenter.Instance.Get<CreateRoleWin>();
- // if (win != null)
- // {
- // var enterGame = win.transform.FindComponent("Button", "Container_Right/Btn_CreateRole");
- // if (enterGame is Button)
- // {
- // (enterGame as Button).onClick.Invoke();
- // }
- // }
- // }
- }
public void CreateDebugRoot()
{
if (debugRoot == null)
{
- // var prefab = BuiltInLoader.LoadPrefab("UIRootDebug");
- // debugRoot = GameObject.Instantiate(prefab);
- // MonoBehaviour.DontDestroyOnLoad(debugRoot);
- // debugRoot.name = "UIRootDebug";
+ var prefab = BuiltInLoader.LoadPrefab("UIRootDebug");
+ debugRoot = GameObject.Instantiate(prefab);
+ MonoBehaviour.DontDestroyOnLoad(debugRoot);
+ debugRoot.name = "UIRootDebug";
}
}
- public void RequestWhiteListAuthority(string _account)
- {
- //isWhiteListAccount = false;
- //var tables = new Dictionary<string, string>();
- //tables["channel"] = VersionConfig.Get().appId;
- //tables["player"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
- //tables["game"] = VersionConfig.Get().gameId;
-
- //HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(url, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType, 1, OnDebugAuthority);
- }
-
- private void OnDebugAuthority(bool _ok, string _result)
- {
- if (_ok)
- {
- var debugAuthority = JsonMapper.ToObject<DebugAuthority>(_result);
- isWhiteListAccount = debugAuthority.dbg == 1;
- }
- }
-
- public static void SetLogAble(bool _able)
- {
- LocalSave.SetBool("DesignEnableLog", _able);
- Launch.Instance.EnableLog = _able;
- }
-
- public static void SetLogWarningAble(bool _able)
- {
- LocalSave.SetBool("DesignEnableLogWarning", _able);
- Launch.Instance.EnableLogWarning = _able;
- }
-
- public static void SetLogErrorAble(bool _able)
- {
- LocalSave.SetBool("DesignEnableLogError", _able);
- Launch.Instance.EnableLogError = _able;
- }
-
- public static void SetLogNetAble(bool _able)
- {
- Launch.Instance.EnableNetLog = _able;
- }
-
- struct DebugAuthority
- {
- public int dbg;
- }
public class DebugBranch
{
diff --git a/Main/System/GMCommand/GMCmdPanel.cs b/Main/System/GMCommand/GMCmdPanel.cs
index ff6ded7..0df2d85 100644
--- a/Main/System/GMCommand/GMCmdPanel.cs
+++ b/Main/System/GMCommand/GMCmdPanel.cs
@@ -17,13 +17,16 @@
GMCmdManager _cmdModel;
GMCmdManager cmdModel{ get { return GMCmdManager.Instance; } }
+ protected override void InitComponent()
+ {
+ _closeBtn.AddListener(OnClickCloseBtn);
+ }
protected override void OnPreOpen()
{
base.OnPreOpen();
_cmdCtrl.OnRefreshCell += RefreshCmdCell;
- _closeBtn.onClick.AddListener(OnClickCloseBtn);
-
+
CreateCmdCell();
}
diff --git a/Main/System/GMCommand/GMInputWin.cs b/Main/System/GMCommand/GMInputWin.cs
index 42349e6..c8dedc9 100644
--- a/Main/System/GMCommand/GMInputWin.cs
+++ b/Main/System/GMCommand/GMInputWin.cs
@@ -36,18 +36,23 @@
private List<string> recordCmdlist;
GMCmdManager cmdModel { get { return GMCmdManager.Instance; } }
-
- protected override void OnPreOpen()
+ protected override void InitComponent()
{
- base.OnPreOpen();
- _cmdCtrl.OnRefreshCell += RefreshCmdCell;
_closeBtn.onClick.AddListener(OnClickCloseBtn);
_lookBtn.onClick.AddListener(OnClickLookBtn);
_sendBtn.onClick.AddListener(() => { OnClickSendBtn(); });
_gmInfoBtn.onClick.AddListener(OnClickGMInfoBtn);
_clearBtn.onClick.AddListener(OnClickClearBtn);
achieveJumpTestBtn.AddListener(ClickAchieveJumpBtn);
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ _cmdCtrl.OnRefreshCell += RefreshCmdCell;
+
_cmdContent.SetActive(false);
}
diff --git a/Main/System/Login/LoginManager.cs b/Main/System/Login/LoginManager.cs
index 0a44969..e914215 100644
--- a/Main/System/Login/LoginManager.cs
+++ b/Main/System/Login/LoginManager.cs
@@ -82,10 +82,6 @@
sdkLogined = true;
sdkLoginResult = _result;
- if (!DebugUtility.Instance.isWhiteListAccount)
- {
- DebugUtility.Instance.RequestWhiteListAuthority(sdkLoginResult.account);
- }
ServerListCenter.Instance.RequestServerListPlayer(sdkLoginResult.account);
SDKUtils.Instance.MakeKeyAndVisible();
@@ -317,22 +313,22 @@
send.ExtraLen = 0;
send.Extra = "";
break;
- case VersionAuthority.Release:
- {
- var deviceInfo = DeviceUtility.GetDeviceModel();
- deviceInfo.Replace(" ", "").Replace("=", "").Replace("%", "").Replace("-", "").Replace("|", "");
- var versionStr = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex, "_", deviceInfo);
-
+ case VersionAuthority.Release:
+ {
+ var deviceInfo = DeviceUtility.GetDeviceModel();
+ deviceInfo.Replace(" ", "").Replace("=", "").Replace("%", "").Replace("-", "").Replace("|", "");
+ var versionStr = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex, "_", deviceInfo);
+
send.Extra = StringUtility.Contact(VersionConfig.Get().SpID, "|",
SDKUtils.Instance.Device.uniqueID, "|",
sdkLoginResult.token, "|",
sdkLoginResult.qkUserName, "|",
- versionStr.Substring(0, Math.Min(24, versionStr.Length)));
-
-
- Debug.Log("=====> extra: " + send.Extra);
- send.ExtraLen = (ushort)send.Extra.Length;
-
+ versionStr.Substring(0, Math.Min(24, versionStr.Length)));
+
+
+ Debug.Log("=====> extra: " + send.Extra);
+ send.ExtraLen = (ushort)send.Extra.Length;
+
send.IDType = (byte)SDKUtils.Instance.ChannelPlatform;
send.Password = sdkLoginResult.token;
send.AccID = sdkLoginResult.account;
@@ -356,15 +352,15 @@
{
send.Adult = 0;
}
- break;
- }
+ break;
+ }
}
return send;
}
public string GetVersionStr()
- {
- return StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex, "_", InitialFunctionConfig.Get("version").Numerical1);
+ {
+ return StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex, "_", InitialFunctionConfig.Get("version").Numerical1);
}
}
diff --git a/Main/System/Main/HomeWin.cs b/Main/System/Main/HomeWin.cs
index 1341cba..e20f566 100644
--- a/Main/System/Main/HomeWin.cs
+++ b/Main/System/Main/HomeWin.cs
@@ -8,63 +8,161 @@
/// </summary>
public class HomeWin : UIBase
{
+ //澶村儚鍖�
[SerializeField] AvatarCell avatarCell;
[SerializeField] Text playerNameText;
[SerializeField] Text powerText;
- [SerializeField] Text rankName;
- [SerializeField] Text playerLevelText;
- [SerializeField] Slider expSlider;
+ [SerializeField] Text officialRankText;
[SerializeField] Text goldText;
- [SerializeField] Text diamondText;
+ [SerializeField] Text sparText;
+
+ //缁忛獙鍖�
+ [SerializeField] Text playerLevelText;
+ [SerializeField] SmoothSlider expSlider;
+
+ //浠诲姟鍖�
+ [SerializeField] Button taskButton; //寮曞鎴栬�呴鍙栦换鍔″鍔�
+ [SerializeField] RichText taskText;
+ [SerializeField] Text taskNumText;
+ [SerializeField] Image awardIcon;
+ [SerializeField] Text awardCnt;
+ [SerializeField] UIEffect taskEffect;
+
/// <summary>
/// 鍒濆鍖栫粍浠�
/// </summary>
protected override void InitComponent()
{
+ avatarCell.button.AddListener(() => { });
+ taskButton.AddListener(OnClickTaskButton);
}
-
-
-
+
+
+
public override void Refresh()
{
UpdatePlayerInfo();
UpdateCurrency();
+ UpdateTask();
}
protected override void OnPreOpen()
{
+ PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
+ TaskManager.Instance.OnTaskUpdate += UpdateTask;
Refresh();
}
- // protected override void OnPreClose()
- // {
- // }
-
+ protected override void OnPreClose()
+ {
+ PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+ TaskManager.Instance.OnTaskUpdate -= UpdateTask;
+ }
+
+ void PlayerDataRefresh(PlayerDataType type)
+ {
+ switch (type)
+ {
+ case PlayerDataType.FightPower:
+ powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint);
+ break;
+ case PlayerDataType.RealmLevel:
+ officialRankText.text = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel).Name;
+ break;
+ case PlayerDataType.TotalExp:
+ case PlayerDataType.ExpPoint:
+ ShowExp();
+ break;
+ case PlayerDataType.Gold:
+ goldText.text = UIHelper.GetMoneyCntEx(1).ToString();
+ break;
+ case PlayerDataType.default33:
+ sparText.text = UIHelper.GetMoneyCnt(42).ToString();
+ break;
+ case PlayerDataType.LV:
+ playerLevelText.text = PlayerDatas.Instance.baseData.LV.ToString();
+ break;
+ case PlayerDataType.Face:
+ case PlayerDataType.FacePic:
+ avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
+ PlayerDatas.Instance.baseData.face,
+ PlayerDatas.Instance.baseData.facePic));
+ break;
+ }
+
+
+ }
+
/// <summary>
/// 鏇存柊鐜╁淇℃伅
/// </summary>
private void UpdatePlayerInfo()
{
// 浠庣帺瀹舵暟鎹腑鑾峰彇淇℃伅骞舵洿鏂癠I
- // 渚嬪锛�
- // playerNameText.text = PlayerData.Instance.Name;
- // playerLevelText.text = "Lv." + PlayerData.Instance.Level;
- // powerText.text = PlayerData.Instance.Power.ToString();
- // expSlider.value = PlayerData.Instance.ExpRatio;
+ avatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID,
+ PlayerDatas.Instance.baseData.face,
+ PlayerDatas.Instance.baseData.facePic));
+
+ playerNameText.text = PlayerDatas.Instance.baseData.PlayerName;
+ playerLevelText.text = PlayerDatas.Instance.baseData.LV.ToString();
+ powerText.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPoint);
+
+ officialRankText.text = RealmConfig.Get(PlayerDatas.Instance.baseData.realmLevel).Name;
+
+ ShowExp();
+
}
-
+
+ void ShowExp()
+ {
+ var lvConfig = PlayerLVConfig.Get(PlayerDatas.Instance.baseData.LV);
+ expSlider.value = (float)PlayerDatas.Instance.baseData.curExp / lvConfig.EXP;
+ expSlider.Text.text = PlayerDatas.Instance.baseData.curExp + "/" + PlayerLVConfig.Get(PlayerDatas.Instance.baseData.LV).EXP;
+ }
+
/// <summary>
/// 鏇存柊璐у竵淇℃伅
/// </summary>
private void UpdateCurrency()
{
- // 浠庣帺瀹舵暟鎹腑鑾峰彇璐у竵淇℃伅骞舵洿鏂癠I
- // 渚嬪锛�
- // goldText.text = PlayerData.Instance.Gold.ToString();
- // diamondText.text = PlayerData.Instance.Diamond.ToString();
- // energyText.text = PlayerData.Instance.Energy + "/" + PlayerData.Instance.MaxEnergy;
+ goldText.text = UIHelper.GetMoneyCntEx(1).ToString();
+ sparText.text = UIHelper.ReplaceLargeNumEx(UIHelper.GetMoneyCnt(42));
}
-
-
+
+ void UpdateTask()
+ {
+ var task = TaskManager.Instance.mainTask;
+ if (task.TaskID == 0)
+ {
+ taskButton.SetActive(false);
+ }
+ else
+ {
+ taskButton.SetActive(true);
+ var taskConfig = TaskConfig.Get(task.TaskID);
+ taskText.text = taskConfig.TaskDescribe;
+ taskNumText.text = string.Format("({0}/{1})", task.CurValue, taskConfig.NeedValue);
+ taskNumText.color = task.CurValue >= taskConfig.NeedValue ? UIHelper.GetUIColor(TextColType.NavyBrown) : UIHelper.GetUIColor(TextColType.Red);
+ taskEffect.SetActive(TaskManager.Instance.GetMainTaskState() == 2);
+ awardIcon.SetSprite(ItemConfig.Get(taskConfig.AwardItemList[0][0]).IconKey);
+ awardCnt.text = taskConfig.AwardItemList[0][1].ToString();
+ }
+ }
+
+ void OnClickTaskButton()
+ {
+ if (TaskManager.Instance.GetMainTaskState() == 2)
+ {
+ //棰嗗彇浠诲姟濂栧姳
+ CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
+ getReward.RewardType = 66;
+ getReward.DataEx = (uint)TaskManager.Instance.mainTask.TaskID;
+ GameNetSystem.Instance.SendInfo(getReward);
+ }
+ else
+ {
+ //鏍规嵁浠诲姟绫诲瀷寮曞
+ }
+ }
}
\ No newline at end of file
diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index 0db0f0f..49e70e7 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -11,13 +11,15 @@
// 搴曢儴鎸夐挳缁�
public Button[] bottomTabButtons;
+ public Text hammerText;
+
// 褰撳墠閫変腑鐨勫簳閮ㄦ爣绛剧储寮�
private int currentTabIndex = 0;
// 褰撳墠鎵撳紑鐨勫瓙鐣岄潰
private UIBase currentSubUI;
-
+
/// <summary>
/// 鍒濆鍖栫粍浠�
/// </summary>
@@ -52,6 +54,7 @@
protected override void OnPreOpen()
{
+ PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
// 榛樿閫変腑绗竴涓爣绛�
SelectBottomTab(0);
@@ -59,10 +62,18 @@
Refresh();
}
- // protected override void OnPreClose()
- // {
- // }
-
+ protected override void OnPreClose()
+ {
+ PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
+ }
+
+ void PlayerDataRefresh(PlayerDataType type)
+ {
+ if (type == PlayerDataType.default26)
+ {
+ UpdateCurrency();
+ }
+ }
/// <summary>
@@ -70,11 +81,7 @@
/// </summary>
private void UpdateCurrency()
{
- // 浠庣帺瀹舵暟鎹腑鑾峰彇璐у竵淇℃伅骞舵洿鏂癠I
- // 渚嬪锛�
- // goldText.text = PlayerData.Instance.Gold.ToString();
- // diamondText.text = PlayerData.Instance.Diamond.ToString();
- // energyText.text = PlayerData.Instance.Energy + "/" + PlayerData.Instance.MaxEnergy;
+ hammerText.text = UIHelper.GetMoneyCnt(41).ToString();
}
/// <summary>
diff --git a/Main/System/Message/RichTableEvent.cs b/Main/System/Message/RichTableEvent.cs
index eb2a9d1..ec7423c 100644
--- a/Main/System/Message/RichTableEvent.cs
+++ b/Main/System/Message/RichTableEvent.cs
@@ -3,8 +3,6 @@
using UnityEngine;
-// TODO YYL
-
public class RichTableEvent : TRichTextEvent
{
public RichTableEvent()
@@ -15,448 +13,332 @@
public override bool Execute(RichTextEventEnum type, RichTextMgr.HrefInfo href)
{
- // switch (type)
- // {
- // case RichTextEventEnum.SHOWITEM:
- // {
- // var config = ItemConfig.Get(href.mSplits["showitem"]);
- // if (config != null)
- // {
- // DisplayItem(config.ID, href);
- // }
- // }
- // break;
- // }
+ switch (type)
+ {
+ case RichTextEventEnum.SHOWITEM:
+ {
+ var config = ItemConfig.Get(int.Parse(href.mSplits["showitem"]));
+ if (config != null)
+ {
+ DisplayItem(config.ID, href);
+ }
+ }
+ break;
+ }
return false;
}
public override string GetDisplay(RichTextEventEnum type, Dictionary<string, string> _dict)
{
- // switch (type)
- // {
- // case RichTextEventEnum.TABLE:
- // {
- // if (_dict.ContainsKey("info"))
- // {
- // string info = _dict["info"];
- // switch (info)
- // {
- // case "richtextmsgreplace":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // return RichTextMsgReplaceConfig.GetRichReplace(_dict["name"], id);
- // }
- // }
- // break;
- // case "item":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // ItemConfig cfg = ItemConfig.Get(id);
- // if (cfg != null)
- // {
- // var _itemColor = cfg.ItemColor;
- // if (ItemLogicUtility.Instance.IsWing(id))//缈呰唨
- // {
- // Dictionary<int, List<int>> userdata = null;
- // if (TryGetUserData(_dict, out userdata))
- // {
- // _itemColor = ItemLogicUtility.Instance.GetItemQuality(cfg.ID, userdata);
- // }
- // }
- // var itemName = cfg.ItemName;
- // if (_dict.ContainsKey("chatsend"))
- // {
- // itemName = StringUtility.Contact("[", itemName, "]");
- // }
- // if (_dict.ContainsKey("count"))
- // {
- // var count = 0;
- // int.TryParse(_dict["count"], out count);
- // if (count > 0)
- // {
- // itemName = StringUtility.Contact(itemName, "x", count);
- // }
- // }
- // var suitLabel = string.Empty;
- // if (!_dict.ContainsKey("chatsend"))
- // {
- // var text = RichTextMgr.Inst.presentRichText;
- // int colorType = 0;
- // if (text != null)
- // {
- // colorType = text.colorType == RichText.ColorType.Dark ? 0 : 1;
- // }
- // if (ItemLogicUtility.Instance.IsSuitEquip(id))
- // {
- // suitLabel = StringUtility.Contact("<Suitname=", UIHelper.GetEquipSuitName(id, colorType == 1), "/>|");
- // }
- // }
- // return StringUtility.Contact(suitLabel, AppendColor(itemName, _itemColor, _dict));
- // }
- // else
- // {
- // Debug.LogError(string.Format("鐗╁搧琛ㄩ噷娌℃湁ID{0}瀵瑰簲鐨勭墿鍝�", id));
- // }
- // }
- // }
- // break;
- // case "npc":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // NPCConfig cfg = NPCConfig.Get(id);
- // if (cfg != null)
- // {
- // return cfg.charName;
- // }
- // }
- // }
- // break;
- // case "map":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // var lineId = 0;
- // if (_dict.ContainsKey("lineid") && int.TryParse(_dict["lineid"], out lineId))
- // {
- // var mapResourceConfig = MapResourcesConfig.GetConfig(id, lineId);
- // if (mapResourceConfig != null)
- // {
- // return mapResourceConfig.Name;
- // }
- // }
- // MapConfig cfg = MapConfig.Get(id);
- // if (cfg != null)
- // {
- // return cfg.Name;
- // }
- // }
- // }
- // break;
- // case "skill":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // SkillConfig cfg = SkillConfig.Get(id);
- // if (cfg != null)
- // {
- // return cfg.SkillName;
- // }
- // }
- // }
- // break;
- // case "fairyquestion":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // QuestionBankConfig cfg = QuestionBankConfig.Get(id);
- // if (cfg != null)
- // {
- // return cfg.question;
- // }
- // }
- // }
- // break;
- // case "runetower":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // RuneTowerConfig cfg = RuneTowerConfig.Get(id);
- // if (cfg != null)
- // {
- // return cfg.TowerName;
- // }
- // }
- // }
- // break;
- // case "realm":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // RealmConfig _cfg = RealmConfig.Get(id);
- // if (_cfg != null)
- // {
- // var text = RichTextMgr.Inst.presentRichText;
- // int colorType = 0;
- // if (text != null)
- // {
- // colorType = text.colorType == RichText.ColorType.Dark ? 0 : 1;
- // }
- // return UIHelper.GetRealmName(id, colorType == 1);
- // }
- // }
- // }
- // break;
- // case "pet":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // PetInfoConfig _cfg = PetInfoConfig.Get(id);
- // if (_cfg != null)
- // {
- // return AppendColor(_cfg.Name, _cfg.Quality, _dict);
- // }
- // }
- // }
- // break;
- // case "alchemy":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // AlchemyConfig _cfg = AlchemyConfig.Get(id);
- // if (_cfg != null)
- // {
- // return _cfg.AlchemName;
- // }
- // }
- // }
- // break;
- // case "treasure":
- // {
- // int id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
- // {
- // TreasureConfig _cfg = TreasureConfig.Get(id);
- // if (_cfg != null)
- // {
- // return _cfg.Name;
- // }
- // }
- // }
- // break;
- // case "godweapon":
- // {
- // var _type = 0;
- // if (_dict.ContainsKey("type") && int.TryParse(_dict["type"], out _type))
- // {
- // var _cfg = GodWeaponConfig.GetConfig(_type, 1);
- // if (_cfg != null)
- // {
- // return _cfg.Name;
- // }
- // }
- // }
- // break;
- // case "buffdesc":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var _cfg = SkillConfig.Get(_id);
- // if (_cfg != null)
- // {
- // return _cfg.BuffDescription;
- // }
- // }
- // }
- // break;
- // case "property":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var _cfg = PlayerPropertyConfig.Get(_id);
- // if (_cfg != null)
- // {
- // return _cfg.Name;
- // }
- // }
- // }
- // break;
- // case "mount":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var _cfg = HorseConfig.Get(_id);
- // if (_cfg != null)
- // {
- // return AppendColor(_cfg.Name, _cfg.Quality, _dict);
- // }
- // }
- // }
- // break;
- // case "success":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var _cfg = SuccessConfig.Get(_id);
- // if (_cfg != null)
- // {
- // return _cfg.Describe;
- // }
- // }
- // }
- // break;
- // case "osredenvelope":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var _cfg = OSRedAchieveConfig.Get(_id);
- // if (_cfg != null)
- // {
- // return _cfg.typeName;
- // }
- // }
- // }
- // break;
- // case "treasureprivilege":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var _cfg = TreasurePrivilegeConfig.Get(_id);
- // if (_cfg != null)
- // {
- // return _cfg.Name;
- // }
- // }
- // }
- // break;
- // case "towernewrune":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var config = RuneTowerConfig.Get(_id + 1);
- // if (config != null)
- // {
- // var itemConfig = ItemConfig.Get(config.ProductRune);
- // return itemConfig.ItemName;
- // }
- // var towerFloor = RuneTowerFloorConfig.Get(_id * 100 + 8);
- // if (config != null)
- // {
- // var itemConfig = ItemConfig.Get(towerFloor.UnLockCompose);
- // return itemConfig.ItemName;
- // }
- // }
- // }
- // break;
- // case "runetowerfloor":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var config = RuneTowerFloorConfig.Get(_id);
- // if (config != null)
- // {
- // var towerConfig = RuneTowerConfig.Get(config.TowerId);
- // return StringUtility.Contact(towerConfig.TowerName, config.FloorName);
- // }
- // }
- // }
- // break;
- // case "skytowerfloor":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var config = SkyTowerConfig.Get(_id);
- // if (config != null)
- // {
- // return config.floorName;
- // }
- // }
- // }
- // break;
- // case "coloritem":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var config = ItemConfig.Get(_id);
- // if (config != null)
- // {
- // return StringUtility.Contact(GetItemColorName(config.ItemColor), AppendColor(config.ItemName, config.ItemColor, _dict));
- // }
- // }
- // }
- // break;
- // case "crossserverarena":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // var text = RichTextMgr.Inst.presentRichText;
- // int colorType = 0;
- // if (text != null)
- // {
- // colorType = text.colorType == RichText.ColorType.Dark ? 0 : 1;
- // }
- // return UIHelper.AppendDanLVNameColor(_id, colorType == 1);
- // }
- // }
- // break;
- // case "equipsuitname":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // return EquipSuitConfig.GetEquipSuitName(_id);
- // }
- // }
- // break;
- // case "title":
- // {
- // var _id = 0;
- // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
- // {
- // return UIHelper.AppendColor(TextColType.Green, DienstgradConfig.Get(_id).Name, true);
- // }
- // }
- // break;
- // case "orderInfo":
- // {
- // if (_dict.ContainsKey("id"))
- // {
- // var cpInfo = _dict["id"];
- // string goodsName = string.Empty;
- // OrderInfoConfig orderInfo = null;
- // VipModel vipModel = ModelCenter.Instance.GetModel<VipModel>();
- // if (vipModel.orderInfoToCTGID[cpInfo] != 0)
- // {
- // vipModel.TryGetOrderInfo(vipModel.orderInfoToCTGID[cpInfo], out orderInfo);
- // goodsName = CTGConfig.Get(vipModel.orderInfoToCTGID[cpInfo]).Title;
- // }
- // else
- // {
- // var keys = OrderInfoConfig.GetKeys();
- // for (int i = 0; i < keys.Count; i++)
- // {
- // orderInfo = OrderInfoConfig.Get(keys[i]);
- // if (orderInfo != null && orderInfo.OrderInfo == cpInfo)
- // {
- // break;
- // }
- // }
- // goodsName = Language.Get("DayGoods_1", UIHelper.GetMoneyFormat(orderInfo.PayRMBNum));
- // }
+ switch (type)
+ {
+ case RichTextEventEnum.TABLE:
+ {
+ if (_dict.ContainsKey("info"))
+ {
+ string info = _dict["info"];
+ switch (info)
+ {
+ case "richtextmsgreplace":
+ {
+ int id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
+ {
+ return RichTextMsgReplaceConfig.GetRichReplace(_dict["name"], id);
+ }
+ }
+ break;
+ case "item":
+ {
+ int id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
+ {
+ ItemConfig cfg = ItemConfig.Get(id);
+ if (cfg != null)
+ {
+ var _itemColor = cfg.ItemColor;
+ if (ItemLogicUtility.Instance.IsWing(id))//缈呰唨
+ {
+ Dictionary<int, List<int>> userdata = null;
+ if (TryGetUserData(_dict, out userdata))
+ {
+ _itemColor = ItemLogicUtility.Instance.GetItemQuality(cfg.ID, userdata);
+ }
+ }
+ var itemName = cfg.ItemName;
+ if (_dict.ContainsKey("chatsend"))
+ {
+ itemName = StringUtility.Contact("[", itemName, "]");
+ }
+ if (_dict.ContainsKey("count"))
+ {
+ var count = 0;
+ int.TryParse(_dict["count"], out count);
+ if (count > 0)
+ {
+ itemName = StringUtility.Contact(itemName, "x", count);
+ }
+ }
+ var suitLabel = string.Empty;
+ if (!_dict.ContainsKey("chatsend"))
+ {
+ var text = RichTextMgr.Inst.presentRichText;
+ int colorType = 0;
+ if (text != null)
+ {
+ colorType = text.colorType == RichText.ColorType.Dark ? 0 : 1;
+ }
+ // if (ItemLogicUtility.Instance.IsSuitEquip(id))
+ // {
+ // suitLabel = StringUtility.Contact("<Suitname=", UIHelper.GetEquipSuitName(id, colorType == 1), "/>|");
+ // }
+ }
+ return StringUtility.Contact(suitLabel, AppendColor(itemName, _itemColor, _dict));
+ }
+ else
+ {
+ Debug.LogError(string.Format("鐗╁搧琛ㄩ噷娌℃湁ID{0}瀵瑰簲鐨勭墿鍝�", id));
+ }
+ }
+ }
+ break;
+ case "npc":
+ {
+ int id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
+ {
+ NPCConfig cfg = NPCConfig.Get(id);
+ if (cfg != null)
+ {
+ return cfg.charName;
+ }
+ }
+ }
+ break;
+ case "map":
+ {
+ // int id = 0;
+ // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
+ // {
+ // var lineId = 0;
+ // if (_dict.ContainsKey("lineid") && int.TryParse(_dict["lineid"], out lineId))
+ // {
+ // var mapResourceConfig = MapResourcesConfig.GetConfig(id, lineId);
+ // if (mapResourceConfig != null)
+ // {
+ // return mapResourceConfig.Name;
+ // }
+ // }
+ // MapConfig cfg = MapConfig.Get(id);
+ // if (cfg != null)
+ // {
+ // return cfg.Name;
+ // }
+ // }
+ return "map";
+ }
+ break;
+ case "skill":
+ {
+ int id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
+ {
+ SkillConfig cfg = SkillConfig.Get(id);
+ if (cfg != null)
+ {
+ return cfg.SkillName;
+ }
+ }
+ }
+ break;
+ case "realm":
+ {
+ int id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
+ {
+ RealmConfig _cfg = RealmConfig.Get(id);
+ if (_cfg != null)
+ {
+ var text = RichTextMgr.Inst.presentRichText;
+ int colorType = 0;
+ if (text != null)
+ {
+ colorType = text.colorType == RichText.ColorType.Dark ? 0 : 1;
+ }
+ return UIHelper.GetRealmName(id, colorType == 1);
+ }
+ }
+ }
+ break;
+ case "pet":
+ {
+ // int id = 0;
+ // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out id))
+ // {
+ // PetInfoConfig _cfg = PetInfoConfig.Get(id);
+ // if (_cfg != null)
+ // {
+ // return AppendColor(_cfg.Name, _cfg.Quality, _dict);
+ // }
+ // }
+ return "pet";
+ }
+ break;
+ case "buffdesc":
+ {
+ var _id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ {
+ var _cfg = SkillConfig.Get(_id);
+ if (_cfg != null)
+ {
+ return _cfg.BuffDescription;
+ }
+ }
+ }
+ break;
+ case "property":
+ {
+ var _id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ {
+ var _cfg = PlayerPropertyConfig.Get(_id);
+ if (_cfg != null)
+ {
+ return _cfg.Name;
+ }
+ }
+ }
+ break;
+ case "mount":
+ {
+ // var _id = 0;
+ // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ // {
+ // var _cfg = HorseConfig.Get(_id);
+ // if (_cfg != null)
+ // {
+ // return AppendColor(_cfg.Name, _cfg.Quality, _dict);
+ // }
+ // }
+ }
+ break;
+ case "success":
+ {
+ var _id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ {
+ var _cfg = SuccessConfig.Get(_id);
+ if (_cfg != null)
+ {
+ return _cfg.Describe;
+ }
+ }
+ }
+ break;
- // return goodsName;
- // }
- // }
- // break;
- // }
- // }
- // }
- // break;
- // }
+ case "treasureprivilege":
+ {
+ // var _id = 0;
+ // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ // {
+ // var _cfg = TreasurePrivilegeConfig.Get(_id);
+ // if (_cfg != null)
+ // {
+ // return _cfg.Name;
+ // }
+ // }
+ return "treasureprivilege";
+ }
+ break;
+
+ // case "skytowerfloor":
+ // {
+ // var _id = 0;
+ // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ // {
+ // var config = SkyTowerConfig.Get(_id);
+ // if (config != null)
+ // {
+ // return config.floorName;
+ // }
+ // }
+ // }
+ // break;
+ case "coloritem":
+ {
+ var _id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ {
+ var config = ItemConfig.Get(_id);
+ if (config != null)
+ {
+ return StringUtility.Contact(GetItemColorName(config.ItemColor), AppendColor(config.ItemName, config.ItemColor, _dict));
+ }
+ }
+ }
+ break;
+ // case "crossserverarena":
+ // {
+ // var _id = 0;
+ // if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ // {
+ // var text = RichTextMgr.Inst.presentRichText;
+ // int colorType = 0;
+ // if (text != null)
+ // {
+ // colorType = text.colorType == RichText.ColorType.Dark ? 0 : 1;
+ // }
+ // return UIHelper.AppendDanLVNameColor(_id, colorType == 1);
+ // }
+ // }
+ // break;
+
+ case "title":
+ {
+ var _id = 0;
+ if (_dict.ContainsKey("id") && int.TryParse(_dict["id"], out _id))
+ {
+ return UIHelper.AppendColor(TextColType.Green, DienstgradConfig.Get(_id).Name, true);
+ }
+ }
+ break;
+ case "orderInfo":
+ {
+ if (_dict.ContainsKey("id"))
+ {
+ var cpInfo = _dict["id"];
+ string goodsName = string.Empty;
+ OrderInfoConfig orderInfo = null;
+ if (RechargeManager.Instance.orderInfoToCTGID[cpInfo] != 0)
+ {
+ RechargeManager.Instance.TryGetOrderInfo(RechargeManager.Instance.orderInfoToCTGID[cpInfo], out orderInfo);
+ goodsName = CTGConfig.Get(RechargeManager.Instance.orderInfoToCTGID[cpInfo]).Title;
+ }
+ else
+ {
+ var keys = OrderInfoConfig.GetKeys();
+ for (int i = 0; i < keys.Count; i++)
+ {
+ orderInfo = OrderInfoConfig.Get(keys[i]);
+ if (orderInfo != null && orderInfo.OrderInfo == cpInfo)
+ {
+ break;
+ }
+ }
+ goodsName = Language.Get("DayGoods_1", UIHelper.GetMoneyFormat(orderInfo.PayRMBNum));
+ }
+
+ return goodsName;
+ }
+ }
+ break;
+ }
+ }
+ }
+ break;
+ }
return string.Empty;
}
@@ -529,18 +411,18 @@
return UIHelper.AppendColor(_itemColor, info, colorType == 1);
}
- // static bool TryGetUserData(Dictionary<string, string> href, out Dictionary<int, List<int>> userdata)
- // {
- // // userdata = null;
- // // if (href.ContainsKey("itemplus"))
- // // {
- // // var itemplus = LitJson.JsonMapper.ToObject<ItemTipUtility.CustomItemPlus>(href["itemplus"]);
- // // userdata = ConfigParse.Analysis(itemplus.UserData);
- // // }
- // // else if (href.ContainsKey("userdata"))
- // // {
- // // userdata = ConfigParse.Analysis(href["userdata"]);
- // // }
- // return false;
- // }
+ static bool TryGetUserData(Dictionary<string, string> href, out Dictionary<int, List<int>> userdata)
+ {
+ userdata = null;
+ if (href.ContainsKey("itemplus"))
+ {
+ var itemplus = LitJson.JsonMapper.ToObject<ItemTipUtility.CustomItemPlus>(href["itemplus"]);
+ userdata = ConfigParse.Analysis(itemplus.UserData);
+ }
+ else if (href.ContainsKey("userdata"))
+ {
+ userdata = ConfigParse.Analysis(href["userdata"]);
+ }
+ return false;
+ }
}
diff --git a/Main/System/Message/SysNotifyMgr.cs b/Main/System/Message/SysNotifyMgr.cs
index 414ed80..8726da1 100644
--- a/Main/System/Message/SysNotifyMgr.cs
+++ b/Main/System/Message/SysNotifyMgr.cs
@@ -158,6 +158,10 @@
tipInfoList.AddRange(msg);
AnalysisSysmsg(cfg);
}
+ else
+ {
+ Debug.LogError("鏈壘鍒扮郴缁熸彁绀轰俊鎭�: " + key);
+ }
}
void AnalysisSysmsg(SysInfoConfig cfg)
diff --git a/Main/System/OfficialRank.meta b/Main/System/OfficialRank.meta
new file mode 100644
index 0000000..6b6892e
--- /dev/null
+++ b/Main/System/OfficialRank.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0600c139dec25884fa4a6885698d410e
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/OfficialRank/OfficialRankManager.cs b/Main/System/OfficialRank/OfficialRankManager.cs
new file mode 100644
index 0000000..2685526
--- /dev/null
+++ b/Main/System/OfficialRank/OfficialRankManager.cs
@@ -0,0 +1,131 @@
+
+
+using System;
+using System.Collections.Generic;
+
+public class OfficialRankManager : GameSystemManager<OfficialRankManager>
+{
+ bool redpointDirty = false;
+
+ #region 瀹樿亴浠诲姟
+ //褰撳墠瀹樿亴鐨勪换鍔$姸鎬�
+ int taskAwardState;
+ Dictionary<int, int> taskValues = new Dictionary<int, int>();
+ public Dictionary<int, int[]> realMissionGuides = new Dictionary<int, int[]>();
+ public event Action RealmMissionRefreshEvent;
+
+ // 杩斿洖鏈嶅姟绔殑璁板綍浠诲姟濂栧姳鐘舵�� 0鏈鍙� 1宸查鍙�
+ public int GetMissionAwardState(int id)
+ {
+ return (taskAwardState & (int)Math.Pow(2, id)) != 0 ? 1 : 0;
+ }
+
+ //浠诲姟绫诲瀷 浠诲姟璇存槑 鎵�闇�鍊�
+ // 1 绛夌骇杈惧埌x绾� x绾�
+ // 2 閫氬叧x鍦板浘x灞� 鍦板浘ID|灞�
+ // 3 娑堣�楁垬閿� x涓�
+
+ //瀹㈡埛绔樉绀虹殑浠诲姟鐘舵�� 0 浠h〃杩涜涓� 1 浠h〃鍙鍙� 2 浠h〃宸查鍙�
+ public int GetMissionState(int realm, int missionID)
+ {
+ var id = RealmLVUPTaskConfig.GetID(realm, missionID);
+ var config = RealmLVUPTaskConfig.Get(id);
+ var type = config.TaskType;
+
+ if (GetMissionAwardState(missionID) == 1)
+ {
+ return 2;
+ }
+
+ switch (type)
+ {
+ case 1:
+ return PlayerDatas.Instance.baseData.LV >= config.NeedValueList[0] ? 1 : 0;
+ case 2:
+ if (config.NeedValueList[0] == 0)
+ {
+ return 0;
+ }
+ return 0;
+ case 3:
+ return taskValues.ContainsKey(missionID) && taskValues[missionID] >= config.NeedValueList[0] ? 1 : 0;
+
+ default:
+ return 0;
+ }
+
+ }
+
+ public int GetMissionProcess(int id)
+ {
+ if (taskValues.ContainsKey(id))
+ {
+ return taskValues[id];
+ }
+ return 0;
+ }
+
+ //type: 1绛夌骇 2閫氬叧 3娑堣�楁垬閿�
+
+ public void RealMissionGuide(int type, int id = 0)
+ {
+ if (realMissionGuides.ContainsKey(type))
+ {
+
+ int guideIndex = 0;
+ if (type == 1)
+ {
+
+ }
+ else if (type == 2)
+ {
+ if (!FuncOpen.Instance.IsFuncOpen(164, true))
+ {
+ return;
+ }
+ }
+ else if (type == 3)
+ {
+ if (FuncOpen.Instance.IsFuncOpen(108))
+ {
+ guideIndex = 1;
+ }
+ }
+
+
+ //NewBieCenter.Instance.StartNewBieGuideEx(guideID);
+ }
+
+ }
+
+
+ public void RequestAllAwards()
+ {
+ var missisons = RealmLVUPTaskConfig.GetMissionIDs(PlayerDatas.Instance.baseData.realmLevel);
+ for (int i = 0; i < missisons.Count; i++)
+ {
+ var state = GetMissionState(PlayerDatas.Instance.baseData.realmLevel, missisons[i]);
+ if (state == 1)
+ {
+ CA504_tagCMPlayerGetReward pak = new CA504_tagCMPlayerGetReward();
+ pak.RewardType = 68;
+ pak.DataEx = (uint)missisons[i];
+ GameNetSystem.Instance.SendInfo(pak);
+ }
+ }
+ }
+
+ #endregion
+
+ public void ReceivePackage(HA311_tagMCSyncRealmInfo package)
+ {
+ taskAwardState = (int)package.TaskAwardState;
+ for (int i = 0; i < package.TaskValueCount; i++)
+ {
+ taskValues[package.TaskValueList[i].TaskID] = (int)package.TaskValueList[i].TaskValue;
+ }
+
+ RealmMissionRefreshEvent?.Invoke();
+ redpointDirty = true;
+ }
+}
diff --git a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta b/Main/System/OfficialRank/OfficialRankManager.cs.meta
similarity index 83%
copy from Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
copy to Main/System/OfficialRank/OfficialRankManager.cs.meta
index d92abdf..cac54a0 100644
--- a/Main/Core/NetworkPackage/ServerPack/H08_Event/H0820_tagMissionDict.cs.meta
+++ b/Main/System/OfficialRank/OfficialRankManager.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: a29fffee1fddfb8498cdfd5ff5225cd4
+guid: 0b11e558a5ef66f4db9ca27b2108c8a4
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs b/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
index 89ce304..7051c11 100644
--- a/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
+++ b/Main/System/PhantasmPavilion/PhantasmPavilionModel.cs
@@ -132,9 +132,9 @@
{
nowIDDict[PhantasmPavilionTab.Avatar] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.Face);
}
- else if (type == PlayerDataType.HairColor)
+ else if (type == PlayerDataType.FacePic)
{
- nowIDDict[PhantasmPavilionTab.AvatarFrame] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.HairColor);
+ nowIDDict[PhantasmPavilionTab.AvatarFrame] = (int)PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.FacePic);
}
else if (type == PlayerDataType.ExAttr10)
{
diff --git a/Main/System/Task/TaskManager.cs b/Main/System/Task/TaskManager.cs
index 7bb2e2d..54c522b 100644
--- a/Main/System/Task/TaskManager.cs
+++ b/Main/System/Task/TaskManager.cs
@@ -5,1802 +5,73 @@
using LitJson;
using System.Text.RegularExpressions;
using System.Text;
+using UnityEngine.Events;
//浠诲姟淇℃伅鐨勫瓨鍌�
/** 浠诲姟缁撴瀯 */
-public class MissionDetailDates
+public class TaskDetailDates
{
- public DateTime Time;//璁板綍鏃堕棿
- public int ID;//浠诲姟ID
- public string Name;//浠诲姟鍚嶇О
- public int Type;//浠诲姟绫诲瀷
- public int NPC_ID;//璧峰NPCID
- public int LV;//鍙帴绛夌骇
- public int ColorLV;//浠诲姟闅惧害
- public string Desclist;//浠诲姟璇︽儏
- public string RewardList;//濂栧姳淇℃伅
- public List<TsakLight> LightList;//浠诲姟鐏俊鎭�
- public string InforList;//浠诲姟瀹屾垚鏉′欢
- public int MissionState;//浠诲姟鐘舵��0鏈帴锛�1杩涜涓紝2鍙彁浜わ紝3宸插畬鎴�,6鐗规畩鍗$骇
- public int descIndex;//浠诲姟鎻忚堪绱㈠紩
+ public int TaskGroup; // 浠诲姟缁勶紝0-涓荤嚎
+ public int TaskID; // 褰撳墠浠诲姟ID锛屽彲鑳戒负0锛岃〃绀鸿鍒嗙粍鏆傛椂娌℃湁浠诲姟
+ public int CurValue; // 褰撳墠杩涘害鍊�
+ public int State; // 浠诲姟鐘舵�� 1-杩涜涓� 2-鍙鍙�
}
-
-public class MissionDict//浠诲姟瀛楀吀淇℃伅
+public enum TaskTypenum//浠诲姟绫诲瀷鍒嗙被
{
- public int MissionId;//浠诲姟ID
-
- public int DictKeyLen;//浠诲姟瀛楀吀涓殑鏌愪釜Key
-
- public string DictKey;//key鐨勯暱搴�
-
- public int DictValue;//璇ey瀵瑰簲鐨勫��
-
+ MainlineTaskType = 0,//涓荤嚎
+ SideQuestsType = 1,//鏀嚎
}
-public class RunTaskAwardRecord
-{
- public int Num;
- public int AwardState;
-}
-
-public struct TsakLight
-{
- public int NpcId;
- public int StateLight;
-}
-
public class TaskManager : GameSystemManager<TaskManager>
{
-
- /** 浠诲姟鎬绘竻鍗� */
- public static bool _globalbool = false;
- public Dictionary<int, MissionDetailDates> allMissionDict = new Dictionary<int, MissionDetailDates>();//浠诲姟鍒濆鍖栨帴鏀跺瓧鍏�
- public Dictionary<int, MissionDetailDates> MainTaskDic = new Dictionary<int, MissionDetailDates>();//涓荤嚎浠诲姟瀛楀吀
- public Dictionary<int, MissionDetailDates> SideQuestsDic = new Dictionary<int, MissionDetailDates>();//鏀嚎浠诲姟瀛楀吀
- public Dictionary<int, MissionDetailDates> BountyDic = new Dictionary<int, MissionDetailDates>();//璧忛噾浠诲姟
- public Dictionary<int, MissionDetailDates> FairyAuDic = new Dictionary<int, MissionDetailDates>();//浠欑洘浠诲姟
- public int FairyAuTaskCount_Day { get; private set; }
- public int FairyAuTaskCount_Round { get; private set; }
- public Dictionary<int, MissionDetailDates> SpecialTask = new Dictionary<int, MissionDetailDates>();//鐗规畩浠诲姟绫诲瀷
- public Dictionary<int, Dictionary<string, string>> _DicTaskInformation = new Dictionary<int, Dictionary<string, string>>();//浠诲姟瀛楀吀鐨勪俊鎭�
- 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);
- public static event OnTaskRefreshes Event_TaskRefreshes;//浠诲姟鐨勫埛鏂�
- public delegate void OnBounty();//璧忛噾浠诲姟鐨勬坊鍔�
- public static event OnBounty Event_nBounty;
- public delegate void OnFairyAuTask();//浠欑洘浠诲姟鐨勬坊鍔犲拰鍒锋柊
- public static event OnFairyAuTask Event_FairyAuTask;
-
- public delegate void OnTaskInformation(int _id, Dictionary<int, Dictionary<string, string>> _Dic);
- public static event OnTaskInformation Event_TaskInformation;//浠诲姟瀛楀吀淇℃伅
-
- public delegate void OnTaskToDelete(int _taskID);
- public static event OnTaskToDelete Event_TaskToDelete;//浠诲姟鐨勫垹闄�
-
- public delegate void OnBountyRewards(int Number, int AwardState);//鑾峰彇璧忛噾濂栧姳
- public static event OnBountyRewards Event_BountyRewards;
- public int BountyRewardsNumber = 0;//鑾峰彇璧忛噾鍐呭鐨勫鍔卞��
-
- public delegate void OnFairyAuReward(int Number, int AwardState);//浠欑洘濂栧姳
- public static event OnFairyAuReward Event_FairyAuReward;
- public int OnFairyAuNumber = 0;//鑾峰彇浠欑洘鐨勫鍔卞��
-
- public string _conversation = null;//瀵硅瘽鍐呭銆�
- public int _TaskNow = 0;//鑾峰彇褰撳墠浠诲姟ID
- public string _DefaultDialogContent = null;//榛樿瀵硅瘽鍐呭
-
- public delegate void OnMainlineTask(int MissionID, int MissionState);//涓荤嚎浠诲姟浠诲姟鐘舵�佸彉鏇村拰鍒锋柊
- public static event OnMainlineTask Event_MainlineTask;
-
- public delegate void OnTaskResponse(int _nowNPCid, int _nPCLamp, Dictionary<int, int> _dic = null);//NPCNPC鐏姸鎬侊紝鍙帴鍙栦换鍔★紙NPCID锛屼换鍔$伅鐘舵�侊級
- public static event OnTaskResponse Event_TaskResponse;
-
- public static event Action tryGetTaskAwardEvent;//杩欎釜鏄鎴风鍙灏濊瘯鍘婚濂栧氨浼氳Е鍙戯紝涓嶇鏈�鍚庣殑棰嗗缁撴灉銆�
-
- public static event Action<int> CardLevelChange;//鍏充簬浠诲姟鍗℃満鐘舵�佺殑杞彉
-
- public static event Action<int> SideQuestChangeEvent;//鏀嚎浠诲姟鐘舵�佹敼鍙�
-
- public static event Action<int> MainCardLevelChange;//涓荤嚎浠诲姟鍗$骇鐘舵�佹敼鍙�
-
- public static event Action<int> CompletionOfTaskEvent;//浠诲姟瀹屾垚鍥炶皟
-
- public event Action<int> talkNpcIdUpdate;
-
- public event Action<int> taskDescriptionRefresh;
-
- public static event Action TaskCoinTaskEvent;//璧忛噾浠诲姟淇℃伅瀛楀吀鍙樻洿
- public static event Action FairyTaskEvent;//浠欑洘浠诲姟淇℃伅瀛楀吀鍙樻洿
-
- public int NPCid = 0;//鑾峰彇NPCID锛堟墦寮�浠诲姟闈㈡澘鏃讹級銆�
-
- public bool BountyMotionBool = false;//鎺у埗璧忛噾浠诲姟鏄惁鑷姩绉诲姩
- public bool FairyAuBool = false;//鎺у埗浠欑洘浠诲姟鏄惁鑷姩绉诲姩
- public int currentMission { get; private set; }
- public int currentMissionState { get; private set; }
-
- public int GetNowTaskID { get; set; }//鑾峰彇褰撳墠閫変腑鏉$殑浠诲姟ID
-
- private bool isServerPrepare = false;//鎺у埗鏄惁鑷姩杩涜鑷姩浠诲姟
- private int retainTaskID = 0;
- private float BossDelayTimeint = 0;
- public Vector3 UIeffectFabaoVec = new Vector3();//娉曞疂NPC娑堝け鏃惰幏鍙栫殑鍧愭爣
- //----鍏充簬鍓嶆湡鏃犳搷浣滆嚜鍔ㄦ墽琛屼富绾�
- public int TaskAutoLv = 0;
- public int TaskAutoTime = 0;
-
- public bool TaskOverBool = false;
- private int Times = 0;
- private int NeedWaitTime = 4;
-
- public int clientGuardDugeonTask { get; private set; }
-
- List<int[]> priorityTaskChains = new List<int[]>();
-
- List<int> allowAutoTaskMapIds = new List<int>();
-
- private float mainTaskAutoWaitTime = 0f;
- public readonly TaskWait taskWait = new TaskWait();
-
- public List<int> npcImages = new List<int>();
- public List<int> playerJobImages = new List<int>();
-
- //璺宠浆鍒颁换鍔★紝0涓虹疆椤�
- public event Action OnJumpTask;
- private int m_JumpTaskID = 0;
- public int jumpTaskID {
- get { return m_JumpTaskID; }
- set {
- m_JumpTaskID = value;
- OnJumpTask?.Invoke();
- }
- }
+ //浠诲姟缁勶細浠诲姟淇℃伅锛涘彧鏈変换鍔″寘娌℃湁鍒犻櫎鍖咃紝鍙互璁や负涓�涓换鍔$粍鍙湁涓�涓换鍔�
+ //public Dictionary<int, TaskDetailDates> allMissionDict = new Dictionary<int, TaskDetailDates>();
+ //涓荤嚎浠诲姟锛屾殏涓斿彧澶勭悊涓荤嚎浠诲姟
+ public TaskDetailDates mainTask = new TaskDetailDates();
+ public event Action OnTaskUpdate;
public override void Init()
{
- // StageLoad.Instance.onStageLoadFinish += onStageLoadFinish;
- // NPCInteractProcessor.s_NpcInteractEvent += NpcInterac;
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
- // string BossDelayTime = FuncConfigConfig.Get("BossDelayTime").Numerical1;
- // BossDelayTimeint = float.Parse(BossDelayTime);
- // var Task_Auto = FuncConfigConfig.Get("TaskAuto");
- // TaskAutoLv = int.Parse(Task_Auto.Numerical1);
- // TaskAutoTime = int.Parse(Task_Auto.Numerical2);
- // mainTaskAutoWaitTime = int.Parse(Task_Auto.Numerical3) / 1000f;
- // var mapIds = ConfigParse.GetMultipleStr<int>(Task_Auto.Numerical4);
- // if (mapIds != null && mapIds.Length > 0)
- // {
- // allowAutoTaskMapIds.AddRange(mapIds);
- // }
-
- // FairyAuTaskCount_Day = int.Parse(FuncConfigConfig.Get("RunTaskCnt").Numerical1.Split('|')[1].Split('_')[1]);
- // FairyAuTaskCount_Round = int.Parse(FuncConfigConfig.Get("RunTaskCnt").Numerical2.Split('|')[1].Split('_')[1]);
-
- // var cliengGuardConfig = FuncConfigConfig.Get("ClientGuardDungeon");
- // clientGuardDugeonTask = int.Parse(cliengGuardConfig.Numerical5);
-
- // var funcConfig = FuncConfigConfig.Get("AutoSelectTaskChain");
- // var taskChainArray = LitJson.JsonMapper.ToObject<int[][]>(funcConfig.Numerical1);
- // if (taskChainArray != null)
- // {
- // for (int i = 0; i < taskChainArray.Length; i++)
- // {
- // priorityTaskChains.Add(taskChainArray[i]);
- // }
- // }
- // var config = FuncConfigConfig.Get("NPCTalk");
- // npcImages = JsonMapper.ToObject<List<int>>(config.Numerical1);
- // playerJobImages = JsonMapper.ToObject<List<int>>(config.Numerical2);
}
public override void Release()
{
- // StageLoad.Instance.onStageLoadFinish -= onStageLoadFinish;
- // NPCInteractProcessor.s_NpcInteractEvent -= NpcInterac;
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
}
public void OnBeforePlayerDataInitialize()
{
- allMissionDict.Clear();
- MainTaskDic.Clear();
- SideQuestsDic.Clear();
- BountyDic.Clear();
- FairyAuDic.Clear();
- SpecialTask.Clear();
- _DicTaskInformation.Clear();
- ReplaceDic.Clear();
- AwardRecordDic.Clear();
- NPCShowDic.Clear();
- m_ShowNpcCache.Clear();
- _conversation = null;
- _DefaultDialogContent = null;
- _TaskNow = 0;
- BountyRewardsNumber = 0;
- NPCid = 0;
- retainTaskID = 0;
- currentMission = 0;
- _globalbool = false;
- BountyMotionBool = false;
- FairyAuBool = false;
- isServerPrepare = false;
- }
-
- public void OnPlayerLoginOk()
- {
- GlobalTimeEvent.Instance.secondEvent -= secondEvent;
- GlobalTimeEvent.Instance.secondEvent += secondEvent;
- isServerPrepare = true;
- TaskOverBool = false;
- }
-
- // private void onStageLoadFinish()//鍦板浘鍒囨崲鏃惰皟鐢�
- // {
- // var inDungeon = IsDungeon();
- // if (!inDungeon && retainTaskID != 0)
- // {
- // if (ReplaceDic.ContainsKey(retainTaskID))
- // {
- // AutomaticTripToTask(retainTaskID);
- // //int missionState = SideQuestState(retainTaskID);
- // //TaskTerminationToHangUp(retainTaskID, missionState);
- // retainTaskID = 0;
- // }
- // }
- // }
- List<int> ListMissionID = new List<int>();
- public void RefreshMissionState(int MissionID, int MissionState, int DiscriptionIndex)//1.浠诲姟ID,2浠诲姟鐘舵�侊紝3锛屼换鍔℃弿杩癐ndex(鎺ユ敹浠诲姟)
- {
- // TODO YYL
- // try
- // {
- // if (isServerPrepare && MissionState != 3 && MissionID != 2000 && MissionID != 3000)
- // {
- // TaskupToDate = MissionID;
- // }
- // var pytaskM = PyTaskConfig.Get(MissionID);
- // if (pytaskM == null)
- // {
- // return;
- // }
- // if ((pytaskM.type == (int)TaskTypenum.MainlineTaskType || pytaskM.type == (int)TaskTypenum.MainlineTaskTyp2) && MissionState != 0 && MissionState != 3)
- // {
- // currentMission = MissionID;
- // currentMissionState = MissionState;
- // }
- // //浠欑洘浠诲姟瀹屾垚
- // if ((pytaskM.type == 12 || pytaskM.type == 14) && TaskAllocation.Instance.FairyAuAllNumber() >= FairyAuTaskCount_Day)
- // {
- // Event_FairyAuTask();
- // return;
- // }
-
-
- // if (allMissionDict.ContainsKey(MissionID))
- // {
- // int missionState = allMissionDict[MissionID].MissionState;
- // var lastDescriptionIndex = allMissionDict[MissionID].descIndex;
-
- // if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && isServerPrepare)
- // {
- // TaskOverBool = true;
- // taskWait.Push(TaskWaitType.TaskComplete);
- // if (CompletionOfTaskEvent != null)
- // {
- // CompletionOfTaskEvent(MissionID);
- // }
- // }
- // TaskChanges(MissionID, MissionState, DiscriptionIndex);//浠诲姟鐨勭姸鎬佷慨鏀�
-
- // if (missionState == 0 && (MissionState == 1 || MissionState == 2))
- // {
- // if (Event_TaskToAdd != null)//浠诲姟娣诲姞锛堢敤浜庡瓨鍌ㄤ簬韬笂鐨勬湭鎺ュ彇浠诲姟鐨勭壒娈婂鐞嗭級
- // {
- // Event_TaskToAdd(MissionID, MissionState, DiscriptionIndex);
- // }
- // }
- // else
- // {
- // if (Event_TaskRefreshes != null)//鍒锋柊浠诲姟
- // {
- // Event_TaskRefreshes(MissionID);
- // }
- // }
-
- // if (lastDescriptionIndex != DiscriptionIndex)
- // {
- // if (taskDescriptionRefresh != null)
- // {
- // taskDescriptionRefresh(MissionID);
- // }
- // }
-
- // }
- // else
- // {
- // AddMission(MissionID, MissionState, DiscriptionIndex);//浠诲姟鐨勬坊鍔�
- // if (taskDescriptionRefresh != null)
- // {
- // taskDescriptionRefresh(MissionID);
- // }
- // if (Event_TaskToAdd != null)
- // {
- // Event_TaskToAdd(MissionID, MissionState, DiscriptionIndex);
- // }
- // }
- // TaskClassification(MissionID, MissionState);//浠诲姟鍒嗙被
- // IsShowNpC(1);//鏄惁鏄剧ずNPC
- // IsShowNpC(MissionID);//鏄惁鏄剧ずNPC
- // if (isServerPrepare)
- // {
- // AutotaskingPrecedence(isServerPrepare, MissionID);//鏄惁鎵ц鑷姩浠诲姟
- // }
- // TaskTerminationToHangUp(MissionID, MissionState);//缁撴潫璧忛噾鍜屼粰鐩熶换鍔″墠寰�鎸傛満
- // if (Event_TaskResponse != null)//鍙戦�佷换鍔$伅淇℃伅
- // {
- // if (allMissionDict[MissionID].LightList.Equals(default(TsakLight)))
- // {
- // return;
- // }
- // for (int i = 0; i < allMissionDict[MissionID].LightList.Count; i++)
- // {
- // Event_TaskResponse(allMissionDict[MissionID].LightList[i].NpcId, allMissionDict[MissionID].LightList[i].StateLight);
- // }
-
- // }
- // }
- // catch (Exception ex)
- // {
- // Debug.Log(ex.StackTrace);
- // }
-
+ mainTask = new TaskDetailDates();
}
- // public ImpactRankModel.RankAwardItem GetRunTaskRward()//娣诲姞浠诲姟濂栧姳
- // {
- // var runTaskAward = FuncConfigConfig.Get("RunTaskAward");
- // ImpactRankModel.RankAwardItem _award = new ImpactRankModel.RankAwardItem();
- // var _jsonData = LitJson.JsonMapper.ToObject(runTaskAward.Numerical3);
- // var jsonData2 = LitJson.JsonMapper.ToObject(runTaskAward.Numerical4);
- // foreach (string key in _jsonData.Keys)
- // {
- // var _job = int.Parse(key);
- // var _itemArray = LitJson.JsonMapper.ToObject<int[][]>(_jsonData[key].ToJson());
- // for (int j = 0; j < _itemArray.Length; j++)
- // {
- // _award.Add(_job, new Item(_itemArray[j][0], _itemArray[j][1]));
- // }
- // }
- // foreach (string key in jsonData2.Keys)
- // {
- // var _job = int.Parse(key);
- // _award.Add(_job, new Item(2301, 0));
-
- // }
-
- // return _award;
- // }
-
- public int GetLatestMainTaskId()
+ public void UpdateTask(HB110_tagMCTaskInfo netPack)
{
- var taskId = 0;
- //涓荤嚎浠诲姟鐨勯『搴忕敱浠诲姟鍒楄〃鐨勯『搴忓喅瀹� TaskListConfig.GetMissionIndex
- //杩欓噷鏄痓ug锛屼絾鏄洜涓哄彧鏈変竴涓富绾夸换鍔★紝鎵�浠ユ殏鏃朵笉褰卞搷
- foreach (var id in MainTaskDic.Keys)
+ for (int i = 0; i < netPack.TaskList.Length; i++)
{
- if (id > taskId)
+ if (netPack.TaskList[i].TaskGroup == 0)
{
- taskId = id;
- }
- }
- return taskId;
- }
-
- public bool TryGetTaskData(int _taskId, out MissionDetailDates taskData)
- {
- return allMissionDict.TryGetValue(_taskId, out taskData);
- }
-
- void DefaultDialogue()//鍏充簬鎵撳紑榛樿瀵硅瘽鐣岄潰
- {
- // if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
- // {
- // return;
- // }
- // bool IsOpenMain = UIManager.Instance.IsOpened<MainWin>();
- // if (!UIManager.Instance.IsOpened<DefaultDialogueBoxWin>() && IsOpenMain)
- // {
- // UIManager.Instance.OpenWindow<DefaultDialogueBoxWin>();
- // UIManager.Instance.CloseWindow<MainInterfaceWin>();
- // }
- // else
- // {
- // if (talkNpcIdUpdate != null)
- // {
- // talkNpcIdUpdate(NPCid);
- // }
- // }
- }
- private void OnEventTalkEvent(int taskID)//NPC瀵硅瘽鍚庣殑寮规
- {
- //if (UIManager.Instance.ExitAnyFullScreenOrMaskWin())
- //{
- // return;
- //}
- //bug: 鍔熻兘寮�鍚紩瀵兼椂锛屾湭鏀跺埌鏈嶅姟绔殑灏佸寘蹇�熷璇濅細瀵艰嚧鍔熻兘寮�鍚紩瀵艰鎵撴柇锛屽鏋滃彧鏄垽鏂璱nGuiding鍙堝鑷存棤娉曠户缁换鍔�
- //瑙e喅鏂规锛�1. 瀵硅瘽鏃跺垽鏂湁寮曞涓斿繀椤荤晫闈㈠湪鎵撳紑鐘舵�侊紱2. 鍔熻兘寮曞椋炲叆鐨勬椂鍊欏鏋滀腑鏂垯鍙栨秷寮曞
-
- // -------------------------TODO YYL-----------------------------------
- // if ((NewBieCenter.Instance.inGuiding && UIManager.Instance.IsOpened<NewBieWin>()) || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing
- // || UIManager.Instance.IsOpened<TreasureChapterWin>())
- // {
- // return;
- // }
-
- // bool IsOpenMain = UIManager.Instance.IsOpened<MainInterfaceWin>();
-
- // var state = 0;
- // if (TryGetCustomTaskState(taskID, out state))
- // {
- // var config = StoryMissionsConfig.GetConfig(taskID, state);
- // if (config != null && NPCid == config.NpcID)
- // {
- // if (!UIManager.Instance.IsOpened<DialogueDuidanceWin>() && IsOpenMain
- // && !UIManager.Instance.ExistAnyFullScreenOrMaskWin())
- // {
- // UIManager.Instance.CloseWindow<MainInterfaceWin>();
- // DialogueDuidanceWin.storyMissionId = config.id;
- // DialogueDuidanceWin.taskId = taskID;
- // UIManager.Instance.OpenWindow<DialogueDuidanceWin>();
- // }
- // return;
- // }
- // }
- // if (!UIManager.Instance.IsOpened<TaskBoxBGMWin>() && IsOpenMain)
- // {
- // UIManager.Instance.CloseWindow<MainInterfaceWin>();
- // UIManager.Instance.OpenWindow<TaskBoxBGMWin>();
- // return;
- // }
- // if (BountyDic.ContainsKey(_TaskNow) || FairyAuDic.ContainsKey(_TaskNow))
- // {
- // if (!ModelCenter.Instance.GetModel<TeamModel>().teamPrepare.isPreparing)
- // {
- // RequestGetTaskAward("OK", _TaskNow);
- // }
- // }
- }
-
-
- private void BountySelfMotion()
- {
- int blank = PackManager.Instance.GetEmptyGridCount(PackType.Item);
- if (blank < 1)//"璇峰厛娓呯悊鑳屽寘鍐嶉鍙栧鍔�
- {
- return;
- }
-
- }
-
- public bool TryGetCustomTaskState(int taskId, out int state)
- {
- state = 0;
- if (ReplaceDic.ContainsKey(taskId))
- {
- var keyValue = ReplaceDic[taskId];
- if (keyValue.ContainsKey("state"))
- {
- state = keyValue["state"];
- return true;
- }
- }
- return false;
- }
-
- void AddMission(int MissionID, int MissionState, int DiscriptionIndex)//娣诲姞浠诲姟
- {
- // TODO YYL
-
- // var config = PyTaskConfig.Get(MissionID);
- // if (config == null)
- // {
- // Debug.LogError(MissionID + "琛ㄦ牸涓笉瀛樺湪姝や换鍔D");
- // return;
- // }
-
- // if (allMissionDict == null)
- // allMissionDict = new Dictionary<int, MissionDetailDates>();
- // MissionDetailDates vDetailData = new MissionDetailDates();
- // vDetailData.Time = DateTime.Now;
- // vDetailData.ID = int.Parse(config.id);
- // vDetailData.Name = config.name;
- // vDetailData.Type = config.type;
- // vDetailData.NPC_ID = config.npcId;
- // vDetailData.LV = config.lv;
- // vDetailData.ColorLV = config.colorLV;
-
- // vDetailData.RewardList = RewardInformation(config.rewardList, DiscriptionIndex);//濂栧姳淇℃伅
- // if (ReplaceDic.ContainsKey(MissionID))
- // {
- // Dictionary<string, int> _dic = ReplaceDic[MissionID];
- // if (_dic.ContainsKey("visit_npc_id") || _dic.ContainsKey("kill_npc_id"))
- // {
- // vDetailData.LightList = CharactersReplace(config.lightList, DiscriptionIndex, int.Parse(config.id));
- // }
- // else
- // {
- // vDetailData.LightList = StrSegmentation(config.lightList, DiscriptionIndex);//浠诲姟淇℃伅鐏�
- // }
- // if (MissionState == 3)
- // {
- // for (int i = 0; i < vDetailData.LightList.Count; i++)
- // {
- // TsakLight TsakLight = new TsakLight();
- // TsakLight.NpcId = vDetailData.LightList[i].NpcId;
- // TsakLight.StateLight = -1;
- // vDetailData.LightList[i] = TsakLight;
- // }
- // }
- // }
- // else
- // {
- // vDetailData.LightList = StrSegmentation(config.lightList, DiscriptionIndex);//浠诲姟淇℃伅鐏�
- // if (MissionState == 3)
- // {
- // for (int i = 0; i < vDetailData.LightList.Count; i++)
- // {
- // TsakLight TsakLight = new TsakLight();
- // TsakLight.NpcId = vDetailData.LightList[i].NpcId;
- // TsakLight.StateLight = -1;
- // vDetailData.LightList[i] = TsakLight;
- // }
- // }
- // }
- // vDetailData.Desclist = TaskDetails(config.descList, DiscriptionIndex);//浠诲姟璇︽儏
- // vDetailData.InforList = StrInforList(config.infoList, DiscriptionIndex);//浠诲姟瀹屾垚鏉′欢
-
-
- // vDetailData.MissionState = MissionState;
- // vDetailData.descIndex = DiscriptionIndex;
-
- // var canSwitchSelectTask = true;
- // if (GetNowTaskID != 0 && !IsMainTaskType(vDetailData.Type))
- // {
- // MissionDetailDates taskData;
- // if (TryGetTaskData(GetNowTaskID, out taskData)
- // && IsMainTaskType(taskData.Type)
- // && taskData.MissionState != 3)
- // {
- // canSwitchSelectTask = false;
- // }
- // }
-
- // if (isServerPrepare && PriorityTaskChainContains(MissionID))
- // {
- // canSwitchSelectTask = true;
- // }
-
- // if (canSwitchSelectTask)
- // {
- // GetNowTaskID = MissionID;
- // }
-
- // allMissionDict.Add(MissionID, vDetailData);//娣诲姞浠诲姟
- }
-
- public bool PriorityTaskChainContains(int taskId)
- {
- for (int i = 0; i < priorityTaskChains.Count; i++)
- {
- if (taskId >= priorityTaskChains[i][0]
- && taskId <= priorityTaskChains[i][1])
- {
- return true;
- }
- }
- return false;
- }
-
- public bool IsMainTaskType(int type)
- {
- return type == (int)TaskTypenum.MainlineTaskType || type == (int)TaskTypenum.MainlineTaskTyp2;
- }
-
- public enum TaskTypenum//浠诲姟绫诲瀷鍒嗙被
- {
- MainlineTaskType = 0,//涓荤嚎
- MainlineTaskTyp2 = 1,
- SideQuestsType2 = 2,//鏀嚎
- SideQuestsType3 = 3,//鏀嚎浠诲姟锛堟湰婧愭硶瀹濇敮绾匡級
- SideQuestsType4 = 4,
- SideQuestsType5 = 5,
- BountyMissionsType6 = 6,//璧忛噾浠诲姟
- BountyMissionsType7 = 7,
- BountyMissionsType8 = 8,
- FairyAuMissionType11 = 11,//浠欑洘浠诲姟
- FairyAuMissionType12 = 12,
- SpecialTaskType13 = 13,//鐗规畩浠诲姟绫诲瀷(鐢ㄤ簬璧忛噾)
- SpecialTaskType14 = 14,//鐗规畩浠诲姟绫诲瀷(鐢ㄤ簬浠欑洘)
- AchievementTask = 15,//鎴愬氨浠诲姟锛堟殏鏈紑鍑轰笓灞炲瓧鍏革級
- SpecialTaskType16 = 16,//鐗规畩浠诲姟绫诲瀷(鐢ㄤ簬娉曞疂)
- SideQuestsType17 = 17,//鏀嚎17-21鏂板
- SideQuestsType18 = 18,
- SideQuestsType19 = 19,
- SideQuestsType20 = 20,//(鍚庣鐗规畩澶勭悊锛屾殏瀹氫笉璁╀娇鐢�)
- SideQuestsType21 = 21,
- //鍚庣画IL寮�鍙戞坊鍔犻璁�
- default1,
- default2,
- default3,
- default4,
- default5,
- default6,
- default7,
- default8,
- default9,
- default10,
- }
-
- void TaskClassification(int _taskID, int MissionState)//浠诲姟鍒嗙被(涓荤嚎浠诲姟,鏀嚎浠诲姟)
- {
- if (!allMissionDict.ContainsKey(_taskID))
- {
- return;
- }
- TaskTypenum type = (TaskTypenum)allMissionDict[_taskID].Type;
- switch (type)
- {
- case TaskTypenum.MainlineTaskType:
- case TaskTypenum.MainlineTaskTyp2:
- {
- if (_taskID != 1)//涓荤嚎浠诲姟锛堟坊鍔犱笌鏇存柊锛�
- {
- if (MainTaskDic.ContainsKey(_taskID))
- {
- MainTaskDic[_taskID] = allMissionDict[_taskID];
- }
- else
- {
- MainTaskDic.Add(_taskID, allMissionDict[_taskID]);
- }
- if (Event_MainlineTask != null)
- {
- Event_MainlineTask(_taskID, MissionState);
- }
- }
-
- }
+ mainTask.TaskGroup = netPack.TaskList[i].TaskGroup;
+ mainTask.TaskID = (int)netPack.TaskList[i].TaskID;
+ mainTask.CurValue = (int)netPack.TaskList[i].CurValue;
+ mainTask.State = netPack.TaskList[i].State;
break;
- case TaskTypenum.SideQuestsType2:
- case TaskTypenum.SideQuestsType3:
- case TaskTypenum.SideQuestsType4:
- case TaskTypenum.SideQuestsType5:
- case TaskTypenum.SideQuestsType17:
- case TaskTypenum.SideQuestsType18:
- case TaskTypenum.SideQuestsType19:
- case TaskTypenum.SideQuestsType20:
- case TaskTypenum.SideQuestsType21:
- {
- if (SideQuestsDic.ContainsKey(_taskID))
- {
- SideQuestsDic[_taskID] = allMissionDict[_taskID];
- }
- else
- {
- SideQuestsDic.Add(_taskID, allMissionDict[_taskID]);
- }
- if (SideQuestChangeEvent != null)
- {
- SideQuestChangeEvent(_taskID);
- }
- }
- break;
- case TaskTypenum.BountyMissionsType6:
- case TaskTypenum.BountyMissionsType7:
- case TaskTypenum.BountyMissionsType8:
- {
-
- if (BountyDic.ContainsKey(_taskID))
- BountyDic[_taskID] = allMissionDict[_taskID];
- else
- BountyDic.Add(_taskID, allMissionDict[_taskID]);
- if (Event_nBounty != null)
- Event_nBounty();
- }
-
- break;
- case TaskTypenum.FairyAuMissionType11:
- case TaskTypenum.FairyAuMissionType12:
- {
- if (FairyAuDic.ContainsKey(_taskID))
- FairyAuDic[_taskID] = allMissionDict[_taskID];
- else
- FairyAuDic.Add(_taskID, allMissionDict[_taskID]);
- if (Event_FairyAuTask != null && MissionState != 3)
- Event_FairyAuTask();
- }
- break;
- case TaskTypenum.SpecialTaskType13:
- case TaskTypenum.SpecialTaskType14:
- case TaskTypenum.SpecialTaskType16:
-
- {
- if (SpecialTask.ContainsKey(_taskID))
- SpecialTask[_taskID] = allMissionDict[_taskID];
- else
- SpecialTask.Add(_taskID, allMissionDict[_taskID]);
- }
- break;
- default:
- break;
- }
-
-
- }
-
- void TaskTypeDeletion(int _taskID)//浠诲姟绫诲瀷鐨勫垹闄�
- {
-
- if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎
- {
- MainTaskDic.Remove(_taskID);
- }
- else if (SideQuestsDic.ContainsKey(_taskID))//鏀嚎
- {
- SideQuestsDic.Remove(_taskID);
- }
- else if (BountyDic.ContainsKey(_taskID))//璧忛噾
- {
- BountyDic.Remove(_taskID);
- if (Event_nBounty != null)
- Event_nBounty();
-
- }
- else if (SpecialTask.ContainsKey(_taskID))//鐗规畩浠诲姟
- {
- SpecialTask.Remove(_taskID);
- }
- else if (FairyAuDic.ContainsKey(_taskID))
- {
- FairyAuDic.Remove(_taskID);
- if (Event_FairyAuTask != null)
- Event_FairyAuTask();
- }
-
-
- }
- string TaskDetails(string _string, int _index)////Json瑙f瀽
- {
- JsonData _Json = JsonMapper.ToObject(_string);
- if (_Json.Count == 1)
- {
- string _TaskDetails = _Json["0"].ToString().Replace("\"", "");
- return _TaskDetails;
- }
- else
- {
- string _TaskDetails = _Json[_index.ToString()].ToString().Replace("\"", "");
- return _TaskDetails;
- }
-
- }
-
-
- List<TsakLight> CharactersReplace(string _string, int _index, int Id)
- {
-
- JsonData _Json = JsonMapper.ToObject(_string);
- List<TsakLight> TsakLightList = new List<TsakLight>();
- TsakLightList.Clear();
- TsakLight taskLight = new TsakLight();
- foreach (var key in _Json.Keys)
- {
- if (int.Parse(key) == _index)
- {
- JsonData _Json1 = _Json[key];
- if (_Json1.Count != 0)
- {
- foreach (var _key in _Json1.Keys)
- {
- string Str = _key.ToString();
- Match match = Regex.Match(Str, pattern);
- if (ReplaceDic.ContainsKey(Id))
- {
- Dictionary<string, int> _dic = ReplaceDic[Id];
- if (_dic.ContainsKey(match.Groups[1].Value))
- {
- taskLight.NpcId = _dic[match.Groups[1].Value];
- taskLight.StateLight = int.Parse(_Json1[_key].ToString());
- TsakLightList.Add(taskLight);
- }
- }
- }
- }
- return TsakLightList;
-
}
}
- return TsakLightList;
- }
-
- string StrInforList(string _string, int _index)
- {
- JsonData _Json = JsonMapper.ToObject(_string);
- foreach (var key in _Json.Keys)
- {
- if (int.Parse(key) == _index)
- {
- JsonData _Json1 = _Json[key];
- if (_Json1.Count != 0)
- {
- foreach (var _key in _Json1.Keys)
- {
- return _Json1[_key].ToString();
- }
- }
- }
- }
-
- return string.Empty;
- }
-
- List<TsakLight> StrSegmentation(string _string, int _index)
- {
- int val;
- JsonData _Json = JsonMapper.ToObject(_string);
- List<TsakLight> TsakLightList = new List<TsakLight>();
- TsakLightList.Clear();
-
- foreach (var key in _Json.Keys)
- {
- if (int.Parse(key) == _index)
- {
- JsonData _Json1 = _Json[key];
- if (_Json1.Count != 0)
- {
- foreach (var _key in _Json1.Keys)
- {
- if (int.TryParse(_key, out val))
- {
- TsakLight taskLight = new TsakLight();
- taskLight.NpcId = int.Parse(_key);
- taskLight.StateLight = int.Parse(_Json1[_key].ToString());
- TsakLightList.Add(taskLight);
- }
- }
- }
- return TsakLightList;
- }
- }
-
- return TsakLightList;
- }
-
- string RewardInformation(string _string, int _index)//濂栧姳淇℃伅
- {
-
- string _occupation = ("J" + PlayerDatas.Instance.baseData.Job).ToString();
- JsonData _Json = JsonMapper.ToObject(_string);
- foreach (var key in _Json.Keys)
- {
- if (int.Parse(key) == _index)
- {
- JsonData _Json1 = _Json[key];
- if (_Json1.Count != 0)
- {
- foreach (var _key in _Json1.Keys)
- {
- if (_key == _occupation)
- return _Json1[_key].ToString();
- else if (_key == "-")
- return _Json1[_key].ToString();
- }
- }
- else
- {
- return null;
- }
- }
- }
- return null;
- }
-
-
- void TaskChanges(int MissionID, int MissionState, int DiscriptionIndex)//瀛樺湪鐨勪换鍔$殑淇敼
- {
- // TODO YYL
- // var pytaskM = PyTaskConfig.Get(MissionID);
- // if (pytaskM == null)
- // return;
- // allMissionDict[MissionID].Time = DateTime.Now;
- // allMissionDict[MissionID].MissionState = MissionState;
- // allMissionDict[MissionID].descIndex = DiscriptionIndex;
- // allMissionDict[MissionID].RewardList = RewardInformation(pytaskM.rewardList, DiscriptionIndex);//濂栧姳淇℃伅
- // allMissionDict[MissionID].Desclist = TaskDetails(pytaskM.descList, DiscriptionIndex);//浠诲姟璇︽儏
- // allMissionDict[MissionID].InforList = StrInforList(pytaskM.infoList, DiscriptionIndex);//浠诲姟瀹屾垚鏉′欢
-
-
- // if (MissionState == 3)
- // {
- // if (allMissionDict[MissionID].LightList.Equals(default(TsakLight)))
- // {
- // return;
- // }
- // for (int i = 0; i < allMissionDict[MissionID].LightList.Count; i++)
- // {
- // TsakLight TsakLight = new TsakLight();
- // TsakLight.NpcId = allMissionDict[MissionID].LightList[i].NpcId;
- // TsakLight.StateLight = -1;
- // allMissionDict[MissionID].LightList[i] = TsakLight;
- // }
- // return;
- // }
- // else
- // {
- // if (ReplaceDic.ContainsKey(MissionID))
- // {
- // Dictionary<string, int> _dic = ReplaceDic[MissionID];
- // if (_dic.ContainsKey("visit_npc_id") || _dic.ContainsKey("kill_npc_id"))
- // {
- // allMissionDict[MissionID].LightList = CharactersReplace(pytaskM.lightList, DiscriptionIndex, allMissionDict[MissionID].ID);
- // }
- // else
- // {
- // allMissionDict[MissionID].LightList = StrSegmentation(pytaskM.lightList, DiscriptionIndex);//浠诲姟淇℃伅鐏�
- // }
- // }
- // else
- // {
- // allMissionDict[MissionID].LightList = StrSegmentation(pytaskM.lightList, DiscriptionIndex);//浠诲姟淇℃伅鐏�
- // }
- // }
- }
-
- public void Task0820(H0820_tagMissionDict info)//0820淇℃伅瀛楀吀
- {
- // TODO YYL
- // Dictionary<string, int> dic = null;
- // ReplaceDic.TryGetValue((int)info.MissionID, out dic);
- // if (dic == null)
- // {
- // dic = new Dictionary<string, int>();
- // StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue);
- // dic.Add(info.DictKey, (int)info.DictValue);
- // ReplaceDic.Add((int)info.MissionID, dic);
- // }
- // else
- // {
- // if (dic.ContainsKey(info.DictKey))
- // {
- // StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue);
- // dic[info.DictKey] = (int)info.DictValue;
- // if (info.DictKey == "around_allcount")
- // {
- // if (TaskCoinTaskEvent != null)
- // {
- // TaskCoinTaskEvent();
- // }
- // }
- // if (info.DictKey == "around_count_family")
- // {
- // if (FairyTaskEvent != null)
- // {
- // FairyTaskEvent();
- // }
- // }
- // }
- // else
- // {
- // StorageNPCDic(info.MissionID, info.DictKey, (int)info.DictValue);
- // dic.Add(info.DictKey, (int)info.DictValue);
- // }
- // }
+ OnTaskUpdate?.Invoke();
}
- public void RequestGetTaskAward(string _answer, int taskId = 0)
- {
- // TODO YYL
- // if (taskId == clientGuardDugeonTask)
- // {
- // ClientGuardDungeon.RequestEnter();
- // return;
- // }
- // var sendInfo = new C0802_tagCNPCAnswer();
- // sendInfo.Answer = _answer;
- // sendInfo.AnswerLen = (byte)_answer.Length;
- // GameNetSystem.Instance.SendInfo(sendInfo);
-
- // if (tryGetTaskAwardEvent != null)
- // {
- // tryGetTaskAwardEvent();
- // }
- }
-
- public void TaskRefreshes(int _MissionId, int _DictKeyLen, string _DictKey, int _DictValue)//浠诲姟鏁版嵁鐨勫埛鏂帮紙浠诲姟瀛楀吀淇℃伅锛�
- {
-
- if (!_DicTaskInformation.ContainsKey(_MissionId))
- {
- Dictionary<string, string> _dic = new Dictionary<string, string>();
- if (_dic.ContainsKey(_DictKey))
- {
- _dic[_DictKey] = _DictValue.ToString();
- }
- else
- {
- _dic.Add(_DictKey, _DictValue.ToString());
- }
- _DicTaskInformation.Add(_MissionId, _dic);
- string kaji = "kaji";
- if (_DicTaskInformation.ContainsKey(_MissionId) && _DicTaskInformation[_MissionId].ContainsKey(kaji))
- {
- if (MainTaskDic.ContainsKey(_MissionId) && MainCardLevelChange != null && _DictValue == 0)
- {
-
- if (IsGetOnBool)
- {
- GetNowTaskID = _MissionId;
- }
- MainCardLevelChange(_MissionId);
-
- }
- }
- }
- else
- {
- if (_DicTaskInformation[_MissionId].ContainsKey(_DictKey))
- {
- _DicTaskInformation[_MissionId][_DictKey] = _DictValue.ToString();
- if (_DictKey == "kaji" && (_DictValue == 0 || _DictValue == 1))//kaji:0涓轰富绾垮崱绾у彉鏇达紝kaji:1涓洪瓟鏃忓崱绾у彉鏇�
- {
- if (CardLevelChange != null)
- {
- CardLevelChange(_MissionId);
- }
- if (MainTaskDic.ContainsKey(_MissionId))
- {
- if (IsGetOnBool)
- {
- GetNowTaskID = _MissionId;
- }
- if (MainCardLevelChange != null)
- {
- MainCardLevelChange(_MissionId);
- }
- }
- }
- }
- else
- {
- _DicTaskInformation[_MissionId].Add(_DictKey, _DictValue.ToString());
- }
- }
-
-
- if (Event_TaskInformation != null)
- Event_TaskInformation(_MissionId, _DicTaskInformation);
- }
- public void DelMission(int _taskID)//鐪熷疄浠诲姟鍒犻櫎
- {
- if (allMissionDict.ContainsKey(_taskID))
- {
- allMissionDict.Remove(_taskID);
- if (_DicTaskInformation.ContainsKey(_taskID))
- {
- _DicTaskInformation.Remove(_taskID);
- }
- }
- TaskTypeDeletion(_taskID);
- if (Event_TaskToDelete != null)
- {
- Event_TaskToDelete(_taskID);
- }
- }
- bool _bool = false;
- string _conversationA = null;
- public void EventTalk(H0801_tagEventTalk info)//璁块棶浠诲姟鏄惁鍙彁浜�
- {
- NPCid = (int)info.NPCID;
- if (info.Msg == null || info.Msg[0].MsgLen == 0)
- {
- _conversation = _conversationA;
- }
- else
- {
- if (_conversationA != info.Msg[0].Msg)
- {
- _conversation = info.Msg[0].Msg;
- _conversationA = _conversation;
- }
- }
-
- if (_bool)
- {
- if ((int)info.MissionID != 0)
- {
- _TaskNow = (int)info.MissionID;
- OnEventTalkEvent((int)info.MissionID);
- _bool = false;
- return;
- }
- }
-
- for (int i = 0; i < info.Answer.Length; i++)
- {
- string[] str = info.Answer[i].Msg.Split('_');
- int var;
- if (str.Length > 1)
- {
- for (int j = 0; j < info.Answer.Length; j++)
- {
- string[] stX = info.Answer[j].Msg.Split('_');
- if (stX.Length > 1)
- {
- string strXX = stX[stX.Length - 1];
- if (int.TryParse(strXX, out var))
- {
- if (int.Parse(strXX) == GetNowTaskID)
- {
- RequestGetTaskAward(strXX);
- _bool = true;
- return;
- }
- }
- }
- }
- string str1 = str[str.Length - 1];
- RequestGetTaskAward(str1);
- _bool = true;
- return;
- }
- else
- {
- _bool = false;
- if ((int)info.NPCID != 32504001)
- {
- DefaultDialogue();
- }
- return;
- }
- }
- }
-
- public string pattern = @"\{(.+)\}";
-
- public int StatusLightQuery(int _NpcID)//鐘舵�佺伅鏌ヨ
- {
- int Light = -1;
- foreach (int key in allMissionDict.Keys)
- {
- if (allMissionDict[key].LightList.Equals(default(TsakLight)))
- {
- continue;
- }
- for (int i = 0; i < allMissionDict[key].LightList.Count; i++)
- {
- if (_NpcID == allMissionDict[key].LightList[i].NpcId)
- {
- if (allMissionDict[key].LightList[i].StateLight > Light)
- {
- Light = allMissionDict[key].LightList[i].StateLight;
- }
- }
- }
- }
-
- return Light;
- }
-
- public void DailyFairyTaskMove()//鏃ュ父浠欑洘浠诲姟
- {
- // TODO YYL
- // if (SpecialTask.Count != 0)
- // {
- // foreach (int key in SpecialTask.Keys)
- // {
- // if (SpecialTask[key].Type == 14 && SpecialTask[key].MissionState != 3)//鏈帴浠诲姟
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
- // return;
- // }
- // }
- // }
- // if (FairyAuDic.Count != 0)
- // {
- // foreach (int key in FairyAuDic.Keys)
- // {
- // if (FairyAuDic[key].MissionState != 0 && FairyAuDic[key].MissionState != 3)
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
- // return;
- // }
- // }
- // }
- }
- public void DailyBountyMove()//鏃ュ父璧忛噾浠诲姟
- {
- // if (SpecialTask.Count != 0)
- // {
- // foreach (int key in SpecialTask.Keys)
- // {
- // if (SpecialTask[key].Type == 13 && SpecialTask[key].MissionState != 3)//鏈帴浠诲姟
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
- // return;
- // }
- // }
- // }
- // if (BountyDic.Count != 0)
- // {
- // foreach (int key in BountyDic.Keys)
- // {
- // if (BountyDic[key].MissionState != 0 && BountyDic[key].MissionState != 3)
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(key));
- // return;
- // }
- // }
- // }
+ // 浠诲姟鐘舵�� 1-杩涜涓� 2-鍙鍙�
+ public int GetMainTaskState()
+ {
+ return mainTask.State;
}
- private void AutotaskingPrecedence(bool automaticityBool, int missionID)//鍏充簬鏄惁鎵ц鑷姩浠诲姟鍜岃嚜鍔ㄤ换鍔$殑浼樺厛绾�
- {
- if (automaticityBool)
- {
- var inDungeon = IsDungeon();
-
- if (inDungeon)//鍒ゆ柇鏄惁鍐嶅壇鏈腑瀵逛换鍔D杩涜鍌ㄥ瓨
- {
- retainTaskID = Autotasking(missionID);
- }
- else
- {
- retainTaskID = 0;
- if (Autotasking(missionID) != 0)
- {
- AutomaticTripToTask(Autotasking(missionID));
- }
- }
- }
- }
-
- private int Autotasking(int taskID)
- {
- foreach (var value in MainTaskDic.Values)
- {
- if (value.MissionState != 0 && value.MissionState != 3)
- {
- if (allMissionDict.ContainsKey(taskID) && (allMissionDict[taskID].Time - value.Time).TotalSeconds <= 1)
- {
- if (ReplaceDic.ContainsKey(value.ID))
- {
- Dictionary<string, int> _dic = ReplaceDic[value.ID];
- if (_dic.ContainsKey("continue") && _dic["continue"] == 1)
- {
- return value.ID;
- }
- }
- }
- }
- }
- if (ReplaceDic.ContainsKey(taskID))
- {
- Dictionary<string, int> _dic = ReplaceDic[taskID];
- if (_dic.ContainsKey("continue") && _dic["continue"] == 1)
- {
- return taskID;
- }
- }
- return 0;
- }
-
-
- public void AutomaticTripToTask(int _taskID)//浠诲姟鑷姩鍓嶅線锛堜换鍔℃坊鍔狅級
- {
- // TODO YYL
- // try
- // {
- // if (!allowAutoTaskMapIds.Contains(PlayerDatas.Instance.baseData.MapID))
- // {
- // return;
- // }
-
- // var _hero = PlayerDatas.Instance.hero;
- // if (_hero != null)
- // {
- // if (MapArea.IsInMapArea(_hero.CurMapArea, MapArea.E_Type.Boss))
- // {
- // return;
- // }
- // }
-
- // if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎浠诲姟
- // {
- // if (MainTaskDic[_taskID].MissionState == 0 || MainTaskDic[_taskID].MissionState == 3)
- // return;
- // if (MainTaskDic.ContainsKey(_taskID))
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // if (PlayerDatas.Instance.baseData.LV != 1)
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
- // return;
- // }
- // }
- // if (BountyDic.ContainsKey(_taskID))//璧忛噾浠诲姟
- // {
- // if (BountyDic[_taskID].MissionState == 3 || BountyMotionBool)
- // {
- // return;
- // }
- // else
- // {
- // if (BountyDic.ContainsKey(_taskID))
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
- // return;
- // }
- // }
- // }
- // else if (FairyAuDic.ContainsKey(_taskID))//浠欑洘浠诲姟
- // {
- // if (FairyAuDic[_taskID].MissionState == 3 || FairyAuBool)
- // {
- // return;
- // }
- // if (FairyAuDic.ContainsKey(_taskID))
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
- // return;
- // }
- // }
- // else if (SideQuestsDic.ContainsKey(_taskID))
- // {
- // if (SideQuestsDic[_taskID].MissionState == 0 || SideQuestsDic[_taskID].MissionState == 3)
- // {
- // return;
- // }
- // else
- // {
- // PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
- // SnxxzGame.Instance.StartCoroutine(WaitForSkillFinished(_taskID));
- // return;
- // }
- // }
- // }
- // catch (Exception ex)
- // {
- // Debug.Log(ex);
- // }
- }
-
- public void RunTaskAwarInfo(HA708_tagMCRunTaskAwardInfo info)//閫氱煡璺戠幆濂栧姳璁板綍
- {
- for (int i = 0; i < info.Cnt; i++)
- {
- if (!AwardRecordDic.ContainsKey(info.InfoList[i].Type))
- {
- RunTaskAwardRecord _RunTaskAwardRecord = new RunTaskAwardRecord();
- _RunTaskAwardRecord.Num = (int)info.InfoList[i].Num;
- _RunTaskAwardRecord.AwardState = info.InfoList[i].AwardState;
- AwardRecordDic.Add(info.InfoList[i].Type, _RunTaskAwardRecord);
- }
- else
- {
- AwardRecordDic[info.InfoList[i].Type].Num = (int)info.InfoList[i].Num;
- AwardRecordDic[info.InfoList[i].Type].AwardState = info.InfoList[i].AwardState;
- }
- if (info.InfoList[i].Type == (int)TaskTypenum.BountyMissionsType7)
- {
- BountyRewardsNumber = (int)info.InfoList[i].Num;
- if (Event_BountyRewards != null)
- Event_BountyRewards((int)info.InfoList[i].Num, info.InfoList[i].AwardState);
- }
- else if (info.InfoList[i].Type == (int)TaskTypenum.FairyAuMissionType12)
- {
- OnFairyAuNumber = (int)info.InfoList[i].Num;
- if (Event_FairyAuReward != null)
- Event_FairyAuReward((int)info.InfoList[i].Num, info.InfoList[i].AwardState);
- }
- }
- }
-
- // private IEnumerator WaitForSkillFinished(int _taskID)
- // {
- // GA_Hero _hero = PlayerDatas.Instance.hero;
-
- // if (_hero == null)
- // {
- // yield break;
- // }
- // while (_hero != null && _hero.SkillMgr.CurCastSkill != null &&
- // _hero.SkillMgr.CurCastSkill.SkillCompelete == false)
- // {
- // yield return null;
- // }
-
- // yield return WaitingForSecondConst.WaitMS500;
-
- // // 濡傛灉鏈夊畧鎶�, 鍒欎笉鎷惧彇
- // var equipIndex = EquipSet.ClientPlaceToServerPlace(new Int2(0, (int)RoleEquipType.Guard));
- // var _itemModel = PackManager.Instance.GetItemByIndex(PackType.Equip, equipIndex);
- // if (_itemModel == null || !GeneralDefine.GuardianPickUpID.Contains(_itemModel.itemId))
- // {
- // float _chkDistanceSqrt;
- // DropItemManager.DropObject _obj = null;
- // while (DropItemManager.HandupTryGetHeroItem(out _obj))
- // {
- // if (DropItemManager.StopMissionPickup)
- // {
- // break;
- // }
- // if (MapTransferUtility.Instance.MapTransferDoType != MapTransferUtility.E_MapTransferDoType.None)
- // {
- // break;
- // }
- // Vector3 _targetPosition = _obj.dropItem.transform.position;
- // _chkDistanceSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _targetPosition);
- // if (_chkDistanceSqrt > 0.5f)
- // {
- // if (_hero.State != E_ActorState.AutoRun)
- // {
- // _hero.MoveToPosition(_targetPosition);
- // }
- // }
-
- // yield return null;
- // }
- // }
-
- // if (AdventureStage.Instance.IsInAdventureStage)
- // {
- // yield break;
- // }
-
- // if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing
- // || UIManager.Instance.IsOpened<TreasureChapterWin>())
- // {
- // yield break;
- // }
-
- // if (UIManager.Instance.IsOpened<TreasureBaseWin>())
- // {
- // yield break;
- // }
-
- // if (UIManager.Instance.IsOpened<MysteriousMissionWin>())
- // {
- // yield break;
- // }
-
- // if (BossShowModel.Instance.BossShowing)
- // {
- // yield break;
- // }
-
- // if (BountyDic.ContainsKey(_taskID) || FairyAuDic.ContainsKey(_taskID))
- // {
- // yield return WaitingForSecondConst.WaitMS800;//缂撳啿涓�绉掑啀杩涜
- // }
-
- // if (MainTaskDic.ContainsKey(_taskID))//涓荤嚎绛夊緟琛ㄧ幇
- // {
- // if (taskWait.wait)
- // {
- // yield return WaitingForSecondConst.GetWaitForSeconds(mainTaskAutoWaitTime);
- // }
- // }
-
- // while(ClientSceneManager.Instance.isWaitPickup)
- // {
- // yield return null;
- // }
-
- // if (GA_Hero.s_MapSwitching)
- // {
- // yield break;
- // }
- // try
- // {
- // TaskMove(_taskID);
- // }
- // catch (Exception ex)
- // {
- // Debug.Log(ex);
- // }
-
- // }
-
-
- public enum TaskStatus//浠诲姟鐘舵��
- {
- None = -5,//娌℃湁
- Normal = 0,//姝e父浠诲姟锛堢豢锛�
- TreasureCardLevel = 1,//娉曞疂鍗$骇锛堢孩锛�
- CardLevel = 2,//绛夌骇鍗$骇锛堢孩锛�
- Completed = 3,//绔嬪嵆瀹屾垚浠诲姟
- }
- public TaskStatus GetTaskStatus(int taskID)
- {
- if (_DicTaskInformation.ContainsKey(taskID) && _DicTaskInformation[taskID].ContainsKey("kaji"))
- {
- var kaji = _DicTaskInformation[taskID]["kaji"];
-
- switch (int.Parse(kaji))
- {
- case 0:
- return TaskStatus.Normal;
- case 1:
- return TaskStatus.TreasureCardLevel;
- case 2:
- return TaskStatus.CardLevel;
- case 3:
- return TaskStatus.Completed;
- default:
- return TaskStatus.None;
- }
- }
- else
- {
- return TaskStatus.None;
- }
-
- }
- private bool IsDungeon()//鍒ゆ柇鏄惁鍦ㄥ壇鏈腑
- {
- return false;
- // if (ClientDungeonStageUtility.isClientDungeon)
- // return true;
- // var mapId = PlayerDatas.Instance.baseData.MapID;
- // var mapConfig = MapConfig.Get(mapId);
- // return mapConfig != null && mapConfig.MapFBType != 0;
- }
- public bool IsGather(int npdId)//鏄惁鑳介噰闆哊PC
- {
- // TODO YYL
- // var taskListConfig = TaskListConfig.Get(currentMission);
- // if (taskListConfig != null)
- // {
- // int[] collectNPCList = taskListConfig.CollectNPC;
- // var isTaskNPC = false;
- // for (int i = 0; i < collectNPCList.Length; i++)
- // {
- // if (collectNPCList[i] == npdId)
- // {
- // isTaskNPC = true;
- // break;
- // }
- // }
- // if (isTaskNPC)
- // {
- // if ((collectNPCList.Length == 1 && collectNPCList[0] == 0) || GetTaskStatus(currentMission) != 0)
- // {
- // return false;
-
- // }
- // }
-
- // }
- return true;
- }
-
- public static bool IsOPenAutoResolve()//浠诲姟闈㈡澘涓嶅紑鍚嚜鍔ㄦ寕鏈虹姸鎬�
- {
- bool _bool = true;
- // TODO YYL
- // if (UIManager.Instance.IsOpened<TaskBoxBGMWin>())
- // {
- // _bool = false;
- // }
- // else if (UIManager.Instance.IsOpened<DefaultDialogueBoxWin>())
- // {
- // _bool = false;
- // }
- // else if (UIManager.Instance.IsOpened<DialogueDuidanceWin>())
- // {
- // _bool = false;
- // }
- return _bool;
- }
-
- private int BOUNTYTASK = 2009;//璧忛噾浠诲姟
- private int FAIRYAUTASK = 3009;//浠欑洘浠诲姟
- private void TaskTerminationToHangUp(int taskID, int MissionState)//(瀹屾垚浠诲姟鍚庡墠寰�鎸傛満鍦扮偣)浠诲姟ID锛屼换鍔$姸鎬�
- {
- // TODO YYL
- // if (!isServerPrepare)
- // {
- // return;
- // }
- // if ((taskID == BOUNTYTASK && MissionState == 1 && !BountyMotionBool && TaskAllocation.Instance.ForRingAllNumber() != 10)
- // || (taskID == FAIRYAUTASK && MissionState == 1 && !FairyAuBool && TaskAllocation.Instance.FairyAuAllNumber() == 70))
- // {
- // var mapModel = ModelCenter.Instance.GetModel<MapModel>();
- // var point = mapModel.GetRecommendHangPoint();
- // var config = MapEventPointConfig.Get(point);
- // MapTransferUtility.Instance.MoveToNPC(config.NPCID);
-
- // }
- }
- public void CompletionOfTask(int TaskID)//浠诲姟瀹屾垚
- {
- CA206_tagCMQuickFinishMission _CA206 = new CA206_tagCMQuickFinishMission();
- _CA206.MissionID = (uint)TaskID;
- _CA206.DoType = 0;
- GameNetSystem.Instance.SendInfo(_CA206);
- }
-
- public int SideQuestState(int TaskID)//鍏充簬鏌ヨ浠诲姟鐨勭姸鎬侊紙-1娌℃湁姝や换鍔★紝0鏈帴,1姝e湪杩涜涓紝2鍙彁浜わ級
- {
- if (allMissionDict.ContainsKey(TaskID))
- {
- return allMissionDict[TaskID].MissionState;
- }
- else
- {
- return -1;
- }
- }
-
- public int GetQuestState(int _taskId)
- {
- if (allMissionDict.ContainsKey(_taskId))
- {
- return allMissionDict[_taskId].MissionState;
- }
- else
- {
- return -1;
- }
- }
- //--------涓昏鐢ㄤ簬璁板綍浠诲姟鍒楄〃閫変腑鏉$殑鏅鸿兘鎬� 锛�-_-||锛�
- public int TaskupToDate = 0;//鑾峰彇鏈�鏂颁换鍔D
- public int GetOnTaskId = 0;
- public bool IsGetOnBool = false;
- private int NeedTime = 10;
- private DateTime dateTimeA;
- public void GetTaskGetOnNow(int TaskID, string DictKey)//璁板綍涓嬩俊鎭瓧鍏哥殑ID
- {
- string key1Str = "on_kill_" + TaskID;
- string key2Str = "get_byid_" + TaskID;
- if (TaskID > 1 && (key1Str == DictKey || key2Str == DictKey))
- {
- GetOnTaskId = TaskID;
- dateTimeA = DateTime.Now;
- }
-
- }
- private void secondEvent()
- {
- TimeSpan timeS = DateTime.Now - dateTimeA;
- int timeSend = timeS.Seconds;
- if (timeSend >= NeedTime)
- {
- IsGetOnBool = true;
- GetOnTaskId = GetNowTaskID;//鑾峰彇褰撳墠閫変腑鐨処D
- }
- else
- {
- IsGetOnBool = false;
- }
-
- if (TaskOverBool)
- {
- Times += 1;
- if (Times >= NeedTime)
- {
- TaskOverBool = false;
- }
- }
- else
- {
- if (Times != 0)
- {
- Times = 0;
- }
- }
- }
-
-
- public bool IsTaskMove()
- {
- bool IsBool = false;
- if (!UIManager.Instance.IsOpened<MainWin>())
- {
- return IsBool;
- }
- if (PlayerDatas.Instance.baseData.LV > TaskAutoLv)
- {
- return IsBool;
- }
- if (GetTaskStatus(currentMission) == TaskStatus.Normal)
- {
- IsBool = true;
- }
- return IsBool;
- }
- public void TaskMove(int _taskID)
- {
- // TODO YYL
- // if (allMissionDict.ContainsKey(_taskID) && !NewBieCenter.Instance.inGuiding)
- // {
- // string _strTest = allMissionDict[_taskID].InforList;
- // string strTask = TaskAllocation.Instance.GetTaskInfo(TASKINFOConfig.Get(_strTest).show_writing, _taskID);
- // HrefAnalysis.Inst.ExcuteHrefEvent(strTask, 0, true);
- // DropItemManager.StopMissionPickup = false;
- // TaskAllocation.Instance.TaskTime = TimeUtility.ServerNow;
- // }
- }
-
- public class TaskWait
- {
- public bool wait
- {
- get
- {
- foreach (var key in taskWaits.Keys)
- {
- if ((Time.realtimeSinceStartup - taskWaits[key]) < 1f)
- {
-#if UNITY_EDITOR
- Debug.LogFormat("<color=#00ffff>鐢变簬{0}寮�濮嬩换鍔$瓑寰�</color>", GetTaskWaitTypeLabel(key));
-#endif
- return true;
- }
- }
- return false;
- }
- }
-
- Dictionary<TaskWaitType, float> taskWaits = new Dictionary<TaskWaitType, float>();
-
- public void Push(TaskWaitType type)
- {
- taskWaits[type] = Time.realtimeSinceStartup;
- }
-
-#if UNITY_EDITOR
- static string GetTaskWaitTypeLabel(TaskWaitType waitType)
- {
- switch (waitType)
- {
- case TaskWaitType.TaskComplete:
- return "涓荤晫闈换鍔″畬鎴愯〃鐜�";
- case TaskWaitType.LevelUp:
- return "鐜╁鍗囩骇琛ㄧ幇";
- case TaskWaitType.TreasureProgress:
- return "娉曞疂杩涘害鏇存柊";
- case TaskWaitType.BetterEquip:
- return "鑾峰緱鏇村ソ瑁呭";
- default:
- return waitType.ToString();
- }
- }
-#endif
- }
-
- public enum TaskWaitType
- {
- TaskComplete,
- LevelUp,
- TreasureProgress,
- BetterEquip,
- }
}
diff --git a/Main/Utility/ComponentExtersion.cs b/Main/Utility/ComponentExtersion.cs
index cf2a056..5df6987 100644
--- a/Main/Utility/ComponentExtersion.cs
+++ b/Main/Utility/ComponentExtersion.cs
@@ -238,7 +238,7 @@
switch (pattern)
{
case 1:
- _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.LightYellow : TextColType.White);
+ _btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.LightWhite : TextColType.White);
break;
case 2:
_btnTxt.color = UIHelper.GetUIColor(_colorful ? TextColType.Green : TextColType.White);
diff --git a/Main/Utility/EnumHelper.cs b/Main/Utility/EnumHelper.cs
index 5252008..db2a6d9 100644
--- a/Main/Utility/EnumHelper.cs
+++ b/Main/Utility/EnumHelper.cs
@@ -449,7 +449,7 @@
PlayerName = 2, //瑙掕壊鍚�,size , 14 2,
Sex = 3, //鎬у埆 3,
Hair = 4, //鍙戝瀷 1.鏍囧噯鍨嬶紙鐢凤級 2.鍚嶄粫鍨� 3.娴瓙鍨� 4.鏍囧噯鍨嬶紙濂筹級 5.椹鍨� 6.濡╁獨鍨� 4,
- HairColor = 5, //澶村彂棰滆壊 5绉� 5,
+ FacePic = 5, //澶村儚妗� 5, 锛堟棫鐨凥airColor锛�
Face = 6, //鍩烘湰鑴稿瀷 6,
Job = 7, //鑱屼笟
LV = 8, //绛夌骇 8,
@@ -466,7 +466,7 @@
GoldPaper = 19, //閲戠エ 19,
Silver = 20, //閾跺瓙 20,
SilverPaper = 21, //閾剁エ 21,
- FightPoint = 22, //鎴樻枟鍊� 22,
+ //FightPoint = 22, //鎴樻枟鍊� 22,
HappyPoint = 23, //濞变箰鍊� 23,
MapID = 24, //瑙掕壊鎵�鍦ㄥ湴鍥� 24,
PosX = 25, //瑙掕壊鍧愭爣 25,
@@ -1082,7 +1082,7 @@
/// <summary>
/// fff4cd
/// </summary>
- LightYellow = 15,
+ LightWhite = 15,
/// <summary>
/// (204, 204, 204, 255)
/// </summary>
diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs
index 22002a9..4853b76 100644
--- a/Main/Utility/UIHelper.cs
+++ b/Main/Utility/UIHelper.cs
@@ -500,7 +500,7 @@
#region 鏂囧瓧鑹插�� Bright 鍜� Dark鎸囪儗鏅壊绯绘槸鏄庤繕鏄殫锛屾殫搴曚寒瀛楋紝浜簳鏆楀瓧鐨勮鍒�
public static readonly Color s_BrightPinkColor = new Color32(246, 64, 141, 255);
- public static readonly Color s_BrightRedColor = new Color32(255, 3, 3, 255);
+ public static readonly Color s_BrightRedColor = new Color32(234, 38, 30, 255);
public static readonly Color s_BrightPurpleColor = new Color32(218, 72, 213, 255);
public static readonly Color s_BrightBlueColor = new Color32(0, 107, 227, 255); //006BE3FF
public static readonly Color s_BrightOrangeColor = new Color32(255, 103, 1, 255); //FF6701FF
@@ -508,7 +508,7 @@
public static readonly Color s_BrightGreenColor = new Color32(36, 139, 18, 255); //248b12
public static readonly Color s_DarkPinkColor = new Color32(255, 124, 124, 255);
- public static readonly Color s_DarkRedColor = new Color32(250, 1, 1, 255);
+ public static readonly Color s_DarkRedColor = new Color32(234, 38, 30, 255);
public static readonly Color s_DarkPurpleColor = new Color32(236, 75, 246, 255);
public static readonly Color s_DarkBlueColor = new Color32(49, 206, 251, 255);//31cefb
public static readonly Color s_DarkOrangeColor = new Color32(248, 152, 59, 255);
@@ -519,7 +519,7 @@
public static readonly Color s_Black = new Color32(0, 0, 0, 255);
public static readonly Color s_NavyYellow = new Color32(255, 239, 71, 255);
public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337
- public static readonly Color s_LightYellow = new Color32(245, 246, 230, 255); //f5f6e6
+ public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6
public static readonly Color s_Gray = new Color32(204, 204, 204, 255);
public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47
public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b
@@ -650,8 +650,8 @@
return s_NavyYellow;
case TextColType.LightGreen:
return s_LightGreen;
- case TextColType.LightYellow:
- return s_LightYellow;
+ case TextColType.LightWhite:
+ return s_LightWhite;
case TextColType.Gray:
return s_Gray;
}
@@ -680,7 +680,7 @@
case TextColType.Orange:
return StringUtility.Contact("<color=#", bright ? "ff6701" : "f8983b", ">", msg, "</color>");
case TextColType.Red:
- return StringUtility.Contact("<color=#", bright ? "ff0303" : "ff0101", ">", msg, "</color>");
+ return StringUtility.Contact("<color=#", bright ? "ea261e" : "ea261e", ">", msg, "</color>");
case TextColType.Pink:
return StringUtility.Contact("<color=#", bright ? "f6408d" : "ff7c7c", ">", msg, "</color>");
case TextColType.Green:
@@ -691,7 +691,7 @@
return StringUtility.Contact("<color=#", "109d06", ">", msg, "</color>");
case TextColType.Black:
return StringUtility.Contact("<color=#", "000000", ">", msg, "</color>");
- case TextColType.LightYellow:
+ case TextColType.LightWhite:
return StringUtility.Contact("<color=#", "f5f646", ">", msg, "</color>");
case TextColType.LightGreen:
return StringUtility.Contact("<color=#", "8ddc11", ">", msg, "</color>");
@@ -701,20 +701,20 @@
return msg;
}
- //needName 鎸囧鐣�0鏄惁闇�瑕佸悕绉�
- // public static string GetRealmName(int realmLv, bool bright = false, bool needName = false)
- // {
- // if (realmLv <= 0 && !needName)
- // {
- // return string.Empty;
- // }
- // var config = RealmConfig.Get(realmLv);
- // if (config == null)
- // {
- // return string.Empty;
- // }
- // return GetRealmColorByLv(realmLv, config.Name, bright);
- // }
+ //needName 鎸囧畼鑱�0鏄惁闇�瑕佸悕绉�
+ public static string GetRealmName(int realmLv, bool bright = false, bool needName = false)
+ {
+ if (realmLv <= 0 && !needName)
+ {
+ return string.Empty;
+ }
+ var config = RealmConfig.Get(realmLv);
+ if (config == null)
+ {
+ return string.Empty;
+ }
+ return GetRealmColorByLv(realmLv, config.Name, bright);
+ }
//strFormat闄勫姞 澧冪晫鍚嶄互澶栫殑鏂囧瓧
//needName 鎸囧鐣�0鏄惁闇�瑕佸悕绉�
@@ -732,31 +732,31 @@
// return GetRealmColorByLv(realmLv, string.Format(strFormat, config.Name), bright);
// }
- // public static string GetRealmColorByLv(int realmLv, string msg, bool bright = false)
- // {
- // var config = RealmConfig.Get(realmLv);
- // if (config == null)
- // {
- // return string.Empty;
- // }
- // switch (config.Quality)
- // {
- // case 1:
- // return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>");
- // case 2:
- // return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>");
- // case 3:
- // return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>");
- // case 4:
- // return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>");
- // case 5:
- // return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>");
- // case 6:
- // return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>");
- // default:
- // return msg;
- // }
- // }
+ public static string GetRealmColorByLv(int realmLv, string msg, bool bright = false)
+ {
+ var config = RealmConfig.Get(realmLv);
+ if (config == null)
+ {
+ return string.Empty;
+ }
+ switch (config.Quality)
+ {
+ case 1:
+ return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>");
+ case 2:
+ return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>");
+ case 3:
+ return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>");
+ case 4:
+ return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>");
+ case 5:
+ return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>");
+ case 6:
+ return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>");
+ default:
+ return msg;
+ }
+ }
public static string AppendColor(int itemColor, string msg, bool bright = false)
{
--
Gitblit v1.8.0