From a1ca992e322db3af152575d3df48e3a2b17078a0 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期一, 20 五月 2019 17:09:51 +0800
Subject: [PATCH] 3335 缥缈仙域优化
---
System/HazyRegion/HazyRegionModel.cs | 2
Lua/Gen/HazyRegionConfigWrap.cs | 15 -
System/HazyRegion/HazyRegionIncidentBehaviour.cs | 2
Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta | 2
Core/GameEngine/Model/Config/HazyRegionConfig.cs | 403 +++++++++++++++++++++++++-------------------------
5 files changed, 204 insertions(+), 220 deletions(-)
diff --git a/Core/GameEngine/Model/Config/HazyRegionConfig.cs b/Core/GameEngine/Model/Config/HazyRegionConfig.cs
index 24df137..c7fcdd4 100644
--- a/Core/GameEngine/Model/Config/HazyRegionConfig.cs
+++ b/Core/GameEngine/Model/Config/HazyRegionConfig.cs
@@ -1,41 +1,41 @@
-锘�//--------------------------------------------------------
-// [Author]: Fish
-// [ Date ]: Wednesday, May 15, 2019
-//--------------------------------------------------------
-
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using System;
-using UnityEngine;
-
-[XLua.LuaCallCSharp]
-public partial class HazyRegionConfig
-{
-
+锘�//--------------------------------------------------------
+// [Author]: Fish
+// [ Date ]: Monday, May 20, 2019
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+using System;
+using UnityEngine;
+
+[XLua.LuaCallCSharp]
+public partial class HazyRegionConfig
+{
+
public readonly int id;
public readonly int incidentType;
public readonly string name;
public readonly int dungeonId;
public readonly int lineId;
public readonly int npcId;
- public readonly int crossServer;
+ public readonly int dungeonType;
public readonly int point;
public readonly int alchemyLevel;
public readonly int[] reward;
public readonly int[] rewardState;
- public readonly string PortraitID;
-
- public HazyRegionConfig()
- {
- }
-
- public HazyRegionConfig(string input)
- {
- try
- {
- var tables = input.Split('\t');
-
+ public readonly string PortraitID;
+
+ public HazyRegionConfig()
+ {
+ }
+
+ public HazyRegionConfig(string input)
+ {
+ try
+ {
+ var tables = input.Split('\t');
+
int.TryParse(tables[0],out id);
int.TryParse(tables[1],out incidentType);
@@ -48,7 +48,7 @@
int.TryParse(tables[5],out npcId);
- int.TryParse(tables[6],out crossServer);
+ int.TryParse(tables[6],out dungeonType);
int.TryParse(tables[7],out point);
@@ -68,176 +68,175 @@
int.TryParse(rewardStateStringArray[i],out rewardState[i]);
}
- PortraitID = tables[11];
- }
- catch (Exception ex)
- {
- DebugEx.Log(ex);
- }
- }
-
- static Dictionary<string, HazyRegionConfig> configs = new Dictionary<string, HazyRegionConfig>();
- public static HazyRegionConfig Get(string id)
- {
- if (!inited)
- {
- Debug.Log("HazyRegionConfig 杩樻湭瀹屾垚鍒濆鍖栥��");
- return null;
- }
-
- if (configs.ContainsKey(id))
- {
- return configs[id];
- }
-
- HazyRegionConfig config = null;
- if (rawDatas.ContainsKey(id))
- {
- config = configs[id] = new HazyRegionConfig(rawDatas[id]);
- rawDatas.Remove(id);
- }
-
- return config;
- }
-
- public static HazyRegionConfig Get(int id)
- {
- return Get(id.ToString());
- }
-
- public static List<string> GetKeys()
- {
- var keys = new List<string>();
- keys.AddRange(configs.Keys);
- keys.AddRange(rawDatas.Keys);
- return keys;
- }
-
- public static List<HazyRegionConfig> GetValues()
- {
- var values = new List<HazyRegionConfig>();
- values.AddRange(configs.Values);
-
- var keys = new List<string>(rawDatas.Keys);
- foreach (var key in keys)
- {
- values.Add(Get(key));
- }
-
- return values;
- }
-
- public static bool Has(string id)
- {
- return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
- }
-
- public static bool Has(int id)
- {
- return Has(id.ToString());
- }
-
- public static bool inited { get; private set; }
- protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
- public static void Init(bool sync=false)
- {
- inited = false;
- var path = string.Empty;
- if (AssetSource.refdataFromEditor)
- {
- path = ResourcesPath.CONFIG_FODLER +"/HazyRegion.txt";
- }
- else
- {
- path = AssetVersionUtility.GetAssetFilePath("config/HazyRegion.txt");
- }
-
- configs.Clear();
- var tempConfig = new HazyRegionConfig();
- var preParse = tempConfig is IConfigPostProcess;
-
- if (sync)
- {
- var lines = File.ReadAllLines(path);
- if (!preParse)
- {
- rawDatas = new Dictionary<string, string>(lines.Length - 3);
- }
- for (int i = 3; i < lines.Length; i++)
- {
- try
- {
- var line = lines[i];
- var index = line.IndexOf("\t");
- if (index == -1)
- {
- continue;
- }
- var id = line.Substring(0, index);
-
- if (preParse)
- {
- var config = new HazyRegionConfig(line);
- configs[id] = config;
- (config as IConfigPostProcess).OnConfigParseCompleted();
- }
- else
- {
- rawDatas[id] = line;
- }
- }
- catch (System.Exception ex)
- {
- Debug.LogError(ex);
- }
- }
- inited = true;
- }
- else
- {
- ThreadPool.QueueUserWorkItem((object _object) =>
- {
- var lines = File.ReadAllLines(path);
- if (!preParse)
- {
- rawDatas = new Dictionary<string, string>(lines.Length - 3);
- }
- for (int i = 3; i < lines.Length; i++)
- {
- try
- {
- var line = lines[i];
- var index = line.IndexOf("\t");
- if (index == -1)
- {
- continue;
- }
- var id = line.Substring(0, index);
-
- if (preParse)
- {
- var config = new HazyRegionConfig(line);
- configs[id] = config;
- (config as IConfigPostProcess).OnConfigParseCompleted();
- }
- else
- {
- rawDatas[id] = line;
- }
- }
- catch (System.Exception ex)
- {
- Debug.LogError(ex);
- }
- }
-
- inited = true;
- });
- }
- }
-
-}
-
-
-
-
+ PortraitID = tables[11];
+ }
+ catch (Exception ex)
+ {
+ DebugEx.Log(ex);
+ }
+ }
+
+ static Dictionary<string, HazyRegionConfig> configs = new Dictionary<string, HazyRegionConfig>();
+ public static HazyRegionConfig Get(string id)
+ {
+ if (!inited)
+ {
+ Debug.Log("HazyRegionConfig 杩樻湭瀹屾垚鍒濆鍖栥��");
+ return null;
+ }
+
+ if (configs.ContainsKey(id))
+ {
+ return configs[id];
+ }
+
+ HazyRegionConfig config = null;
+ if (rawDatas.ContainsKey(id))
+ {
+ config = configs[id] = new HazyRegionConfig(rawDatas[id]);
+ rawDatas.Remove(id);
+ }
+
+ return config;
+ }
+
+ public static HazyRegionConfig Get(int id)
+ {
+ return Get(id.ToString());
+ }
+
+ public static List<string> GetKeys()
+ {
+ var keys = new List<string>();
+ keys.AddRange(configs.Keys);
+ keys.AddRange(rawDatas.Keys);
+ return keys;
+ }
+
+ public static List<HazyRegionConfig> GetValues()
+ {
+ var values = new List<HazyRegionConfig>();
+ values.AddRange(configs.Values);
+
+ var keys = new List<string>(rawDatas.Keys);
+ foreach (var key in keys)
+ {
+ values.Add(Get(key));
+ }
+
+ return values;
+ }
+
+ public static bool Has(string id)
+ {
+ return configs.ContainsKey(id) || rawDatas.ContainsKey(id);
+ }
+
+ public static bool Has(int id)
+ {
+ return Has(id.ToString());
+ }
+
+ public static bool inited { get; private set; }
+ protected static Dictionary<string, string> rawDatas = new Dictionary<string, string>();
+ public static void Init(bool sync=false)
+ {
+ inited = false;
+ var path = string.Empty;
+ if (AssetSource.refdataFromEditor)
+ {
+ path = ResourcesPath.CONFIG_FODLER +"/HazyRegion.txt";
+ }
+ else
+ {
+ path = AssetVersionUtility.GetAssetFilePath("config/HazyRegion.txt");
+ }
+
+ var tempConfig = new HazyRegionConfig();
+ var preParse = tempConfig is IConfigPostProcess;
+
+ if (sync)
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new HazyRegionConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+ inited = true;
+ }
+ else
+ {
+ ThreadPool.QueueUserWorkItem((object _object) =>
+ {
+ var lines = File.ReadAllLines(path);
+ if (!preParse)
+ {
+ rawDatas = new Dictionary<string, string>(lines.Length - 3);
+ }
+ for (int i = 3; i < lines.Length; i++)
+ {
+ try
+ {
+ var line = lines[i];
+ var index = line.IndexOf("\t");
+ if (index == -1)
+ {
+ continue;
+ }
+ var id = line.Substring(0, index);
+
+ if (preParse)
+ {
+ var config = new HazyRegionConfig(line);
+ configs[id] = config;
+ (config as IConfigPostProcess).OnConfigParseCompleted();
+ }
+ else
+ {
+ rawDatas[id] = line;
+ }
+ }
+ catch (System.Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+
+ inited = true;
+ });
+ }
+ }
+
+}
+
+
+
+
diff --git a/Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta b/Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta
index dbfb1bb..b57d348 100644
--- a/Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta
+++ b/Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 3404c0f308cb2174bb7b93e12c3110bd
-timeCreated: 1557892243
+timeCreated: 1558343195
licenseType: Pro
MonoImporter:
serializedVersion: 2
diff --git a/Lua/Gen/HazyRegionConfigWrap.cs b/Lua/Gen/HazyRegionConfigWrap.cs
index 1076b01..f030706 100644
--- a/Lua/Gen/HazyRegionConfigWrap.cs
+++ b/Lua/Gen/HazyRegionConfigWrap.cs
@@ -31,7 +31,6 @@
Utils.RegisterFunc(L, Utils.GETTER_IDX, "dungeonId", _g_get_dungeonId);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "lineId", _g_get_lineId);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "npcId", _g_get_npcId);
- Utils.RegisterFunc(L, Utils.GETTER_IDX, "crossServer", _g_get_crossServer);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "point", _g_get_point);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "alchemyLevel", _g_get_alchemyLevel);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "reward", _g_get_reward);
@@ -362,20 +361,6 @@
HazyRegionConfig gen_to_be_invoked = (HazyRegionConfig)translator.FastGetCSObj(L, 1);
LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.npcId);
- } catch(System.Exception gen_e) {
- return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
- }
- return 1;
- }
-
- [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
- static int _g_get_crossServer(RealStatePtr L)
- {
- try {
- ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
-
- HazyRegionConfig gen_to_be_invoked = (HazyRegionConfig)translator.FastGetCSObj(L, 1);
- LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.crossServer);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
diff --git a/System/HazyRegion/HazyRegionIncidentBehaviour.cs b/System/HazyRegion/HazyRegionIncidentBehaviour.cs
index b1a7347..297876e 100644
--- a/System/HazyRegion/HazyRegionIncidentBehaviour.cs
+++ b/System/HazyRegion/HazyRegionIncidentBehaviour.cs
@@ -145,7 +145,7 @@
m_Icon.SetSprite(config.PortraitID);
m_Icon.SetNativeSize();
m_Icon.material = m_SmoothMask.imageMaterials[0];
- m_ContainerCrossServer.gameObject.SetActive(!model.InFakeHazyRegion && config.crossServer == 1);
+ m_ContainerCrossServer.gameObject.SetActive(!model.InFakeHazyRegion && config.dungeonType == 2);
m_ContainerMustSign.gameObject.SetActive(false);
}
diff --git a/System/HazyRegion/HazyRegionModel.cs b/System/HazyRegion/HazyRegionModel.cs
index 9bf913a..efa1906 100644
--- a/System/HazyRegion/HazyRegionModel.cs
+++ b/System/HazyRegion/HazyRegionModel.cs
@@ -514,7 +514,7 @@
void SendGotoIncidentDungeon(HazyRegionConfig config)
{
- if (config.crossServer == 1)
+ if (config.dungeonType == 2)
{
var pak = new CC105_tagCMEnterCrossServer();
pak.DataMapID = (uint)config.dungeonId;
--
Gitblit v1.8.0