Просмотр исходного кода

修改ExcelExporter,搜集所有Package中的Excel目录导出

tanghai 1 год назад
Родитель
Сommit
b2157d67c2
77 измененных файлов с 1497 добавлено и 63 удалено
  1. BIN
      Config/Excel/c/AIConfigCategory.bytes
  2. BIN
      Config/Excel/c/UnitConfigCategory.bytes
  3. BIN
      Config/Excel/cs/AIConfigCategory.bytes
  4. BIN
      Config/Excel/cs/UnitConfigCategory.bytes
  5. BIN
      Config/Excel/s/AIConfigCategory.bytes
  6. BIN
      Config/Excel/s/UnitConfigCategory.bytes
  7. 0 5
      Config/Json/c/AIConfig.txt
  8. 0 5
      Config/Json/c/UnitConfig.txt
  9. 0 5
      Config/Json/cs/AIConfig.txt
  10. 0 6
      Config/Json/cs/UnitConfig.txt
  11. 0 5
      Config/Json/s/AIConfig.txt
  12. 0 5
      Config/Json/s/UnitConfig.txt
  13. 4 0
      DotNet/Model/DotNet.Model.csproj
  14. 69 0
      Generate/ClientServer/Excel/StartMachineConfig.cs
  15. 67 0
      Generate/ClientServer/Excel/StartProcessConfig.cs
  16. 73 0
      Generate/ClientServer/Excel/StartSceneConfig.cs
  17. 67 0
      Generate/ClientServer/Excel/StartZoneConfig.cs
  18. 69 0
      Generate/Server/Excel/StartMachineConfig.cs
  19. 67 0
      Generate/Server/Excel/StartProcessConfig.cs
  20. 73 0
      Generate/Server/Excel/StartSceneConfig.cs
  21. 67 0
      Generate/Server/Excel/StartZoneConfig.cs
  22. 48 19
      Share/Tool/ExcelExporter/ExcelExporter.cs
  23. 47 8
      Share/Tool/Proto2CS/Proto2CS.cs
  24. BIN
      Unity/Assets/Bundles/Config/AIConfigCategory.bytes
  25. BIN
      Unity/Assets/Bundles/Config/UnitConfigCategory.bytes
  26. 8 0
      Unity/Packages/com.et.core/Excel.meta
  27. 8 0
      Unity/Packages/com.et.core/Excel/StartConfig.meta
  28. 8 0
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark.meta
  29. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartMachineConfig@s.xlsx
  30. 2 2
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartMachineConfig@s.xlsx.meta
  31. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartProcessConfig@s.xlsx
  32. 2 2
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartProcessConfig@s.xlsx.meta
  33. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartSceneConfig@s.xlsx
  34. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartSceneConfig@s.xlsx.meta
  35. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartZoneConfig@s.xlsx
  36. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartZoneConfig@s.xlsx.meta
  37. 8 0
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost.meta
  38. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartMachineConfig@s.xlsx
  39. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartMachineConfig@s.xlsx.meta
  40. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartProcessConfig@s.xlsx
  41. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartProcessConfig@s.xlsx.meta
  42. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartSceneConfig@s.xlsx
  43. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartSceneConfig@s.xlsx.meta
  44. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartZoneConfig@s.xlsx
  45. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartZoneConfig@s.xlsx.meta
  46. 8 0
      Unity/Packages/com.et.core/Excel/StartConfig/Release.meta
  47. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartMachineConfig@s.xlsx
  48. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartMachineConfig@s.xlsx.meta
  49. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartProcessConfig@s.xlsx
  50. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartProcessConfig@s.xlsx.meta
  51. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartSceneConfig@s.xlsx
  52. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartSceneConfig@s.xlsx.meta
  53. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartZoneConfig@s.xlsx
  54. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/Release/StartZoneConfig@s.xlsx.meta
  55. 8 0
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest.meta
  56. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartMachineConfig@s.xlsx
  57. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartMachineConfig@s.xlsx.meta
  58. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartProcessConfig@s.xlsx
  59. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartProcessConfig@s.xlsx.meta
  60. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartSceneConfig@s.xlsx
  61. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartSceneConfig@s.xlsx.meta
  62. BIN
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartZoneConfig@s.xlsx
  63. 7 0
      Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartZoneConfig@s.xlsx.meta
  64. 8 0
      Unity/Packages/com.et.core/Proto.meta
  65. 21 0
      Unity/Packages/com.et.core/Proto/ClientMessage_C_1000.proto
  66. 7 0
      Unity/Packages/com.et.core/Proto/ClientMessage_C_1000.proto.meta
  67. 177 0
      Unity/Packages/com.et.core/Proto/InnerMessage_S_20001.proto
  68. 7 0
      Unity/Packages/com.et.core/Proto/InnerMessage_S_20001.proto.meta
  69. 67 0
      Unity/Packages/com.et.core/Proto/LockStepInner_S_21001.proto
  70. 7 0
      Unity/Packages/com.et.core/Proto/LockStepInner_S_21001.proto.meta
  71. 81 0
      Unity/Packages/com.et.core/Proto/LockStepOuter_C_11001.proto
  72. 7 0
      Unity/Packages/com.et.core/Proto/LockStepOuter_C_11001.proto.meta
  73. 235 0
      Unity/Packages/com.et.core/Proto/OuterMessage_C_10001.proto
  74. 7 0
      Unity/Packages/com.et.core/Proto/OuterMessage_C_10001.proto.meta
  75. 33 0
      Unity/Packages/com.et.core/Scripts/CodeMode~/ClientServer/StartProcessConfig.cs
  76. 33 0
      Unity/Packages/com.et.core/Scripts/CodeMode~/Server/StartProcessConfig.cs
  77. 6 1
      Unity/Packages/com.et.loader/Scripts/Editor/AssetPostProcessor/OnGenerateCSProjectProcessor.cs

BIN
Config/Excel/c/AIConfigCategory.bytes


BIN
Config/Excel/c/UnitConfigCategory.bytes


BIN
Config/Excel/cs/AIConfigCategory.bytes


BIN
Config/Excel/cs/UnitConfigCategory.bytes


BIN
Config/Excel/s/AIConfigCategory.bytes


BIN
Config/Excel/s/UnitConfigCategory.bytes


+ 0 - 5
Config/Json/c/AIConfig.txt

@@ -1,5 +0,0 @@
-{"dict": [
-[101, {"_t":"AIConfig","_id":101,"AIConfigId":1,"Order":1,"Name":"AI_Attack","NodeParams":[]}],
-[102, {"_t":"AIConfig","_id":102,"AIConfigId":1,"Order":2,"Name":"AI_XunLuo","NodeParams":[]}],
-[201, {"_t":"AIConfig","_id":201,"AIConfigId":2,"Order":1,"Name":"AI_XunLuo","NodeParams":[]}],
-]}

+ 0 - 5
Config/Json/c/UnitConfig.txt

@@ -1,5 +0,0 @@
-{"dict": [
-[1001, {"_t":"UnitConfig","_id":1001,"Type":1,"Name":"米克尔","Position":1,"Height":178}],
-[1002, {"_t":"UnitConfig","_id":1002,"Type":1,"Name":"米克尔2","Position":2,"Height":278}],
-[1004, {"_t":"UnitConfig","_id":1004,"Type":1,"Name":"米克尔4","Position":2,"Height":278}],
-]}

+ 0 - 5
Config/Json/cs/AIConfig.txt

@@ -1,5 +0,0 @@
-{"dict": [
-[101, {"_t":"AIConfig","_id":101,"AIConfigId":1,"Order":1,"Name":"AI_Attack","NodeParams":[]}],
-[102, {"_t":"AIConfig","_id":102,"AIConfigId":1,"Order":2,"Name":"AI_XunLuo","NodeParams":[]}],
-[201, {"_t":"AIConfig","_id":201,"AIConfigId":2,"Order":1,"Name":"AI_XunLuo","NodeParams":[]}],
-]}

+ 0 - 6
Config/Json/cs/UnitConfig.txt

@@ -1,6 +0,0 @@
-{"dict": [
-[1001, {"_t":"UnitConfig","_id":1001,"Type":1,"Name":"米克尔","Position":1,"Height":178,"Weight":68}],
-[1002, {"_t":"UnitConfig","_id":1002,"Type":1,"Name":"米克尔2","Position":2,"Height":278,"Weight":78}],
-[1003, {"_t":"UnitConfig","_id":1003,"Type":1,"Name":"米克尔3","Position":1,"Height":178,"Weight":68}],
-[1004, {"_t":"UnitConfig","_id":1004,"Type":1,"Name":"米克尔4","Position":2,"Height":278,"Weight":78}],
-]}

+ 0 - 5
Config/Json/s/AIConfig.txt

@@ -1,5 +0,0 @@
-{"dict": [
-[101, {"_t":"AIConfig","_id":101,"AIConfigId":1,"Order":1,"Name":"AI_Attack","NodeParams":[]}],
-[102, {"_t":"AIConfig","_id":102,"AIConfigId":1,"Order":2,"Name":"AI_XunLuo","NodeParams":[]}],
-[201, {"_t":"AIConfig","_id":201,"AIConfigId":2,"Order":1,"Name":"AI_XunLuo","NodeParams":[]}],
-]}

+ 0 - 5
Config/Json/s/UnitConfig.txt

@@ -1,5 +0,0 @@
-{"dict": [
-[1001, {"_t":"UnitConfig","_id":1001,"Type":1,"Name":"米克尔","Position":1,"Weight":68}],
-[1002, {"_t":"UnitConfig","_id":1002,"Type":1,"Name":"米克尔2","Position":2,"Weight":78}],
-[1003, {"_t":"UnitConfig","_id":1003,"Type":1,"Name":"米克尔3","Position":1,"Weight":68}],
-]}

+ 4 - 0
DotNet/Model/DotNet.Model.csproj

@@ -50,6 +50,10 @@
         <Compile Include="..\..\Unity\Packages\com.et.*\Scripts\Model~\Server\**\*.cs">
             <Link>Server/$([System.String]::new(%(RecursiveDir)).Substring(7, $([System.String]::new(%(RecursiveDir)).Indexof("Scripts"))).Replace("Scripts", ""))/%(FileName)%(Extension)</Link>
         </Compile>
+
+        <Compile Include="..\..\Unity\Packages\com.et.*\Scripts\CodeMode~\Server\**\*.cs"><Link>CodeMode/$([System.String]::new(%(RecursiveDir)).Substring(7, $([System.String]::new(%(RecursiveDir)).Indexof("Scripts"))).Replace("Scripts", ""))/%(FileName)%(Extension)</Link></Compile>
+
+        <Compile Include="..\..\Generate\Server\**\*.cs"><Link>Generate\%(RecursiveDir)%(FileName)%(Extension)</Link></Compile>
         
     </ItemGroup> 
     <ItemGroup> 

+ 69 - 0
Generate/ClientServer/Excel/StartMachineConfig.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartMachineConfigCategory : Singleton<StartMachineConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartMachineConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartMachineConfigCategory s = o as StartMachineConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartMachineConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartMachineConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartMachineConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartMachineConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartMachineConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartMachineConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>内网地址</summary>
+		public string InnerIP { get; set; }
+		/// <summary>外网地址</summary>
+		public string OuterIP { get; set; }
+		/// <summary>守护进程端口</summary>
+		public string WatcherPort { get; set; }
+
+	}
+}

+ 67 - 0
Generate/ClientServer/Excel/StartProcessConfig.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartProcessConfigCategory : Singleton<StartProcessConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartProcessConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartProcessConfigCategory s = o as StartProcessConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartProcessConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartProcessConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartProcessConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartProcessConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartProcessConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartProcessConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>所属机器</summary>
+		public int MachineId { get; set; }
+		/// <summary>外网端口</summary>
+		public int Port { get; set; }
+
+	}
+}

+ 73 - 0
Generate/ClientServer/Excel/StartSceneConfig.cs

@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartSceneConfigCategory : Singleton<StartSceneConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartSceneConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartSceneConfigCategory s = o as StartSceneConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartSceneConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartSceneConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartSceneConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartSceneConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartSceneConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartSceneConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>所属进程</summary>
+		public int Process { get; set; }
+		/// <summary>所属区</summary>
+		public int Zone { get; set; }
+		/// <summary>类型</summary>
+		public string SceneType { get; set; }
+		/// <summary>名字</summary>
+		public string Name { get; set; }
+		/// <summary>外网端口</summary>
+		public int Port { get; set; }
+
+	}
+}

+ 67 - 0
Generate/ClientServer/Excel/StartZoneConfig.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartZoneConfigCategory : Singleton<StartZoneConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartZoneConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartZoneConfigCategory s = o as StartZoneConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartZoneConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartZoneConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartZoneConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartZoneConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartZoneConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartZoneConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>数据库地址</summary>
+		public string DBConnection { get; set; }
+		/// <summary>数据库名</summary>
+		public string DBName { get; set; }
+
+	}
+}

+ 69 - 0
Generate/Server/Excel/StartMachineConfig.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartMachineConfigCategory : Singleton<StartMachineConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartMachineConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartMachineConfigCategory s = o as StartMachineConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartMachineConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartMachineConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartMachineConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartMachineConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartMachineConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartMachineConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>内网地址</summary>
+		public string InnerIP { get; set; }
+		/// <summary>外网地址</summary>
+		public string OuterIP { get; set; }
+		/// <summary>守护进程端口</summary>
+		public string WatcherPort { get; set; }
+
+	}
+}

+ 67 - 0
Generate/Server/Excel/StartProcessConfig.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartProcessConfigCategory : Singleton<StartProcessConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartProcessConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartProcessConfigCategory s = o as StartProcessConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartProcessConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartProcessConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartProcessConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartProcessConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartProcessConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartProcessConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>所属机器</summary>
+		public int MachineId { get; set; }
+		/// <summary>外网端口</summary>
+		public int Port { get; set; }
+
+	}
+}

+ 73 - 0
Generate/Server/Excel/StartSceneConfig.cs

@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartSceneConfigCategory : Singleton<StartSceneConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartSceneConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartSceneConfigCategory s = o as StartSceneConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartSceneConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartSceneConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartSceneConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartSceneConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartSceneConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartSceneConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>所属进程</summary>
+		public int Process { get; set; }
+		/// <summary>所属区</summary>
+		public int Zone { get; set; }
+		/// <summary>类型</summary>
+		public string SceneType { get; set; }
+		/// <summary>名字</summary>
+		public string Name { get; set; }
+		/// <summary>外网端口</summary>
+		public int Port { get; set; }
+
+	}
+}

+ 67 - 0
Generate/Server/Excel/StartZoneConfig.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using MongoDB.Bson.Serialization.Attributes;
+using MongoDB.Bson.Serialization.Options;
+using System.ComponentModel;
+
+namespace ET
+{
+    [Config]
+    public partial class StartZoneConfigCategory : Singleton<StartZoneConfigCategory>, IMerge
+    {
+        [BsonElement]
+        [BsonDictionaryOptions(DictionaryRepresentation.ArrayOfArrays)]
+        private Dictionary<int, StartZoneConfig> dict = new();
+		
+        public void Merge(object o)
+        {
+            StartZoneConfigCategory s = o as StartZoneConfigCategory;
+            foreach (var kv in s.dict)
+            {
+                this.dict.Add(kv.Key, kv.Value);
+            }
+        }
+		
+        public StartZoneConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartZoneConfig item);
+
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartZoneConfig)},配置id: {id}");
+            }
+
+            return item;
+        }
+		
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
+
+        public Dictionary<int, StartZoneConfig> GetAll()
+        {
+            return this.dict;
+        }
+
+        public StartZoneConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
+
+	public partial class StartZoneConfig: ProtoObject, IConfig
+	{
+		/// <summary>Id</summary>
+		public int Id { get; set; }
+		/// <summary>数据库地址</summary>
+		public string DBConnection { get; set; }
+		/// <summary>数据库名</summary>
+		public string DBName { get; set; }
+
+	}
+}

+ 48 - 19
Share/Tool/ExcelExporter/ExcelExporter.cs

@@ -55,13 +55,11 @@ namespace ET
     {
         private static string template;
 
-        private const string ClientClassDir = "../Unity/Assets/Scripts/Model/Generate/Client/Config";
+        private const string ClientClassDir = "../Generate/Client/Excel/";
         // 服务端因为机器人的存在必须包含客户端所有配置,所以单独的c字段没有意义,单独的c就表示cs
-        private const string ServerClassDir = "../Unity/Assets/Scripts/Model/Generate/Server/Config";
+        private const string ServerClassDir = "../Generate/Server/Excel/";
 
-        private const string CSClassDir = "../Unity/Assets/Scripts/Model/Generate/ClientServer/Config";
-
-        private const string excelDir = "../Unity/Assets/Config/Excel/";
+        private const string CSClassDir = "../Generate/ClientServer/Excel/";
 
         private const string jsonDir = "../Config/Json/{0}/{1}";
 
@@ -103,19 +101,19 @@ namespace ET
                 template = File.ReadAllText("Template.txt");
                 ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
 
-                if (Directory.Exists(ClientClassDir))
+                if (!Directory.Exists(ClientClassDir))
                 {
-                    Directory.Delete(ClientClassDir, true);
+                    Directory.CreateDirectory(ClientClassDir);
                 }
 
-                if (Directory.Exists(ServerClassDir))
+                if (!Directory.Exists(ServerClassDir))
                 {
-                    Directory.Delete(ServerClassDir, true);
+                    Directory.CreateDirectory(ServerClassDir);
                 }
 
-                if (Directory.Exists(CSClassDir))
+                if (!Directory.Exists(CSClassDir))
                 {
-                    Directory.Delete(CSClassDir, true);
+                    Directory.CreateDirectory(CSClassDir);
                 }
 
                 string jsonProtoDirParent = jsonDir.Replace(replaceStr, string.Empty);
@@ -129,9 +127,42 @@ namespace ET
                 {
                     Directory.Delete(serverProtoDirParent, true);
                 }
+                
+                List<string> list = new List<string>();
+                foreach (string directory in Directory.GetDirectories("../Unity/Packages", "com.et.*"))
+                {
+                    string p = Path.Combine(directory, "Excel");
+                    if (!Directory.Exists(p))
+                    {
+                        continue;
+                    }
+                    list.Add(p);
+                }
+                
+                foreach (string directory in Directory.GetDirectories("../Unity/Library/PackageCache", "com.et.*"))
+                {
+                    string p = Path.Combine(directory, "Excel");
+                    if (!Directory.Exists(p))
+                    {
+                        continue;
+                    }
+                    list.Add(p);
+                }
 
-                List<string> files = FileHelper.GetAllFiles(excelDir);
-                foreach (string path in files)
+                List<(string, string)> paths = new List<(string, string)>();
+                foreach (string s in list)
+                {
+                    var aa = FileHelper.GetAllFiles(s);
+                    foreach (string k in aa)
+                    {
+                        if (k.EndsWith(".xlsx") || k.EndsWith(".xlsm"))
+                        {
+                            paths.Add((s, k));
+                        }
+                    }
+                }
+                
+                foreach ((string s, string path) in paths)
                 {
                     string fileName = Path.GetFileName(path);
                     if (!fileName.EndsWith(".xlsx") || fileName.StartsWith("~$") || fileName.Contains("#"))
@@ -194,12 +225,10 @@ namespace ET
                 configAssemblies[(int) ConfigType.c] = DynamicBuild(ConfigType.c);
                 configAssemblies[(int) ConfigType.s] = DynamicBuild(ConfigType.s);
                 configAssemblies[(int) ConfigType.cs] = DynamicBuild(ConfigType.cs);
-
-                List<string> excels = FileHelper.GetAllFiles(excelDir, "*.xlsx");
                 
-                foreach (string path in excels)
+                foreach ((string s, string path) in paths)
                 {
-                    ExportExcel(path);
+                    ExportExcel(s, path);
                 }
                 
                 if (Directory.Exists(clientProtoDir))
@@ -224,10 +253,10 @@ namespace ET
             }
         }
 
-        private static void ExportExcel(string path)
+        private static void ExportExcel(string root, string path)
         {
             string dir = Path.GetDirectoryName(path);
-            string relativePath = Path.GetRelativePath(excelDir, dir);
+            string relativePath = Path.GetRelativePath(root, dir);
             string fileName = Path.GetFileName(path);
             if (!fileName.EndsWith(".xlsx") || fileName.StartsWith("~$") || fileName.Contains("#"))
             {

+ 47 - 8
Share/Tool/Proto2CS/Proto2CS.cs

@@ -22,10 +22,9 @@ namespace ET
 
     public static partial class InnerProto2CS
     {
-        private const string protoDir = "../Unity/Assets/Config/Proto";
-        private const string clientMessagePath = "../Unity/Assets/Scripts/Model/Generate/Client/Message/";
-        private const string serverMessagePath = "../Unity/Assets/Scripts/Model/Generate/Server/Message/";
-        private const string clientServerMessagePath = "../Unity/Assets/Scripts/Model/Generate/ClientServer/Message/";
+        private const string clientMessagePath = "../Generate/Client/Proto/";
+        private const string serverMessagePath = "../Generate/Server/Proto/";
+        private const string clientServerMessagePath = "../Generate/ClientServer/Proto/";
         private static readonly char[] splitChars = [' ', '\t'];
         private static readonly List<OpcodeInfo> msgOpcode = [];
 
@@ -33,12 +32,52 @@ namespace ET
         {
             msgOpcode.Clear();
 
+            if (!Directory.Exists(clientMessagePath))
+            {
+                Directory.CreateDirectory(clientMessagePath);
+            }
+            
+            if (!Directory.Exists(serverMessagePath))
+            {
+                Directory.CreateDirectory(serverMessagePath);
+            }
+            
+            if (!Directory.Exists(clientServerMessagePath))
+            {
+                Directory.CreateDirectory(clientServerMessagePath);
+            }
+
             RemoveAllFilesExceptMeta(clientMessagePath);
             RemoveAllFilesExceptMeta(serverMessagePath);
             RemoveAllFilesExceptMeta(clientServerMessagePath);
 
-            List<string> list = FileHelper.GetAllFiles(protoDir, "*proto");
+            List<string> list = new List<string>();
+            foreach (string directory in Directory.GetDirectories("../Unity/Packages", "com.et.*"))
+            {
+                string p = Path.Combine(directory, "Proto");
+                if (!Directory.Exists(p))
+                {
+                    continue;
+                }
+                list.Add(p);
+            }
+            foreach (string directory in Directory.GetDirectories("../Unity/Library/PackageCache", "com.et.*"))
+            {
+                string p = Path.Combine(directory, "Proto");
+                if (!Directory.Exists(p))
+                {
+                    continue;
+                }
+                list.Add(p);
+            }
+
+            List<string> protoList = new List<string>();
             foreach (string s in list)
+            {
+                protoList.AddRange(FileHelper.GetAllFiles(s, "*.proto"));
+            }
+            
+            foreach (string s in protoList)
             {
                 if (!s.EndsWith(".proto"))
                 {
@@ -50,7 +89,7 @@ namespace ET
                 string protoName = ss2[0];
                 string cs = ss2[1];
                 int startOpcode = int.Parse(ss2[2]);
-                ProtoFile2CS(fileName, protoName, cs, startOpcode);
+                ProtoFile2CS(s, fileName, protoName, cs, startOpcode);
             }
 
             RemoveUnusedMetaFiles(clientMessagePath);
@@ -58,11 +97,11 @@ namespace ET
             RemoveUnusedMetaFiles(clientServerMessagePath);
         }
 
-        private static void ProtoFile2CS(string fileName, string protoName, string cs, int startOpcode)
+        private static void ProtoFile2CS(string path, string fileName, string protoName, string cs, int startOpcode)
         {
             msgOpcode.Clear();
 
-            string proto = Path.Combine(protoDir, $"{fileName}.proto");
+            string proto = path;
             string s = File.ReadAllText(proto);
 
             StringBuilder sb = new();

BIN
Unity/Assets/Bundles/Config/AIConfigCategory.bytes


BIN
Unity/Assets/Bundles/Config/UnitConfigCategory.bytes


+ 8 - 0
Unity/Packages/com.et.core/Excel.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 49beed796aedfcb47bcc8d0f602b1b52
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Packages/com.et.core/Excel/StartConfig.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 84a42be1cb51ddc43a5fc8b9a3aa6c1e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Benchmark.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1ac7bf9ce8fc4ad46bd02dcb08165b1f
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartMachineConfig@s.xlsx


+ 2 - 2
Unity/Assets/Bundles/Config/AIConfigCategory.bytes.meta → Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartMachineConfig@s.xlsx.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 277d58db3067742a7b32f9994984b3bc
-TextScriptImporter:
+guid: 03fee2b7103050f478a689d2785db7e9
+DefaultImporter:
   externalObjects: {}
   userData: 
   assetBundleName: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartProcessConfig@s.xlsx


+ 2 - 2
Unity/Assets/Bundles/Config/UnitConfigCategory.bytes.meta → Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartProcessConfig@s.xlsx.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 3f452063ceb5f4150bbbfe795c0aca90
-TextScriptImporter:
+guid: bc469d982414eb143bcf5791b3822164
+DefaultImporter:
   externalObjects: {}
   userData: 
   assetBundleName: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartSceneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartSceneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: cdee8addbf3a11249b9b4fba7f31a153
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartZoneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Benchmark/StartZoneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: ed6f82bcc72d949458b8787862d71c29
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Localhost.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c216baca1410ef044bfe845483e6f6e4
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartMachineConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartMachineConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0c6a443736c53654c84bb430b78df758
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartProcessConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartProcessConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 631281e989abb6c4e80106b0502d46a8
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartSceneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartSceneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 96431e2b1becbd041acbca2842de9465
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartZoneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Localhost/StartZoneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: f5acaa5394763914297715289ae69489
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Release.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f35157653367b5340a880c68a61520c8
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartMachineConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartMachineConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: aa374e1d46aebcd42be062b678154682
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartProcessConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartProcessConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: f903631f3f41ca645923a79959806dfd
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartSceneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartSceneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 24efca463d6dc6544ba48a094f4dbcd2
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartZoneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/Release/StartZoneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: a1e51945b5befcd47adde1074bd312a1
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d60a51f0d6228c149872f36e6db2015e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartMachineConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartMachineConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 16cd92ca656d43543947a17e27d46057
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartProcessConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartProcessConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 219412ac221b8044cb7783ef1c46ab75
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartSceneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartSceneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 8fc4f69252da4c94d979a92a0b0c153f
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartZoneConfig@s.xlsx


+ 7 - 0
Unity/Packages/com.et.core/Excel/StartConfig/RouterTest/StartZoneConfig@s.xlsx.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c31b5b5deab839f48b5ec0f69fac286c
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Packages/com.et.core/Proto.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9a6f0d757530d5d4ba635f07eb155d77
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 21 - 0
Unity/Packages/com.et.core/Proto/ClientMessage_C_1000.proto

@@ -0,0 +1,21 @@
+syntax = "proto3";
+
+package ET;
+
+// ResponseType NetClient2Main_Login
+message Main2NetClient_Login // IRequest
+{
+	int32 RpcId = 1;
+	int32 OwnerFiberId = 2;
+	string Account = 3;		// 账号
+	string Password = 4; 	// 密码
+}
+
+message NetClient2Main_Login // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+
+	int64 PlayerId = 4;
+}

+ 7 - 0
Unity/Packages/com.et.core/Proto/ClientMessage_C_1000.proto.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 63a9a6fd819d4e14d8bee7a2e6e2fd20
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 177 - 0
Unity/Packages/com.et.core/Proto/InnerMessage_S_20001.proto

@@ -0,0 +1,177 @@
+syntax = "proto3";
+
+package ET;
+
+// ResponseType ObjectQueryResponse
+message ObjectQueryRequest // IRequest
+{
+	int32 RpcId = 1;
+	int64 Key = 2;
+	int64 InstanceId = 3;
+}
+
+// ResponseType A2M_Reload
+message M2A_Reload // IRequest
+{
+	int32 RpcId = 1;
+}
+
+message A2M_Reload // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType G2G_LockResponse
+message G2G_LockRequest // IRequest
+{
+	int32 RpcId = 1;
+	int64 Id = 2;
+	string Address = 3;
+}
+
+message G2G_LockResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType G2G_LockReleaseResponse
+message G2G_LockReleaseRequest // IRequest
+{
+	int32 RpcId = 1;
+	int64 Id = 2;
+	string Address = 3;
+}
+
+message G2G_LockReleaseResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType ObjectAddResponse
+message ObjectAddRequest // IRequest
+{
+	int32 RpcId = 1;
+	int32 Type = 2;
+	int64 Key = 3;
+	ActorId ActorId = 4;
+}
+
+message ObjectAddResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType ObjectLockResponse
+message ObjectLockRequest // IRequest
+{
+	int32 RpcId = 1;
+	int32 Type = 2;
+	int64 Key = 3;
+	ActorId ActorId = 4;
+	int32 Time = 5;
+}
+message ObjectLockResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType ObjectUnLockResponse
+message ObjectUnLockRequest // IRequest
+{
+	int32 RpcId = 1;
+	int32 Type = 2;
+	int64 Key = 3;
+	ActorId OldActorId = 4;
+	ActorId NewActorId = 5;
+}
+message ObjectUnLockResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType ObjectRemoveResponse
+message ObjectRemoveRequest // IRequest
+{
+	int32 RpcId = 1;
+	int32 Type = 2;
+	int64 Key = 3;
+}
+message ObjectRemoveResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType ObjectGetResponse
+message ObjectGetRequest // IRequest
+{
+	int32 RpcId = 1;
+	int32 Type = 2;
+	int64 Key = 3;
+}
+message ObjectGetResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	int32 Type = 4;
+	ActorId ActorId = 5;
+}
+
+// ResponseType G2R_GetLoginKey
+message R2G_GetLoginKey // IRequest
+{
+	int32 RpcId = 1;
+	string Account = 2;
+}
+
+message G2R_GetLoginKey // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	int64 Key = 4;
+	int64 GateId = 5;
+}
+
+message G2M_SessionDisconnect // ILocationMessage
+{
+	int32 RpcId = 1;
+}
+
+message ObjectQueryResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	bytes Entity = 4;
+}
+
+// ResponseType M2M_UnitTransferResponse
+message M2M_UnitTransferRequest // IRequest
+{
+	int32 RpcId = 1;
+	ActorId OldActorId = 2;
+	bytes Unit = 3;
+	repeated bytes Entitys = 4;
+}
+
+message M2M_UnitTransferResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}

+ 7 - 0
Unity/Packages/com.et.core/Proto/InnerMessage_S_20001.proto.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0223e72464e3a1741a8277bf2f1bde07
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 67 - 0
Unity/Packages/com.et.core/Proto/LockStepInner_S_21001.proto

@@ -0,0 +1,67 @@
+syntax = "proto3";
+package ET;
+
+/// 请求匹配
+// ResponseType Match2G_Match
+message G2Match_Match // IRequest
+{
+	int32 RpcId = 1;
+	
+	int64 Id = 2;
+}
+
+message Match2G_Match // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType Map2Match_GetRoom
+message Match2Map_GetRoom // IRequest
+{
+	int32 RpcId = 1;
+	repeated int64 PlayerIds = 2;
+}
+
+message Map2Match_GetRoom // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+
+	/// 房间的ActorId
+	ActorId ActorId = 4;
+}
+
+// ResponseType Room2G_Reconnect
+message G2Room_Reconnect // IRequest
+{
+	int32 RpcId = 1;
+	int64 PlayerId = 2;
+}
+
+message Room2G_Reconnect // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+
+	int64 StartTime = 4;
+	repeated LockStepUnitInfo UnitInfos = 5;
+	int32 Frame = 6;
+}
+
+// ResponseType Room2RoomManager_Init
+message RoomManager2Room_Init // IRequest
+{
+	int32 RpcId = 1;
+	repeated int64 PlayerIds = 2;
+}
+
+message Room2RoomManager_Init // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}

+ 7 - 0
Unity/Packages/com.et.core/Proto/LockStepInner_S_21001.proto.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 2adafb641a45a4d548b1cc826aca1d6f
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 81 - 0
Unity/Packages/com.et.core/Proto/LockStepOuter_C_11001.proto

@@ -0,0 +1,81 @@
+syntax = "proto3";
+package ET;
+
+// ResponseType G2C_Match
+message C2G_Match // ISessionRequest
+{
+	int32 RpcId = 1;
+}
+
+message G2C_Match // ISessionResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+/// 匹配成功,通知客户端切换场景
+message Match2G_NotifyMatchSuccess // IMessage
+{
+	int32 RpcId = 1;
+	/// 房间的ActorId
+	ActorId ActorId = 2;
+}
+
+/// 客户端通知房间切换场景完成
+message C2Room_ChangeSceneFinish // IRoomMessage
+{
+	int64 PlayerId = 1;
+}
+
+message LockStepUnitInfo
+{
+	int64 PlayerId = 1;
+	TrueSync.TSVector Position = 2;
+	TrueSync.TSQuaternion Rotation = 3;
+}
+
+/// 房间通知客户端进入战斗
+message Room2C_Start // IMessage
+{
+	int64 StartTime = 1;
+	repeated LockStepUnitInfo UnitInfo = 2;
+}
+
+message FrameMessage // IMessage
+{
+	int32 Frame = 1;
+	int64 PlayerId = 2;
+	LSInput Input = 3;
+}
+
+message OneFrameInputs // IMessage
+{
+	int32 Frame = 1;
+	map<int64, LSInput> Inputs = 2;
+}
+
+message Room2C_AdjustUpdateTime // IMessage
+{
+	int32 DiffTime = 1;
+}
+
+message C2Room_CheckHash // IRoomMessage
+{
+	int64 PlayerId = 1;
+	int32 Frame = 2;
+	int64 Hash = 3;
+}
+
+message Room2C_CheckHashFail // IMessage
+{
+	int32 Frame = 1;
+	bytes LSWorldBytes = 2;
+}
+
+message G2C_Reconnect // IMessage
+{
+	int64 StartTime = 1;
+	repeated LockStepUnitInfo UnitInfos = 2;
+	int32 Frame = 3;
+}

+ 7 - 0
Unity/Packages/com.et.core/Proto/LockStepOuter_C_11001.proto.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 32e6c63b0256f45a19583fba46f5cfab
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 235 - 0
Unity/Packages/com.et.core/Proto/OuterMessage_C_10001.proto

@@ -0,0 +1,235 @@
+syntax = "proto3";
+package ET;
+
+message HttpGetRouterResponse
+{
+	repeated string Realms = 1;
+	repeated string Routers = 2;
+}
+
+message RouterSync
+{
+	uint32 ConnectId = 1;
+	string Address = 2;
+}
+
+// ResponseType M2C_TestResponse
+message C2M_TestRequest // ILocationRequest
+{
+	int32 RpcId = 1;
+	string request = 2;
+}
+
+message M2C_TestResponse // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	string response = 4;
+}
+
+// ResponseType G2C_EnterMap
+message C2G_EnterMap // ISessionRequest
+{
+	int32 RpcId = 1;
+}
+
+message G2C_EnterMap // ISessionResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	/// 自己的UnitId
+	int64 MyId = 4;
+}
+
+message MoveInfo
+{
+	repeated Unity.Mathematics.float3 Points = 1;
+	Unity.Mathematics.quaternion Rotation = 2;
+	int32 TurnSpeed = 3;
+}
+
+message UnitInfo
+{
+	int64 UnitId = 1;
+	int32 ConfigId = 2;
+	int32 Type = 3;
+	Unity.Mathematics.float3 Position = 4;
+	Unity.Mathematics.float3 Forward = 5;
+	map<int32, int64> KV = 6;
+	MoveInfo MoveInfo = 7;
+}
+
+message M2C_CreateUnits // IMessage
+{
+	repeated UnitInfo Units = 1;
+}
+
+message M2C_CreateMyUnit // IMessage
+{
+	UnitInfo Unit = 1;
+}
+
+message M2C_StartSceneChange // IMessage
+{
+	int64 SceneInstanceId = 1;
+	string SceneName = 2;
+}
+
+message M2C_RemoveUnits // IMessage
+{
+	repeated int64 Units = 1;
+}
+
+message C2M_PathfindingResult // ILocationMessage
+{
+	int32 RpcId = 1;
+	Unity.Mathematics.float3 Position = 2;
+}
+
+message C2M_Stop // ILocationMessage
+{
+	int32 RpcId = 1;
+}
+
+message M2C_PathfindingResult // IMessage
+{
+	int64 Id = 1;
+	Unity.Mathematics.float3 Position = 2;
+	repeated Unity.Mathematics.float3 Points = 3;
+}
+
+message M2C_Stop // IMessage
+{
+	int32 Error = 1;
+	int64 Id = 2;
+	Unity.Mathematics.float3 Position = 3;
+	Unity.Mathematics.quaternion Rotation = 4;
+}
+
+// ResponseType G2C_Ping
+message C2G_Ping // ISessionRequest
+{
+	int32 RpcId = 1;
+}
+
+message G2C_Ping // ISessionResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	int64 Time = 4;
+}
+
+
+message G2C_Test // ISessionMessage
+{
+}
+
+// ResponseType M2C_Reload
+message C2M_Reload // ISessionRequest
+{
+	int32 RpcId = 1;
+	string Account = 2;
+	string Password = 3;
+}
+
+message M2C_Reload // ISessionResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType R2C_Login
+message C2R_Login // ISessionRequest
+{
+	int32 RpcId = 1;
+	string  Account = 2;  // 帐号
+	string  Password = 3;  // 密码
+}
+
+message R2C_Login // ISessionResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	string Address = 4;
+	int64 Key = 5;
+	int64 GateId = 6;
+}
+
+// ResponseType G2C_LoginGate
+message C2G_LoginGate // ISessionRequest
+{
+	int32 RpcId = 1;
+	int64 Key = 2;  // 帐号
+	int64 GateId = 3;
+}
+
+message G2C_LoginGate // ISessionResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	int64 PlayerId = 4;
+}
+
+message G2C_TestHotfixMessage // ISessionMessage
+{
+	string Info = 1;
+}
+
+// ResponseType M2C_TestRobotCase
+message C2M_TestRobotCase // ILocationRequest
+{
+	int32 RpcId = 1;
+	int32 N = 2;
+}
+
+message M2C_TestRobotCase // ILocationResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	int32 N = 4;
+}
+
+message C2M_TestRobotCase2 // ILocationMessage
+{
+	int32 RpcId = 1;
+	int32 N = 2;
+}
+
+message M2C_TestRobotCase2 // ILocationMessage
+{
+	int32 RpcId = 1;
+	int32 N = 2;
+}
+
+// ResponseType M2C_TransferMap
+message C2M_TransferMap // ILocationRequest
+{
+	int32 RpcId = 1;
+}
+
+message M2C_TransferMap // ILocationResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}
+
+// ResponseType G2C_Benchmark
+message C2G_Benchmark // ISessionRequest
+{
+	int32 RpcId = 1;
+}
+
+message G2C_Benchmark // ISessionResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+}

+ 7 - 0
Unity/Packages/com.et.core/Proto/OuterMessage_C_10001.proto.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 66bdeffad293b944c90bba52bb3e1853
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 33 - 0
Unity/Packages/com.et.core/Scripts/CodeMode~/ClientServer/StartProcessConfig.cs

@@ -0,0 +1,33 @@
+using System.Net;
+
+namespace ET
+{
+    public partial class StartProcessConfig
+    {
+        public string InnerIP => this.StartMachineConfig.InnerIP;
+
+        public string OuterIP => this.StartMachineConfig.OuterIP;
+        
+        // 内网地址外网端口,通过防火墙映射端口过来
+        private IPEndPoint ipEndPoint;
+
+        public IPEndPoint IPEndPoint
+        {
+            get
+            {
+                if (ipEndPoint == null)
+                {
+                    this.ipEndPoint = NetworkHelper.ToIPEndPoint(this.InnerIP, this.Port);
+                }
+
+                return this.ipEndPoint;
+            }
+        }
+
+        public StartMachineConfig StartMachineConfig => StartMachineConfigCategory.Instance.Get(this.MachineId);
+
+        public override void EndInit()
+        {
+        }
+    }
+}

+ 33 - 0
Unity/Packages/com.et.core/Scripts/CodeMode~/Server/StartProcessConfig.cs

@@ -0,0 +1,33 @@
+using System.Net;
+
+namespace ET
+{
+    public partial class StartProcessConfig
+    {
+        public string InnerIP => this.StartMachineConfig.InnerIP;
+
+        public string OuterIP => this.StartMachineConfig.OuterIP;
+        
+        // 内网地址外网端口,通过防火墙映射端口过来
+        private IPEndPoint ipEndPoint;
+
+        public IPEndPoint IPEndPoint
+        {
+            get
+            {
+                if (ipEndPoint == null)
+                {
+                    this.ipEndPoint = NetworkHelper.ToIPEndPoint(this.InnerIP, this.Port);
+                }
+
+                return this.ipEndPoint;
+            }
+        }
+
+        public StartMachineConfig StartMachineConfig => StartMachineConfigCategory.Instance.Get(this.MachineId);
+
+        public override void EndInit()
+        {
+        }
+    }
+}

+ 6 - 1
Unity/Packages/com.et.loader/Scripts/Editor/AssetPostProcessor/OnGenerateCSProjectProcessor.cs

@@ -1,4 +1,5 @@
-using System.IO;
+using System;
+using System.IO;
 using System.Text.RegularExpressions;
 using System.Xml;
 using UnityEditor;
@@ -30,6 +31,10 @@ namespace ET
 
             if (path.EndsWith("Unity.Model.csproj"))
             {
+                content = content.Replace("<Compile Include=\"Assets\\Scripts\\Model\\Empty.cs\" />", "<Compile Include=\"Assets\\Scripts\\Model\\Empty.cs\" />\n" +
+                    "<Compile Include=\"..\\Generate\\" + globalConfig.CodeMode + "\\**\\*.cs\"><Link>Generate\\%(RecursiveDir)%(FileName)%(Extension)</Link></Compile>");
+                content = content.Replace("<Compile Include=\"Assets\\Scripts\\Model\\Empty.cs\" />", "<Compile Include=\"Assets\\Scripts\\Model\\Empty.cs\" />\n" +
+                    "<Compile Include=\"Packages\\com.et.*\\Scripts\\CodeMode~\\" + globalConfig.CodeMode + "\\**\\*.cs\"><Link>CodeMode/$([System.String]::new(%(RecursiveDir)).Substring(7, $([System.String]::new(%(RecursiveDir)).Indexof(\"Scripts\"))).Replace(\"Scripts\", \"\"))/%(FileName)%(Extension)</Link></Compile>");
                 return AddCopyAfterBuild(GenerateCustomProject(content), "Model");
             }