Bläddra i källkod

excel转protobuf成功,加载protobuf配置成功!

tanghai 4 år sedan
förälder
incheckning
2891e697ae
78 ändrade filer med 430 tillägg och 1183 borttagningar
  1. 2 0
      Config/StartMachineConfigCategory.bytes
  2. 3 0
      Config/StartProcessConfigCategory.bytes
  3. BIN
      Config/StartSceneConfigCategory.bytes
  4. 3 0
      Config/StartZoneConfigCategory.bytes
  5. BIN
      Config/UnitConfigCategory.bytes
  6. 0 80
      Generate/Client/Code/Config/StartMachineConfig.cs
  7. 0 80
      Generate/Client/Code/Config/StartProcessConfig.cs
  8. 0 86
      Generate/Client/Code/Config/StartSceneConfig.cs
  9. 0 80
      Generate/Client/Code/Config/StartZoneConfig.cs
  10. 0 86
      Generate/Client/Code/Config/UnitConfig.cs
  11. 0 3
      Generate/Client/Json/StartMachineConfig.txt
  12. 0 4
      Generate/Client/Json/StartProcessConfig.txt
  13. 0 7
      Generate/Client/Json/StartSceneConfig.txt
  14. 0 4
      Generate/Client/Json/StartZoneConfig.txt
  15. 0 3
      Generate/Client/Json/UnitConfig.txt
  16. 0 80
      Generate/Server/Code/Config/StartMachineConfig.cs
  17. 0 80
      Generate/Server/Code/Config/StartProcessConfig.cs
  18. 0 86
      Generate/Server/Code/Config/StartSceneConfig.cs
  19. 0 80
      Generate/Server/Code/Config/StartZoneConfig.cs
  20. 0 86
      Generate/Server/Code/Config/UnitConfig.cs
  21. 0 3
      Generate/Server/Json/StartMachineConfig.txt
  22. 0 4
      Generate/Server/Json/StartProcessConfig.txt
  23. 0 7
      Generate/Server/Json/StartSceneConfig.txt
  24. 0 4
      Generate/Server/Json/StartZoneConfig.txt
  25. 0 3
      Generate/Server/Json/UnitConfig.txt
  26. 1 1
      Server/App/Server.App.csproj
  27. 2 2
      Server/Hotfix/AppStart_Init.cs
  28. 2 2
      Server/Hotfix/Helper/LoadConfigHelper.cs
  29. 1 1
      Server/Hotfix/Server.Hotfix.csproj
  30. 1 1
      Server/Model/ConfigPartial/StartProcessConfig.cs
  31. 2 2
      Server/Model/ConfigPartial/StartSceneConfig.cs
  32. 18 9
      Server/Model/Generate/Config/StartMachineConfig.cs
  33. 17 8
      Server/Model/Generate/Config/StartProcessConfig.cs
  34. 25 11
      Server/Model/Generate/Config/StartSceneConfig.cs
  35. 60 51
      Server/Model/Generate/Config/StartZoneConfig.cs
  36. 29 20
      Server/Model/Generate/Config/UnitConfig.cs
  37. 5 5
      Server/Model/Other/Options.cs
  38. 1 1
      Server/Model/Server.Model.csproj
  39. 1 1
      Server/ThirdParty/Server.ThirdParty.csproj
  40. 2 0
      Tools/Config/StartMachineConfigCategory.bytes
  41. 3 0
      Tools/Config/StartProcessConfigCategory.bytes
  42. BIN
      Tools/Config/StartSceneConfigCategory.bytes
  43. 3 0
      Tools/Config/StartZoneConfigCategory.bytes
  44. BIN
      Tools/Config/UnitConfigCategory.bytes
  45. 3 2
      Tools/ExcelExporter/ExcelExporter.csproj
  46. 27 7
      Tools/ExcelExporter/Program.cs
  47. 10 3
      Tools/ExcelExporter/Template.txt
  48. 2 2
      Tools/Proto2CS/Program.cs
  49. 4 3
      Tools/Proto2CS/Proto2CS.csproj
  50. 2 0
      Unity/Assets/Bundles/Config/StartMachineConfigCategory.bytes
  51. 7 0
      Unity/Assets/Bundles/Config/StartMachineConfigCategory.bytes.meta
  52. 3 0
      Unity/Assets/Bundles/Config/StartProcessConfigCategory.bytes
  53. 7 0
      Unity/Assets/Bundles/Config/StartProcessConfigCategory.bytes.meta
  54. BIN
      Unity/Assets/Bundles/Config/StartSceneConfigCategory.bytes
  55. 7 0
      Unity/Assets/Bundles/Config/StartSceneConfigCategory.bytes.meta
  56. 3 0
      Unity/Assets/Bundles/Config/StartZoneConfigCategory.bytes
  57. 7 0
      Unity/Assets/Bundles/Config/StartZoneConfigCategory.bytes.meta
  58. BIN
      Unity/Assets/Bundles/Config/UnitConfigCategory.bytes
  59. 7 0
      Unity/Assets/Bundles/Config/UnitConfigCategory.bytes.meta
  60. 1 35
      Unity/Assets/Hotfix/Module/Config/ConfigComponentSystem.cs
  61. 2 2
      Unity/Assets/HotfixView/AppStart_Init.cs
  62. 1 1
      Unity/Assets/HotfixView/Helper.meta
  63. 1 1
      Unity/Assets/HotfixView/Helper/LoadConfigHelper.cs
  64. 2 3
      Unity/Assets/HotfixView/Helper/LoadConfigHelper.cs.meta
  65. 0 10
      Unity/Assets/Model/Core/FunctionCallback.cs
  66. 0 6
      Unity/Assets/Model/Core/Object/Object.cs
  67. 17 9
      Unity/Assets/Model/Generate/Config/StartMachineConfig.cs
  68. 17 8
      Unity/Assets/Model/Generate/Config/StartProcessConfig.cs
  69. 25 11
      Unity/Assets/Model/Generate/Config/StartSceneConfig.cs
  70. 60 51
      Unity/Assets/Model/Generate/Config/StartZoneConfig.cs
  71. 29 20
      Unity/Assets/Model/Generate/Config/UnitConfig.cs
  72. 0 12
      Unity/Assets/Model/Module/Config/AConfigComponent.cs.meta
  73. 2 0
      Unity/Assets/Model/Module/Config/ConfigComponent.cs
  74. 0 12
      Unity/Assets/Model/Module/Config/ConfigHelper.cs.meta
  75. 1 1
      Unity/Assets/ThirdParty/protobuf-net/Meta/MetaType.cs
  76. 1 1
      Unity/Unity.Hotfix.csproj
  77. 1 1
      Unity/Unity.HotfixView.csproj
  78. 0 1
      Unity/Unity.Model.csproj

+ 2 - 0
Config/StartMachineConfigCategory.bytes

@@ -0,0 +1,2 @@
+
+
	127.0.0.1

+ 3 - 0
Config/StartProcessConfigCategory.bytes

@@ -0,0 +1,3 @@
+
+
+

BIN
Config/StartSceneConfigCategory.bytes


+ 3 - 0
Config/StartZoneConfigCategory.bytes

@@ -0,0 +1,3 @@
+
+mongdb://127.0.0.1
+mongdb://127.0.0.1

BIN
Config/UnitConfigCategory.bytes


+ 0 - 80
Generate/Client/Code/Config/StartMachineConfig.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartMachineConfigCategory : ProtoObject
-    {
-        public static StartMachineConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartMachineConfig> dict = new Dictionary<int, StartMachineConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartMachineConfig> list = new List<StartMachineConfig>();
-		
-        public StartMachineConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartMachineConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartMachineConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public string InnerIP { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string OuterIP { get; set; }
-
-	}
-}

+ 0 - 80
Generate/Client/Code/Config/StartProcessConfig.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartProcessConfigCategory : ProtoObject
-    {
-        public static StartProcessConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartProcessConfig> dict = new Dictionary<int, StartProcessConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartProcessConfig> list = new List<StartProcessConfig>();
-		
-        public StartProcessConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartProcessConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartProcessConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public int MachineId { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string InnerPort { get; set; }
-
-	}
-}

+ 0 - 86
Generate/Client/Code/Config/StartSceneConfig.cs

@@ -1,86 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartSceneConfigCategory : ProtoObject
-    {
-        public static StartSceneConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartSceneConfig> dict = new Dictionary<int, StartSceneConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartSceneConfig> list = new List<StartSceneConfig>();
-		
-        public StartSceneConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartSceneConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartSceneConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public int Process { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public int Zone { get; set; }
-		[ProtoMember(4, IsRequired  = true)]
-		public string SceneType { get; set; }
-		[ProtoMember(5, IsRequired  = true)]
-		public string Name { get; set; }
-		[ProtoMember(6, IsRequired  = true)]
-		public int OuterPort { get; set; }
-
-	}
-}

+ 0 - 80
Generate/Client/Code/Config/StartZoneConfig.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartZoneConfigCategory : ProtoObject
-    {
-        public static StartZoneConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartZoneConfig> dict = new Dictionary<int, StartZoneConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartZoneConfig> list = new List<StartZoneConfig>();
-		
-        public StartZoneConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartZoneConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartZoneConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public string DBConnection { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string DBName { get; set; }
-
-	}
-}

+ 0 - 86
Generate/Client/Code/Config/UnitConfig.cs

@@ -1,86 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class UnitConfigCategory : ProtoObject
-    {
-        public static UnitConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, UnitConfig> dict = new Dictionary<int, UnitConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<UnitConfig> list = new List<UnitConfig>();
-		
-        public UnitConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (UnitConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        public UnitConfig Get(int id)
-        {
-            this.dict.TryGetValue(id, out UnitConfig item);
-
-            if (item == null)
-            {
-                throw new Exception($"配置找不到,配置表名: {nameof (UnitConfig)},配置id: {id}");
-            }
-
-            return item;
-        }
-		
-        public bool Contain(int id)
-        {
-            return this.dict.ContainsKey(id);
-        }
-
-        public Dictionary<int, UnitConfig> GetAll()
-        {
-            return this.dict;
-        }
-
-        public UnitConfig GetOne()
-        {
-            if (this.dict == null || this.dict.Count <= 0)
-            {
-                return null;
-            }
-            return this.dict.Values.GetEnumerator().Current;
-        }
-    }
-
-    [ProtoContract]
-	public partial class UnitConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public string Name { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string Desc { get; set; }
-		[ProtoMember(4, IsRequired  = true)]
-		public int Position { get; set; }
-		[ProtoMember(5, IsRequired  = true)]
-		public int Height { get; set; }
-		[ProtoMember(6, IsRequired  = true)]
-		public int Weight { get; set; }
-
-	}
-}

+ 0 - 3
Generate/Client/Json/StartMachineConfig.txt

@@ -1,3 +0,0 @@
-{"list":[
-{"_id":1,"InnerIP":"127.0.0.1"},
-]}

+ 0 - 4
Generate/Client/Json/StartProcessConfig.txt

@@ -1,4 +0,0 @@
-{"list":[
-{"_id":1,"MachineId":1},
-{"_id":2,"MachineId":1},
-]}

+ 0 - 7
Generate/Client/Json/StartSceneConfig.txt

@@ -1,7 +0,0 @@
-{"list":[
-{"_id":1,"Process":1,"Zone":1,"SceneType":"Realm","Name":"Realm"},
-{"_id":2,"Process":1,"Zone":1,"SceneType":"Gate","Name":"Gate1"},
-{"_id":3,"Process":1,"Zone":1,"SceneType":"Gate","Name":"Gate2"},
-{"_id":4,"Process":1,"Zone":1,"SceneType":"Location","Name":"Location"},
-{"_id":5,"Process":1,"Zone":1,"SceneType":"Map","Name":"Map"},
-]}

+ 0 - 4
Generate/Client/Json/StartZoneConfig.txt

@@ -1,4 +0,0 @@
-{"list":[
-{"_id":1,"DBConnection":"mongdb://127.0.0.1"},
-{"_id":2,"DBConnection":"mongdb://127.0.0.1"},
-]}

+ 0 - 3
Generate/Client/Json/UnitConfig.txt

@@ -1,3 +0,0 @@
-{"list":[
-{"_id":1001,"Name":"米克尔","Desc":"带有强力攻击技能","Position":1,"Height":178},
-]}

+ 0 - 80
Generate/Server/Code/Config/StartMachineConfig.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartMachineConfigCategory : ProtoObject
-    {
-        public static StartMachineConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartMachineConfig> dict = new Dictionary<int, StartMachineConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartMachineConfig> list = new List<StartMachineConfig>();
-		
-        public StartMachineConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartMachineConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartMachineConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public string InnerIP { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string OuterIP { get; set; }
-
-	}
-}

+ 0 - 80
Generate/Server/Code/Config/StartProcessConfig.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartProcessConfigCategory : ProtoObject
-    {
-        public static StartProcessConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartProcessConfig> dict = new Dictionary<int, StartProcessConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartProcessConfig> list = new List<StartProcessConfig>();
-		
-        public StartProcessConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartProcessConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartProcessConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public int MachineId { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string InnerPort { get; set; }
-
-	}
-}

+ 0 - 86
Generate/Server/Code/Config/StartSceneConfig.cs

@@ -1,86 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartSceneConfigCategory : ProtoObject
-    {
-        public static StartSceneConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartSceneConfig> dict = new Dictionary<int, StartSceneConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartSceneConfig> list = new List<StartSceneConfig>();
-		
-        public StartSceneConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartSceneConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartSceneConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public int Process { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public int Zone { get; set; }
-		[ProtoMember(4, IsRequired  = true)]
-		public string SceneType { get; set; }
-		[ProtoMember(5, IsRequired  = true)]
-		public string Name { get; set; }
-		[ProtoMember(6, IsRequired  = true)]
-		public int OuterPort { get; set; }
-
-	}
-}

+ 0 - 80
Generate/Server/Code/Config/StartZoneConfig.cs

@@ -1,80 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class StartZoneConfigCategory : ProtoObject
-    {
-        public static StartZoneConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, StartZoneConfig> dict = new Dictionary<int, StartZoneConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<StartZoneConfig> list = new List<StartZoneConfig>();
-		
-        public StartZoneConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (StartZoneConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        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;
-        }
-    }
-
-    [ProtoContract]
-	public partial class StartZoneConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public string DBConnection { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string DBName { get; set; }
-
-	}
-}

+ 0 - 86
Generate/Server/Code/Config/UnitConfig.cs

@@ -1,86 +0,0 @@
-using System;
-using System.Collections.Generic;
-using MongoDB.Bson.Serialization.Attributes;
-using ProtoBuf;
-
-namespace ET
-{
-    [ProtoContract]
-    [Config]
-    public partial class UnitConfigCategory : ProtoObject
-    {
-        public static UnitConfigCategory Instance;
-		
-        [ProtoIgnore]
-        [BsonIgnore]
-        private Dictionary<int, UnitConfig> dict = new Dictionary<int, UnitConfig>();
-		
-        [BsonElement]
-        [ProtoMember(1)]
-        private List<UnitConfig> list = new List<UnitConfig>();
-		
-        public UnitConfigCategory()
-        {
-            Instance = this;
-        }
-		
-        public override void AfterDeserialization()
-        {
-            foreach (UnitConfig config in list)
-            {
-                this.dict.Add(config.Id, config);
-            }
-            list.Clear();
-            base.AfterDeserialization();
-        }
-		
-        public UnitConfig Get(int id)
-        {
-            this.dict.TryGetValue(id, out UnitConfig item);
-
-            if (item == null)
-            {
-                throw new Exception($"配置找不到,配置表名: {nameof (UnitConfig)},配置id: {id}");
-            }
-
-            return item;
-        }
-		
-        public bool Contain(int id)
-        {
-            return this.dict.ContainsKey(id);
-        }
-
-        public Dictionary<int, UnitConfig> GetAll()
-        {
-            return this.dict;
-        }
-
-        public UnitConfig GetOne()
-        {
-            if (this.dict == null || this.dict.Count <= 0)
-            {
-                return null;
-            }
-            return this.dict.Values.GetEnumerator().Current;
-        }
-    }
-
-    [ProtoContract]
-	public partial class UnitConfig: IConfig
-	{
-		[ProtoMember(1, IsRequired  = true)]
-		public int Id { get; set; }
-		[ProtoMember(2, IsRequired  = true)]
-		public string Name { get; set; }
-		[ProtoMember(3, IsRequired  = true)]
-		public string Desc { get; set; }
-		[ProtoMember(4, IsRequired  = true)]
-		public int Position { get; set; }
-		[ProtoMember(5, IsRequired  = true)]
-		public int Height { get; set; }
-		[ProtoMember(6, IsRequired  = true)]
-		public int Weight { get; set; }
-
-	}
-}

+ 0 - 3
Generate/Server/Json/StartMachineConfig.txt

@@ -1,3 +0,0 @@
-{"list":[
-{"_id":1,"InnerIP":"127.0.0.1"},
-]}

+ 0 - 4
Generate/Server/Json/StartProcessConfig.txt

@@ -1,4 +0,0 @@
-{"list":[
-{"_id":1,"MachineId":1},
-{"_id":2,"MachineId":1},
-]}

+ 0 - 7
Generate/Server/Json/StartSceneConfig.txt

@@ -1,7 +0,0 @@
-{"list":[
-{"_id":1,"Process":1,"Zone":1,"SceneType":"Realm","Name":"Realm"},
-{"_id":2,"Process":1,"Zone":1,"SceneType":"Gate","Name":"Gate1"},
-{"_id":3,"Process":1,"Zone":1,"SceneType":"Gate","Name":"Gate2"},
-{"_id":4,"Process":1,"Zone":1,"SceneType":"Location","Name":"Location"},
-{"_id":5,"Process":1,"Zone":1,"SceneType":"Map","Name":"Map"},
-]}

+ 0 - 4
Generate/Server/Json/StartZoneConfig.txt

@@ -1,4 +0,0 @@
-{"list":[
-{"_id":1,"DBConnection":"mongdb://127.0.0.1"},
-{"_id":2,"DBConnection":"mongdb://127.0.0.1"},
-]}

+ 0 - 3
Generate/Server/Json/UnitConfig.txt

@@ -1,3 +0,0 @@
-{"list":[
-{"_id":1001,"Name":"米克尔","Desc":"带有强力攻击技能","Position":1,"Height":178},
-]}

+ 1 - 1
Server/App/Server.App.csproj

@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <OutputType>Exe</OutputType>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <TargetFramework>net5.0</TargetFramework>
     <RootNamespace>ET</RootNamespace>
     <LangVersion>7.3</LangVersion>
   </PropertyGroup>

+ 2 - 2
Server/Hotfix/AppStart_Init.cs

@@ -8,9 +8,9 @@ namespace ET
     {
         public override async ETTask Run(EventType.AppStart args)
         {
-            FunctionCallback.GetAllConfigBytes = LoadConfigHelper.LoadAllConfigBytes;
-            
             Game.Scene.AddComponent<ConfigComponent>();
+            
+            ConfigComponent.GetAllConfigBytes = LoadConfigHelper.LoadAllConfigBytes;
             await ConfigComponent.Instance.LoadAsync();
 
             StartProcessConfig processConfig = StartProcessConfigCategory.Instance.Get(Game.Options.Process);

+ 2 - 2
Server/Hotfix/Helper/LoadConfigHelper.cs

@@ -7,9 +7,9 @@ namespace ET
     {
         public static void LoadAllConfigBytes(Dictionary<string, byte[]> output)
         {
-            foreach (string file in Directory.GetFiles($"../Generate/Server/Proto", "*.bytes"))
+            foreach (string file in Directory.GetFiles($"../Config", "*.bytes"))
             {
-                string key = $"{Path.GetFileName(file)}.bytes";
+                string key = Path.GetFileNameWithoutExtension(file);
                 output[key] = File.ReadAllBytes(file);
             }
         }

+ 1 - 1
Server/Hotfix/Server.Hotfix.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <TargetFramework>net5.0</TargetFramework>
     <RootNamespace>ET</RootNamespace>
     <LangVersion>7.3</LangVersion>
   </PropertyGroup>

+ 1 - 1
Server/Model/ConfigPartial/StartProcessConfig.cs

@@ -27,7 +27,7 @@ namespace ET
 
         public StartMachineConfig StartMachineConfig => StartMachineConfigCategory.Instance.Get(this.MachineId);
 
-        public void EndInit()
+        public override void EndInit()
         {
             InstanceIdStruct instanceIdStruct = new InstanceIdStruct((int)this.Id, 0);
             this.SceneId = instanceIdStruct.ToLong();

+ 2 - 2
Server/Model/ConfigPartial/StartSceneConfig.cs

@@ -103,11 +103,11 @@ namespace ET
             }
         }
 
-        public void BeginInit()
+        public override void BeginInit()
         {
         }
 
-        public void EndInit()
+        public override void EndInit()
         {
             this.Type = EnumHelper.FromString<SceneType>(this.SceneType);
             InstanceIdStruct instanceIdStruct = new InstanceIdStruct(this.Process, (uint) this.Id);

+ 18 - 9
Server/Model/Generate/Config/StartMachineConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class StartMachineConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (StartMachineConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public StartMachineConfig Get(int id)
@@ -62,17 +63,25 @@ namespace ET
             {
                 return null;
             }
-            return this.dict.Values.First();
+            return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-	public partial class StartMachineConfig: IConfig
+    [ProtoContract]
+	public partial class StartMachineConfig: ProtoObject, IConfig
 	{
-        [ProtoMember(1, IsRequired  = true)]
+		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
-        [ProtoMember(2, IsRequired  = true)]
-        public string InnerIP { get; set; }
-        [ProtoMember(3, IsRequired  = true)]
+		[ProtoMember(2, IsRequired  = true)]
+		public string InnerIP { get; set; }
+		[ProtoMember(3, IsRequired  = true)]
 		public string OuterIP { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 17 - 8
Server/Model/Generate/Config/StartProcessConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class StartProcessConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (StartProcessConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public StartProcessConfig Get(int id)
@@ -62,17 +63,25 @@ namespace ET
             {
                 return null;
             }
-            return this.dict.Values.First();
+            return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-	public partial class StartProcessConfig: IConfig
+    [ProtoContract]
+	public partial class StartProcessConfig: ProtoObject, IConfig
 	{
-        [ProtoMember(1, IsRequired  = true)]
+		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
-        [ProtoMember(2, IsRequired  = true)]
+		[ProtoMember(2, IsRequired  = true)]
 		public int MachineId { get; set; }
-        [ProtoMember(3, IsRequired  = true)]
+		[ProtoMember(3, IsRequired  = true)]
 		public string InnerPort { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 25 - 11
Server/Model/Generate/Config/StartSceneConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class StartSceneConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (StartSceneConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public StartSceneConfig Get(int id)
@@ -62,18 +63,31 @@ namespace ET
             {
                 return null;
             }
-            return this.dict.Values.First();
+            return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-	public partial class StartSceneConfig: IConfig
+    [ProtoContract]
+	public partial class StartSceneConfig: ProtoObject, IConfig
 	{
-		[BsonId]
+		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
-		public int Process;
-		public int Zone;
-		public string SceneType;
-		public string Name;
-		public int OuterPort;
+		[ProtoMember(2, IsRequired  = true)]
+		public int Process { get; set; }
+		[ProtoMember(3, IsRequired  = true)]
+		public int Zone { get; set; }
+		[ProtoMember(4, IsRequired  = true)]
+		public string SceneType { get; set; }
+		[ProtoMember(5, IsRequired  = true)]
+		public string Name { get; set; }
+		[ProtoMember(6, IsRequired  = true)]
+		public int OuterPort { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 60 - 51
Server/Model/Generate/Config/StartZoneConfig.cs

@@ -1,72 +1,74 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
-	[Config]
-	public partial class StartZoneConfigCategory : ProtoObject
-	{
-		public static StartZoneConfigCategory Instance;
+    [ProtoContract]
+    [Config]
+    public partial class StartZoneConfigCategory : ProtoObject
+    {
+        public static StartZoneConfigCategory Instance;
 		
-		[ProtoIgnore]
-		[BsonIgnore]
-		private Dictionary<int, StartZoneConfig> dict = new Dictionary<int, StartZoneConfig>();
+        [ProtoIgnore]
+        [BsonIgnore]
+        private Dictionary<int, StartZoneConfig> dict = new Dictionary<int, StartZoneConfig>();
 		
-		[BsonElement]
-		[ProtoMember(1)]
-		private List<StartZoneConfig> list = new List<StartZoneConfig>();
+        [BsonElement]
+        [ProtoMember(1)]
+        private List<StartZoneConfig> list = new List<StartZoneConfig>();
 		
-		public StartZoneConfigCategory()
-		{
-			Instance = this;
-		}
+        public StartZoneConfigCategory()
+        {
+            Instance = this;
+        }
 		
-		public override void AfterDeserialization()
-		{
-			foreach (StartZoneConfig config in list)
-			{
-				this.dict.Add(config.Id, config);
-			}
-			list.Clear();
-			base.AfterDeserialization();
-		}
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            foreach (StartZoneConfig config in list)
+            {
+                this.dict.Add(config.Id, config);
+            }
+            list.Clear();
+            this.EndInit();
+        }
 		
-		public StartZoneConfig Get(int id)
-		{
-			this.dict.TryGetValue(id, out StartZoneConfig item);
+        public StartZoneConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartZoneConfig item);
 
-			if (item == null)
-			{
-				throw new Exception($"配置找不到,配置表名: {nameof (StartZoneConfig)},配置id: {id}");
-			}
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartZoneConfig)},配置id: {id}");
+            }
 
-			return item;
-		}
+            return item;
+        }
 		
-		public bool Contain(int id)
-		{
-			return this.dict.ContainsKey(id);
-		}
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
 
-		public Dictionary<int, StartZoneConfig> GetAll()
-		{
-			return this.dict;
-		}
+        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.First();
-		}
-	}
+        public StartZoneConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
 
-	public partial class StartZoneConfig: IConfig
+    [ProtoContract]
+	public partial class StartZoneConfig: ProtoObject, IConfig
 	{
 		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
@@ -74,5 +76,12 @@ namespace ET
 		public string DBConnection { get; set; }
 		[ProtoMember(3, IsRequired  = true)]
 		public string DBName { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 29 - 20
Server/Model/Generate/Config/UnitConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class UnitConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (UnitConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public UnitConfig Get(int id)
@@ -62,23 +63,31 @@ namespace ET
             {
                 return null;
             }
-            return this.dict.Values.First();
+            return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-    public partial class UnitConfig: IConfig
-    {
-        [ProtoMember(1, IsRequired  = true)]
-        public int Id { get; set; }
-        [ProtoMember(2, IsRequired  = true)]
-        public string Name { get; set; }
-        [ProtoMember(3, IsRequired  = true)]
-        public string Desc { get; set; }
-        [ProtoMember(4, IsRequired  = true)]
-        public int Position { get; set; }
-        [ProtoMember(5, IsRequired  = true)]
-        public int Height { get; set; }
-        [ProtoMember(6, IsRequired  = true)]
-        public int Weight { get; set; }
-    }
-}
+    [ProtoContract]
+	public partial class UnitConfig: ProtoObject, IConfig
+	{
+		[ProtoMember(1, IsRequired  = true)]
+		public int Id { get; set; }
+		[ProtoMember(2, IsRequired  = true)]
+		public string Name { get; set; }
+		[ProtoMember(3, IsRequired  = true)]
+		public string Desc { get; set; }
+		[ProtoMember(4, IsRequired  = true)]
+		public int Position { get; set; }
+		[ProtoMember(5, IsRequired  = true)]
+		public int Height { get; set; }
+		[ProtoMember(6, IsRequired  = true)]
+		public int Weight { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
+	}
+}

+ 5 - 5
Server/Model/Other/Options.cs

@@ -10,11 +10,11 @@ namespace ET
     
     public class Options
     {
-        [Option("StartConfig", Required = true)]
-        public string StartConfig { get; set; }
-
-        [Option("ServerType", Required = false, Default = ServerType.Game, HelpText = "serverType enum")]
-        public ServerType ServerType { get; set; }
+        //[Option("StartConfig", Required = true)]
+        //public string StartConfig { get; set; }
+//
+        //[Option("ServerType", Required = false, Default = ServerType.Game, HelpText = "serverType enum")]
+        //public ServerType ServerType { get; set; }
 
         [Option("Develop", Required = false, Default = 0, HelpText = "develop mode")]
         public int Develop { get; set; }

+ 1 - 1
Server/Model/Server.Model.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <TargetFramework>net5.0</TargetFramework>
     <RootNamespace>ET</RootNamespace>
     <LangVersion>7.3</LangVersion>
   </PropertyGroup>

+ 1 - 1
Server/ThirdParty/Server.ThirdParty.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
     <PropertyGroup>
-        <TargetFramework>netcoreapp3.1</TargetFramework>
+        <TargetFramework>net5.0</TargetFramework>
         <RootNamespace>ET</RootNamespace>
     </PropertyGroup>
 

+ 2 - 0
Tools/Config/StartMachineConfigCategory.bytes

@@ -0,0 +1,2 @@
+
+
	127.0.0.1

+ 3 - 0
Tools/Config/StartProcessConfigCategory.bytes

@@ -0,0 +1,3 @@
+
+
+

BIN
Tools/Config/StartSceneConfigCategory.bytes


+ 3 - 0
Tools/Config/StartZoneConfigCategory.bytes

@@ -0,0 +1,3 @@
+
+mongdb://127.0.0.1
+mongdb://127.0.0.1

BIN
Tools/Config/UnitConfigCategory.bytes


+ 3 - 2
Tools/ExcelExporter/ExcelExporter.csproj

@@ -2,6 +2,7 @@
 
     <PropertyGroup>
         <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+        <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
         <RootNamespace>ET</RootNamespace>
     </PropertyGroup>
     
@@ -11,11 +12,11 @@
     </PropertyGroup>
     
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <OutputPath>../../ToolsApp/ExcelExporter/</OutputPath>
+      <OutputPath>./Bin</OutputPath>
     </PropertyGroup>
     
     <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-      <OutputPath>../../ToolsApp/ExcelExporter/</OutputPath>
+      <OutputPath>./Bin</OutputPath>
     </PropertyGroup>
     
     <ItemGroup>

+ 27 - 7
Tools/ExcelExporter/Program.cs

@@ -41,13 +41,33 @@ namespace ET
     {
         private static string template;
 
-        private const string excelDir = "../../Excel";
+        private const string clientClassDir = "../../../Unity/Assets/Model/Generate/Config";
+        private const string serverClassDir = "../../../Server/Model/Generate/Config";
         
-        private const string classDir = "../../Generate/{0}/Code/Config";
+        private const string excelDir = "../../../Excel";
         
-        private const string jsonDir = "../../Generate/{0}/Json";
+        private const string jsonDir = "./{0}/Json";
         
-        private const string protoDir = "../../Generate/{0}/Proto";
+        private const string clientProtoDir = "../../../Unity/Assets/Bundles/Config";
+        private const string serverProtoDir = "../../../Config";
+
+        private static string GetProtoDir(ConfigType configType)
+        {
+            if (configType == ConfigType.Client)
+            {
+                return clientProtoDir;
+            }
+            return serverProtoDir;
+        }
+        
+        private static string GetClassDir(ConfigType configType)
+        {
+            if (configType == ConfigType.Client)
+            {
+                return clientClassDir;
+            }
+            return serverClassDir;
+        }
         
         static void Main(string[] args)
         {
@@ -115,7 +135,7 @@ namespace ET
 
         static void ExportClass(string protoName, List<HeadInfo> classField, ConfigType configType)
         {
-            string dir = string.Format(classDir, configType.ToString());
+            string dir = GetClassDir(configType);
             if (!Directory.Exists(dir))
             {
                 Directory.CreateDirectory(dir);
@@ -245,7 +265,7 @@ namespace ET
         // 根据生成的类,动态编译把json转成protobuf
         private static void ExportExcelProtobuf(ConfigType configType)
         {
-            string classPath = string.Format(classDir, configType);
+            string classPath = GetClassDir(configType);
             List<SyntaxTree> syntaxTrees = new List<SyntaxTree>();
             List<string> protoNames = new List<string>();
             foreach (string classFile in Directory.GetFiles(classPath, "*.cs"))
@@ -293,7 +313,7 @@ namespace ET
 
             Assembly ass = Assembly.Load(memSteam.ToArray());
 
-            string dir = string.Format(protoDir, configType.ToString());
+            string dir = GetProtoDir(configType);
             if (!Directory.Exists(dir))
             {
                 Directory.CreateDirectory(dir);

+ 10 - 3
Tools/ExcelExporter/Template.txt

@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach ((ConfigName) config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public (ConfigName) Get(int id)
@@ -67,8 +68,14 @@ namespace ET
     }
 
     [ProtoContract]
-	public partial class (ConfigName): IConfig
+	public partial class (ConfigName): ProtoObject, IConfig
 	{
 (Fields)
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 2 - 2
Tools/Proto2CS/Program.cs

@@ -25,8 +25,8 @@ namespace ET
     public static class InnerProto2CS
     {
         private const string protoPath = ".";
-        private const string clientMessagePath = "../Unity/Assets/Model/Module/Message/";
-        private const string serverMessagePath = "../Server/Model/Module/Message/";
+        private const string clientMessagePath = "../../Unity/Assets/Model/Module/Message/";
+        private const string serverMessagePath = "../../Server/Model/Module/Message/";
         private static readonly char[] splitChars = { ' ', '\t' };
         private static readonly List<OpcodeInfo> msgOpcode = new List<OpcodeInfo>();
 

+ 4 - 3
Tools/Proto2CS/Proto2CS.csproj

@@ -3,19 +3,20 @@
     <PropertyGroup>
         <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
         <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
+        <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
     </PropertyGroup>
 
     <PropertyGroup>
         <OutputType>Exe</OutputType>
-        <TargetFramework>netcoreapp3.1</TargetFramework>
+        <TargetFramework>net5.0</TargetFramework>
     </PropertyGroup>
 
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <OutputPath>../../ToolsApp/Proto2CS/</OutputPath>
+      <OutputPath>./Bin</OutputPath>
     </PropertyGroup>
 
     <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
-      <OutputPath>../../ToolsApp/Proto2CS/</OutputPath>
+      <OutputPath>./Bin</OutputPath>
     </PropertyGroup>
 
     <ItemGroup>

+ 2 - 0
Unity/Assets/Bundles/Config/StartMachineConfigCategory.bytes

@@ -0,0 +1,2 @@
+
+
	127.0.0.1

+ 7 - 0
Unity/Assets/Bundles/Config/StartMachineConfigCategory.bytes.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 40aebe92b34144ab187964caf41b2104
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 0
Unity/Assets/Bundles/Config/StartProcessConfigCategory.bytes

@@ -0,0 +1,3 @@
+
+
+

+ 7 - 0
Unity/Assets/Bundles/Config/StartProcessConfigCategory.bytes.meta

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

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


+ 7 - 0
Unity/Assets/Bundles/Config/StartSceneConfigCategory.bytes.meta

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

+ 3 - 0
Unity/Assets/Bundles/Config/StartZoneConfigCategory.bytes

@@ -0,0 +1,3 @@
+
+mongdb://127.0.0.1
+mongdb://127.0.0.1

+ 7 - 0
Unity/Assets/Bundles/Config/StartZoneConfigCategory.bytes.meta

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

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


+ 7 - 0
Unity/Assets/Bundles/Config/UnitConfigCategory.bytes.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 3f452063ceb5f4150bbbfe795c0aca90
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 35
Unity/Assets/Hotfix/Module/Config/ConfigComponentSystem.cs

@@ -9,15 +9,6 @@ namespace ET
         public override void Awake(ConfigComponent self)
         {
 	        ConfigComponent.Instance = self;
-            self.Awake();
-        }
-    }
-
-    public class ConfigLoadSystem : LoadSystem<ConfigComponent>
-    {
-        public override void Load(ConfigComponent self)
-        {
-            self.Load();
         }
     }
     
@@ -31,38 +22,13 @@ namespace ET
     
     public static class ConfigComponentSystem
 	{
-		public static void Awake(this ConfigComponent self)
-		{
-			self.Load();
-		}
-
-		public static void Load(this ConfigComponent self)
-		{
-			self.AllConfig.Clear();
-			HashSet<Type> types = Game.EventSystem.GetTypes(typeof (ConfigAttribute));
-			
-			Dictionary<string, byte[]> configBytes = new Dictionary<string, byte[]>();
-			FunctionCallback.GetAllConfigBytes(configBytes);
-
-			List<Task> listTasks = new List<Task>();
-
-			foreach (Type type in types)
-			{
-				Task task = Task.Run(() => self.LoadOneInThread(type, configBytes));
-				listTasks.Add(task);
-			}
-
-			Task.WaitAll(listTasks.ToArray());
-		}
-		
-		
 		public static async ETTask LoadAsync(this ConfigComponent self)
 		{
 			self.AllConfig.Clear();
 			HashSet<Type> types = Game.EventSystem.GetTypes(typeof (ConfigAttribute));
 			
 			Dictionary<string, byte[]> configBytes = new Dictionary<string, byte[]>();
-			FunctionCallback.GetAllConfigBytes(configBytes);
+			ConfigComponent.GetAllConfigBytes(configBytes);
 
 			List<Task> listTasks = new List<Task>();
 

+ 2 - 2
Unity/Assets/HotfixView/AppStart_Init.cs

@@ -4,8 +4,6 @@ namespace ET
     {
         public override async ETTask Run(EventType.AppStart args)
         {
-            FunctionCallback.GetAllConfigBytes = LoadConfigHelper.LoadAllConfigBytes;
-            
             Game.Scene.AddComponent<TimerComponent>();
 
 
@@ -18,6 +16,8 @@ namespace ET
             ResourcesComponent.Instance.LoadBundle("config.unity3d");
             Game.Scene.AddComponent<ConfigComponent>();
             ResourcesComponent.Instance.UnloadBundle("config.unity3d");
+            
+            ConfigComponent.GetAllConfigBytes = LoadConfigHelper.LoadAllConfigBytes;
             await ConfigComponent.Instance.LoadAsync();
             
             Game.Scene.AddComponent<OpcodeTypeComponent>();

+ 1 - 1
Unity/Assets/Model/Config.meta → Unity/Assets/HotfixView/Helper.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: faf114decbd104e05a7c0f016c0543bc
+guid: 913c09549beec414789ff607d25ed736
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

+ 1 - 1
Unity/Assets/HotfixView/Helper/LoadConfigHelper.cs

@@ -13,7 +13,7 @@ namespace ET
             foreach (var kv in keys)
             {
                 TextAsset v = kv.Value as TextAsset;
-                string key = $"{kv.Key}.bytes";
+                string key = kv.Key;
                 output[key] = v.bytes;
             }
         }

+ 2 - 3
Unity/Assets/Model/Module/Config/ACategory.cs.meta → Unity/Assets/HotfixView/Helper/LoadConfigHelper.cs.meta

@@ -1,8 +1,7 @@
 fileFormatVersion: 2
-guid: 2f769b2838d3a384e88c8b0627564a46
-timeCreated: 1474947006
-licenseType: Pro
+guid: f56c40256a22744419cdc0c3051219cf
 MonoImporter:
+  externalObjects: {}
   serializedVersion: 2
   defaultReferences: []
   executionOrder: 0

+ 0 - 10
Unity/Assets/Model/Core/FunctionCallback.cs

@@ -1,10 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace ET
-{
-    public static class FunctionCallback
-    {
-        public static Action<Dictionary<string, byte[]>> GetAllConfigBytes;
-    }
-}

+ 0 - 6
Unity/Assets/Model/Core/Object/Object.cs

@@ -39,12 +39,6 @@ namespace ET
         public virtual void BeginInit()
         {
         }
-
-        [ProtoAfterDeserialization]
-        public virtual void AfterDeserialization()
-        {
-            this.EndInit();
-        }
         
         public virtual void EndInit()
         {

+ 17 - 9
Unity/Assets/Model/Generate/Config/StartMachineConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class StartMachineConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (StartMachineConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public StartMachineConfig Get(int id)
@@ -62,18 +63,25 @@ namespace ET
             {
                 return null;
             }
-
             return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-	public partial class StartMachineConfig: IConfig
+    [ProtoContract]
+	public partial class StartMachineConfig: ProtoObject, IConfig
 	{
-        [ProtoMember(1, IsRequired  = true)]
+		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
-        [ProtoMember(2, IsRequired  = true)]
-        public string InnerIP { get; set; }
-        [ProtoMember(3, IsRequired  = true)]
+		[ProtoMember(2, IsRequired  = true)]
+		public string InnerIP { get; set; }
+		[ProtoMember(3, IsRequired  = true)]
 		public string OuterIP { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 17 - 8
Unity/Assets/Model/Generate/Config/StartProcessConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class StartProcessConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (StartProcessConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public StartProcessConfig Get(int id)
@@ -62,17 +63,25 @@ namespace ET
             {
                 return null;
             }
-            return this.dict.Values.First();
+            return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-	public partial class StartProcessConfig: IConfig
+    [ProtoContract]
+	public partial class StartProcessConfig: ProtoObject, IConfig
 	{
-        [ProtoMember(1, IsRequired  = true)]
+		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
-        [ProtoMember(2, IsRequired  = true)]
+		[ProtoMember(2, IsRequired  = true)]
 		public int MachineId { get; set; }
-        [ProtoMember(3, IsRequired  = true)]
+		[ProtoMember(3, IsRequired  = true)]
 		public string InnerPort { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 25 - 11
Unity/Assets/Model/Generate/Config/StartSceneConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class StartSceneConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (StartSceneConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public StartSceneConfig Get(int id)
@@ -62,18 +63,31 @@ namespace ET
             {
                 return null;
             }
-            return this.dict.Values.First();
+            return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-	public partial class StartSceneConfig: IConfig
+    [ProtoContract]
+	public partial class StartSceneConfig: ProtoObject, IConfig
 	{
-		[BsonId]
+		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
-		public int Process;
-		public int Zone;
-		public string SceneType;
-		public string Name;
-		public int OuterPort;
+		[ProtoMember(2, IsRequired  = true)]
+		public int Process { get; set; }
+		[ProtoMember(3, IsRequired  = true)]
+		public int Zone { get; set; }
+		[ProtoMember(4, IsRequired  = true)]
+		public string SceneType { get; set; }
+		[ProtoMember(5, IsRequired  = true)]
+		public string Name { get; set; }
+		[ProtoMember(6, IsRequired  = true)]
+		public int OuterPort { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 60 - 51
Unity/Assets/Model/Generate/Config/StartZoneConfig.cs

@@ -1,72 +1,74 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
-	[Config]
-	public partial class StartZoneConfigCategory : ProtoObject
-	{
-		public static StartZoneConfigCategory Instance;
+    [ProtoContract]
+    [Config]
+    public partial class StartZoneConfigCategory : ProtoObject
+    {
+        public static StartZoneConfigCategory Instance;
 		
-		[ProtoIgnore]
-		[BsonIgnore]
-		private Dictionary<int, StartZoneConfig> dict = new Dictionary<int, StartZoneConfig>();
+        [ProtoIgnore]
+        [BsonIgnore]
+        private Dictionary<int, StartZoneConfig> dict = new Dictionary<int, StartZoneConfig>();
 		
-		[BsonElement]
-		[ProtoMember(1)]
-		private List<StartZoneConfig> list = new List<StartZoneConfig>();
+        [BsonElement]
+        [ProtoMember(1)]
+        private List<StartZoneConfig> list = new List<StartZoneConfig>();
 		
-		public StartZoneConfigCategory()
-		{
-			Instance = this;
-		}
+        public StartZoneConfigCategory()
+        {
+            Instance = this;
+        }
 		
-		public override void AfterDeserialization()
-		{
-			foreach (StartZoneConfig config in list)
-			{
-				this.dict.Add(config.Id, config);
-			}
-			list.Clear();
-			base.AfterDeserialization();
-		}
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            foreach (StartZoneConfig config in list)
+            {
+                this.dict.Add(config.Id, config);
+            }
+            list.Clear();
+            this.EndInit();
+        }
 		
-		public StartZoneConfig Get(int id)
-		{
-			this.dict.TryGetValue(id, out StartZoneConfig item);
+        public StartZoneConfig Get(int id)
+        {
+            this.dict.TryGetValue(id, out StartZoneConfig item);
 
-			if (item == null)
-			{
-				throw new Exception($"配置找不到,配置表名: {nameof (StartZoneConfig)},配置id: {id}");
-			}
+            if (item == null)
+            {
+                throw new Exception($"配置找不到,配置表名: {nameof (StartZoneConfig)},配置id: {id}");
+            }
 
-			return item;
-		}
+            return item;
+        }
 		
-		public bool Contain(int id)
-		{
-			return this.dict.ContainsKey(id);
-		}
+        public bool Contain(int id)
+        {
+            return this.dict.ContainsKey(id);
+        }
 
-		public Dictionary<int, StartZoneConfig> GetAll()
-		{
-			return this.dict;
-		}
+        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.First();
-		}
-	}
+        public StartZoneConfig GetOne()
+        {
+            if (this.dict == null || this.dict.Count <= 0)
+            {
+                return null;
+            }
+            return this.dict.Values.GetEnumerator().Current;
+        }
+    }
 
-	public partial class StartZoneConfig: IConfig
+    [ProtoContract]
+	public partial class StartZoneConfig: ProtoObject, IConfig
 	{
 		[ProtoMember(1, IsRequired  = true)]
 		public int Id { get; set; }
@@ -74,5 +76,12 @@ namespace ET
 		public string DBConnection { get; set; }
 		[ProtoMember(3, IsRequired  = true)]
 		public string DBName { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
 	}
 }

+ 29 - 20
Unity/Assets/Model/Generate/Config/UnitConfig.cs

@@ -1,11 +1,11 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MongoDB.Bson.Serialization.Attributes;
 using ProtoBuf;
 
 namespace ET
 {
+    [ProtoContract]
     [Config]
     public partial class UnitConfigCategory : ProtoObject
     {
@@ -24,14 +24,15 @@ namespace ET
             Instance = this;
         }
 		
-        public override void AfterDeserialization()
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
         {
             foreach (UnitConfig config in list)
             {
                 this.dict.Add(config.Id, config);
             }
             list.Clear();
-            base.AfterDeserialization();
+            this.EndInit();
         }
 		
         public UnitConfig Get(int id)
@@ -62,23 +63,31 @@ namespace ET
             {
                 return null;
             }
-            return this.dict.Values.First();
+            return this.dict.Values.GetEnumerator().Current;
         }
     }
 
-    public partial class UnitConfig: IConfig
-    {
-        [ProtoMember(1, IsRequired  = true)]
-        public int Id { get; set; }
-        [ProtoMember(2, IsRequired  = true)]
-        public string Name { get; set; }
-        [ProtoMember(3, IsRequired  = true)]
-        public string Desc { get; set; }
-        [ProtoMember(4, IsRequired  = true)]
-        public int Position { get; set; }
-        [ProtoMember(5, IsRequired  = true)]
-        public int Height { get; set; }
-        [ProtoMember(6, IsRequired  = true)]
-        public int Weight { get; set; }
-    }
-}
+    [ProtoContract]
+	public partial class UnitConfig: ProtoObject, IConfig
+	{
+		[ProtoMember(1, IsRequired  = true)]
+		public int Id { get; set; }
+		[ProtoMember(2, IsRequired  = true)]
+		public string Name { get; set; }
+		[ProtoMember(3, IsRequired  = true)]
+		public string Desc { get; set; }
+		[ProtoMember(4, IsRequired  = true)]
+		public int Position { get; set; }
+		[ProtoMember(5, IsRequired  = true)]
+		public int Height { get; set; }
+		[ProtoMember(6, IsRequired  = true)]
+		public int Weight { get; set; }
+
+
+		[ProtoAfterDeserialization]
+        public void AfterDeserialization()
+        {
+            this.EndInit();
+        }
+	}
+}

+ 0 - 12
Unity/Assets/Model/Module/Config/AConfigComponent.cs.meta

@@ -1,12 +0,0 @@
-fileFormatVersion: 2
-guid: 3a286d83056068f4ba8dfcf7a37b926d
-timeCreated: 1498879455
-licenseType: Free
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 2 - 0
Unity/Assets/Model/Module/Config/ConfigComponent.cs

@@ -8,6 +8,8 @@ namespace ET
     /// </summary>
     public class ConfigComponent: Entity
     {
+        public static Action<Dictionary<string, byte[]>> GetAllConfigBytes;
+        
         public static ConfigComponent Instance;
 		
         public Dictionary<Type, object> AllConfig = new Dictionary<Type, object>();

+ 0 - 12
Unity/Assets/Model/Module/Config/ConfigHelper.cs.meta

@@ -1,12 +0,0 @@
-fileFormatVersion: 2
-guid: 0e19c00909caacf4bb8cdd8e39e2e365
-timeCreated: 1477905905
-licenseType: Pro
-MonoImporter:
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 1 - 1
Unity/Assets/ThirdParty/protobuf-net/Meta/MetaType.cs

@@ -707,7 +707,7 @@ namespace ProtoBuf.Meta
                 else if (member is MethodInfo method)
                 {
                     if (isEnum) continue;
-                    AttributeMap[] memberAttribs = AttributeMap.Create(model, method, false);
+                    AttributeMap[] memberAttribs = AttributeMap.Create(model, method, true);
                     if (memberAttribs != null && memberAttribs.Length > 0)
                     {
                         CheckForCallback(method, memberAttribs, "ProtoBuf.ProtoBeforeSerializationAttribute", ref callbacks, 0);

+ 1 - 1
Unity/Unity.Hotfix.csproj

@@ -52,11 +52,11 @@
     <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
   </PropertyGroup>
   <ItemGroup>
-     <Compile Include="Assets\Hotfix\Module\Config\ConfigComponentSystem.cs" />
      <Compile Include="Assets\Hotfix\Module\Message\NetThreadComponentSystem.cs" />
      <Compile Include="Assets\Hotfix\Scene\LoginHelper.cs" />
      <Compile Include="Assets\Hotfix\Module\Numeric\NumericChangeEvent_NotifyWatcher.cs" />
      <Compile Include="Assets\Hotfix\Unit\M2C_CreateUnitsHandler.cs" />
+     <Compile Include="Assets\Hotfix\Module\Config\ConfigComponentSystem.cs" />
      <Compile Include="Assets\Hotfix\Module\Message\SessionIdleCheckerComponentSystem.cs" />
      <Compile Include="Assets\Hotfix\Module\Message\NetKcpComponentSystem.cs" />
      <Compile Include="Assets\Hotfix\Module\Numeric\NumericWatcher_Hp_ShowUI.cs" />

+ 1 - 1
Unity/Unity.HotfixView.csproj

@@ -52,7 +52,6 @@
     <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
   </PropertyGroup>
   <ItemGroup>
-     <Compile Include="Assets\HotfixView\Helper\LoadConfigHelper.cs" />
      <Compile Include="Assets\HotfixView\UI\UILogin\LoginFinish_RemoveLoginUI.cs" />
      <Compile Include="Assets\HotfixView\Scene\SceneFactory.cs" />
      <Compile Include="Assets\HotfixView\UI\UILobby\UILobbyEvent.cs" />
@@ -75,6 +74,7 @@
      <Compile Include="Assets\HotfixView\UI\UILogin\UILoginComponentSystem.cs" />
      <Compile Include="Assets\HotfixView\UI\UILoading\LoadingBeginEvent_CreateLoadingUI.cs" />
      <Compile Include="Assets\HotfixView\UI\UILoading\UILoadingEvent.cs" />
+     <Compile Include="Assets\HotfixView\Helper\LoadConfigHelper.cs" />
      <Compile Include="Assets\HotfixView\Unit\AnimatorComponentSystem.cs" />
      <Compile Include="Assets\HotfixView\Scene\AfterCreateZoneScene_AddComponent.cs" />
      <None Include="Assets\HotfixView\Unity.HotfixView.asmdef" />

+ 0 - 1
Unity/Unity.Model.csproj

@@ -52,7 +52,6 @@
     <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
   </PropertyGroup>
   <ItemGroup>
-     <Compile Include="Assets\Model\Core\FunctionCallback.cs" />
      <Compile Include="Assets\Model\Helper\PathHelper.cs" />
      <Compile Include="Assets\Model\Unit\TurnComponent.cs" />
      <Compile Include="Assets\Model\Core\DoubleMap.cs" />