Ver código fonte

为了避免Package之间定义的SceneType TimerInvokerType冲突,每个Package增加一个PackageType,PackageType向ET项目申请,保证每个PackageType都不冲突。
自己定义的各种Type,都统一用类似 (PackageType.Core << 16) + 1这种方式定义,这样可以保证各个package定义的Type完全不冲突

tanghai 1 ano atrás
pai
commit
dee26bfa85
34 arquivos alterados com 172 adições e 70 exclusões
  1. BIN
      Config/Excel/c/UnitConfigCategory.bytes
  2. BIN
      Config/Excel/cs/UnitConfigCategory.bytes
  3. BIN
      Config/Excel/s/UnitConfigCategory.bytes
  4. 3 3
      Config/Json/c/UnitConfig.txt
  5. 4 4
      Config/Json/cs/UnitConfig.txt
  6. 3 3
      Config/Json/s/UnitConfig.txt
  7. 0 8
      Share/Tool/ET.Tool.csproj
  8. 7 0
      Share/Tool/ExcelExporter/PackageType.cs
  9. 1 1
      Share/Tool/ExcelExporter/ToolEvent_ExcelExporter.cs
  10. 7 0
      Share/Tool/Proto2CS/PackageType.cs
  11. 1 1
      Share/Tool/Proto2CS/ToolEvent_Proto2CS.cs
  12. BIN
      Unity/Assets/Bundles/Config/UnitConfigCategory.bytes
  13. 3 2
      Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share.meta
  14. 7 0
      Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/PackageType.cs
  15. 11 0
      Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/PackageType.cs.meta
  16. 7 0
      Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/TimerInvokeType.cs
  17. 1 1
      Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/TimerInvokeType.cs.meta
  18. 8 0
      Unity/Packages/cn.etetet.core/Scripts/Model/Share/PackageType.cs
  19. 11 0
      Unity/Packages/cn.etetet.core/Scripts/Model/Share/PackageType.cs.meta
  20. 3 3
      Unity/Packages/cn.etetet.core/Scripts/Model/Share/SceneType.cs
  21. 0 18
      Unity/Packages/cn.etetet.core/Scripts/Model/Share/TimerInvokeType.cs
  22. 7 0
      Unity/Packages/cn.etetet.move/Scripts/Model/Share/PackageType.cs
  23. 11 0
      Unity/Packages/cn.etetet.move/Scripts/Model/Share/PackageType.cs.meta
  24. 7 0
      Unity/Packages/cn.etetet.move/Scripts/Model/Share/TimerInvokeType.cs
  25. 11 0
      Unity/Packages/cn.etetet.move/Scripts/Model/Share/TimerInvokeType.cs.meta
  26. BIN
      Unity/Packages/cn.etetet.statesync/Excel/UnitConfig.xlsx
  27. 7 0
      Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/PackageType.cs
  28. 11 0
      Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/PackageType.cs.meta
  29. 14 14
      Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/SceneType.cs
  30. 2 5
      Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/TimerInvokeType.cs
  31. 4 4
      Unity/Packages/cn.etetet.statesync/Settings/AssetBundleCollectorSetting.asset
  32. 7 0
      Unity/Packages/cn.etetet.unit/Scripts/Model/Share/PackageType.cs
  33. 11 0
      Unity/Packages/cn.etetet.unit/Scripts/Model/Share/PackageType.cs.meta
  34. 3 3
      Unity/Packages/cn.etetet.unit/Scripts/Model/Share/UnitType.cs

BIN
Config/Excel/c/UnitConfigCategory.bytes


BIN
Config/Excel/cs/UnitConfigCategory.bytes


BIN
Config/Excel/s/UnitConfigCategory.bytes


+ 3 - 3
Config/Json/c/UnitConfig.txt

@@ -1,5 +1,5 @@
 {"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}],
+[1001, {"_t":"UnitConfig","_id":1001,"Type":3001,"Name":"米克尔","Position":1,"Height":178}],
+[1002, {"_t":"UnitConfig","_id":1002,"Type":3001,"Name":"米克尔2","Position":2,"Height":278}],
+[1004, {"_t":"UnitConfig","_id":1004,"Type":3001,"Name":"米克尔4","Position":2,"Height":278}],
 ]}

+ 4 - 4
Config/Json/cs/UnitConfig.txt

@@ -1,6 +1,6 @@
 {"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}],
+[1001, {"_t":"UnitConfig","_id":1001,"Type":3001,"Name":"米克尔","Position":1,"Height":178,"Weight":68}],
+[1002, {"_t":"UnitConfig","_id":1002,"Type":3001,"Name":"米克尔2","Position":2,"Height":278,"Weight":78}],
+[1003, {"_t":"UnitConfig","_id":1003,"Type":3001,"Name":"米克尔3","Position":1,"Height":178,"Weight":68}],
+[1004, {"_t":"UnitConfig","_id":1004,"Type":3001,"Name":"米克尔4","Position":2,"Height":278,"Weight":78}],
 ]}

+ 3 - 3
Config/Json/s/UnitConfig.txt

@@ -1,5 +1,5 @@
 {"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}],
+[1001, {"_t":"UnitConfig","_id":1001,"Type":3001,"Name":"米克尔","Position":1,"Weight":68}],
+[1002, {"_t":"UnitConfig","_id":1002,"Type":3001,"Name":"米克尔2","Position":2,"Weight":78}],
+[1003, {"_t":"UnitConfig","_id":1003,"Type":3001,"Name":"米克尔3","Position":1,"Weight":68}],
 ]}

+ 0 - 8
Share/Tool/ET.Tool.csproj

@@ -42,14 +42,6 @@
         <Compile Include="..\..\Unity\Packages\cn.etetet.core\Runtime\Network\OpcodeRangeDefine.cs">
             <Link>Module\Message\OpcodeRangeDefine.cs</Link>
         </Compile>
-
-        <Compile Update="Proto2CS\ToolEvent_Proto2CS.cs">
-          <Link>Share\ToolEvent_Proto2CS.cs</Link>
-        </Compile>
-
-        <Compile Update="ExcelExporter\ToolEvent_ExcelExporter.cs">
-          <Link>Share\FiberInit_Proto2CS.cs</Link>
-        </Compile>
     </ItemGroup>
     
     <ItemGroup>

+ 7 - 0
Share/Tool/ExcelExporter/PackageType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class PackageType
+    {
+        public const int ExcelExporter = 12;
+    }
+}

+ 1 - 1
Share/Tool/ExcelExporter/ToolEvent_ExcelExporter.cs

@@ -4,7 +4,7 @@ namespace ET
 {
     public static partial class SceneType
     {
-        public const int ExcelExporter = 1;
+        public const int ExcelExporter = PackageType.ExcelExporter * 1000 + 1;
     }
     
     [Event(SceneType.ExcelExporter)]

+ 7 - 0
Share/Tool/Proto2CS/PackageType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class PackageType
+    {
+        public const int Proto2CS = 11;
+    }
+}

+ 1 - 1
Share/Tool/Proto2CS/ToolEvent_Proto2CS.cs

@@ -4,7 +4,7 @@ namespace ET
 {
     public static partial class SceneType
     {
-        public const int Proto2CS = 2;
+        public const int Proto2CS = PackageType.Proto2CS * 1000 + 1;
     }
     
     [Event(SceneType.Proto2CS)]

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


+ 3 - 2
Unity/Assets/Bundles/Config/UnitConfigCategory.bytes.meta → Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share.meta

@@ -1,6 +1,7 @@
 fileFormatVersion: 2
-guid: 4c54687c04c629d488376e5ef067ef18
-TextScriptImporter:
+guid: 1d9c1a18a0b5e4e43ba015262be41ebc
+folderAsset: yes
+DefaultImporter:
   externalObjects: {}
   userData: 
   assetBundleName: 

+ 7 - 0
Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/PackageType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class PackageType
+    {
+        public const int ActorLocation = 5;
+    }
+}

+ 11 - 0
Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/PackageType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e6c412793f002ac44bd3f76fce1e1372
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 7 - 0
Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/TimerInvokeType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class TimerInvokeType
+    {
+        public const int MessageLocationSenderChecker = PackageType.ActorLocation * 1000 + 2;
+    }
+}

+ 1 - 1
Unity/Packages/cn.etetet.core/Scripts/Model/Share/TimerInvokeType.cs.meta → Unity/Packages/cn.etetet.actorlocation/Scripts/Model/Share/TimerInvokeType.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: ac3305726db67414fad25bd2fb47fc12
+guid: 832a429214294684bad5fda11cbb7f9f
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 8 - 0
Unity/Packages/cn.etetet.core/Scripts/Model/Share/PackageType.cs

@@ -0,0 +1,8 @@
+namespace ET
+{
+    [UniqueId]
+    public static partial class PackageType
+    {
+        public const int Core = 1;
+    }
+}

+ 11 - 0
Unity/Packages/cn.etetet.core/Scripts/Model/Share/PackageType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 10a442fdc5f060a49a14788894c6f65c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 3
Unity/Packages/cn.etetet.core/Scripts/Model/Share/SceneType.cs

@@ -4,8 +4,8 @@ namespace ET
     public static partial class SceneType
     {
         public const int All = 0;
-        public const int Main = -1;
-        public const int NetInner = -2;
-        public const int NetClient = -3;
+        public const int Main = PackageType.Core * 1000 + 1;
+        public const int NetInner = PackageType.Core * 1000 + 2;
+        public const int NetClient = PackageType.Core * 1000 + 3;
     }
 }

+ 0 - 18
Unity/Packages/cn.etetet.core/Scripts/Model/Share/TimerInvokeType.cs

@@ -1,18 +0,0 @@
-namespace ET
-{
-    [UniqueId(100, 10000)]
-    public static partial class TimerInvokeType
-    {
-        // 框架层100-200,逻辑层的timer type从200起
-        public const int WaitTimer = 100;
-        public const int MessageLocationSenderChecker = 102;
-        public const int MessageSenderChecker = 103;
-        
-        // 框架层100-200,逻辑层的timer type 200-300
-        public const int MoveTimer = 201;
-        public const int AITimer = 202;
-        
-        
-        public const int RoomUpdate = 301;
-    }
-}

+ 7 - 0
Unity/Packages/cn.etetet.move/Scripts/Model/Share/PackageType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class PackageType
+    {
+        public const int Move = 2;
+    }
+}

+ 11 - 0
Unity/Packages/cn.etetet.move/Scripts/Model/Share/PackageType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3b489d5edb1965942b5873020a4874f5
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 7 - 0
Unity/Packages/cn.etetet.move/Scripts/Model/Share/TimerInvokeType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class TimerInvokeType
+    {
+        public const int MoveTimer = PackageType.Move * 1000 + 1;
+    }
+}

+ 11 - 0
Unity/Packages/cn.etetet.move/Scripts/Model/Share/TimerInvokeType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d1a5079a35e376a43bd32b74bd2803d9
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Unity/Packages/cn.etetet.statesync/Excel/UnitConfig.xlsx


+ 7 - 0
Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/PackageType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class PackageType
+    {
+        public const int StateSync = 10;
+    }
+}

+ 11 - 0
Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/PackageType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dcd134067496c254694952993340e95a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 14 - 14
Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/SceneType.cs

@@ -2,22 +2,22 @@
 {
 	public static partial class SceneType
 	{
-		public const int Location = 3;
-		public const int Realm = 4;
-		public const int Gate = 5;
-		public const int Http = 6;
-		public const int Map = 8;
-		public const int Router = 9;
-		public const int RouterManager = 10;
-		public const int Robot = 11;
-		public const int Watcher = 19;
-		public const int GameTool = 20;
-		public const int Server = 21;
+		public const int Location = PackageType.StateSync * 1000 + 1;
+		public const int Realm = PackageType.StateSync * 1000 + 2;
+		public const int Gate = PackageType.StateSync * 1000 + 3;
+		public const int Http = PackageType.StateSync * 1000 + 4;
+		public const int Map = PackageType.StateSync * 1000 + 5;
+		public const int Router = PackageType.StateSync * 1000 + 6;
+		public const int RouterManager = PackageType.StateSync * 1000 + 7;
+		public const int Robot = PackageType.StateSync * 1000 + 8;
+		public const int Watcher = PackageType.StateSync * 1000 + 9;
+		public const int GameTool = PackageType.StateSync * 1000 + 10;
+		public const int Server = PackageType.StateSync * 1000 + 11;
 		
 
 		// 客户端
-		public const int StateSync = 50;
-		public const int Current = 51;
-		public const int StateSyncView = 54;
+		public const int StateSync = PackageType.StateSync * 1000 + 20;
+		public const int Current = PackageType.StateSync * 1000 + 21;
+		public const int StateSyncView = PackageType.StateSync * 1000 + 24;
 	}
 }

+ 2 - 5
Unity/Packages/cn.etetet.statesync/Scripts/Model/Share/TimerInvokeType.cs

@@ -2,10 +2,7 @@
 {
     public static partial class TimerInvokeType
     {
-        // 框架层100-200,逻辑层的timer type从200起
-        public const int SessionIdleChecker = 101;
-        
-        // 框架层100-200,逻辑层的timer type 200-300
-        public const int SessionAcceptTimeout = 203;
+        public const int SessionIdleChecker = PackageType.StateSync * 1000 + 1;
+        public const int SessionAcceptTimeout = PackageType.StateSync * 1000 + 2;
     }
 }

+ 4 - 4
Unity/Packages/cn.etetet.statesync/Settings/AssetBundleCollectorSetting.asset

@@ -68,7 +68,7 @@ MonoBehaviour:
       AssetTags: 
       ActiveRuleName: EnableGroup
       Collectors:
-      - CollectPath: Packages/com.et.demores/Scenes
+      - CollectPath: Packages/cn.etetet.demores/Scenes
         CollectorGUID: e528ff0fe84cd9a4587b007cc977279a
         CollectorType: 0
         AddressRuleName: AddressByFileName
@@ -81,7 +81,7 @@ MonoBehaviour:
       AssetTags: 
       ActiveRuleName: EnableGroup
       Collectors:
-      - CollectPath: Packages/com.et.statesync/Bundle/UI
+      - CollectPath: Packages/cn.etetet.statesync/Bundle/UI
         CollectorGUID: 49a0f4a4f3b03e24980b5251a802c0a2
         CollectorType: 0
         AddressRuleName: AddressByFileName
@@ -94,8 +94,8 @@ MonoBehaviour:
       AssetTags: 
       ActiveRuleName: EnableGroup
       Collectors:
-      - CollectPath: Packages/com.et.demores/Bundles
-        CollectorGUID: c6bd2b470bea1414eb44ce0fbd88070e
+      - CollectPath: Packages/cn.etetet.demores/Bundles/Unit
+        CollectorGUID: 2f805b95f651fcc47a8ad0cc32706c38
         CollectorType: 0
         AddressRuleName: AddressByFileName
         PackRuleName: PackSeparately

+ 7 - 0
Unity/Packages/cn.etetet.unit/Scripts/Model/Share/PackageType.cs

@@ -0,0 +1,7 @@
+namespace ET
+{
+    public static partial class PackageType
+    {
+        public const int Unit = 3;
+    }
+}

+ 11 - 0
Unity/Packages/cn.etetet.unit/Scripts/Model/Share/PackageType.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 495cff3fb97cfcb4c9d48654b88c6f52
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 3
Unity/Packages/cn.etetet.unit/Scripts/Model/Share/UnitType.cs

@@ -2,8 +2,8 @@
 {
     public static partial class UnitType
     {
-        public const int Player = 1;
-        public const int Monster = 2;
-        public const int NPC = 3;
+        public const int Player = PackageType.Unit * 1000 + 1;
+        public const int Monster = PackageType.Unit * 1000 + 2;
+        public const int NPC = PackageType.Unit * 1000 + 3;
     }
 }