Procházet zdrojové kódy

【增加】黄冈晃晃麻将主逻辑组件

johnclot69 před 1 rokem
rodič
revize
5516b25da5
23 změnil soubory, kde provedl 164 přidání a 6 odebrání
  1. 56 0
      DotNet/Hotfix/Scenes/Game/Room/HGHHMainCheckerComponentSystem.cs
  2. 12 1
      DotNet/Hotfix/Scenes/Game/Room/RoomSystem.cs
  3. 8 0
      DotNet/Model/Scenes/Game/Room/HGHHMainCheckerComponent.cs
  4. 1 1
      DotNet/Model/Scenes/Game/Room/Room.cs
  5. 1 1
      GameServer/Config/GenFromExcel/cs/StartConfig/Localhost/StartMachineConfigCategory.bytes
  6. 1 1
      GameServer/Config/GenFromExcel/s/StartConfig/Localhost/StartMachineConfigCategory.bytes
  7. 1 1
      GameServer/Config/GenJson/cs/StartConfig/Localhost/StartMachineConfig.txt
  8. 1 1
      GameServer/Config/GenJson/s/StartConfig/Localhost/StartMachineConfig.txt
  9. binární
      GameServer/DebugBin/Loader.pdb
  10. binární
      GameServer/DebugBin/Model.dll
  11. binární
      GameServer/DebugBin/Model.pdb
  12. binární
      GameServer/DebugBin/Tool.dll
  13. binární
      GameServer/DebugBin/Tool.pdb
  14. 7 0
      Unity/Assets/Bundles/Config/AIConfigCategory.bytes.meta
  15. 7 0
      Unity/Assets/Bundles/Config/UnitConfigCategory.bytes.meta
  16. 8 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate.meta
  17. 8 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Config.meta
  18. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/AIConfig.cs.meta
  19. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/UnitConfig.cs.meta
  20. 8 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Message.meta
  21. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Message/CommonProto_CS_10001.cs.meta
  22. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Message/OuterMessage_C_30001.cs.meta
  23. 1 0
      Unity/Assets/Scripts/Codes/Model/Share/TimerInvokeType.cs

+ 56 - 0
DotNet/Hotfix/Scenes/Game/Room/HGHHMainCheckerComponentSystem.cs

@@ -0,0 +1,56 @@
+using System;
+
+namespace ET.Server
+{
+    [Invoke(TimerInvokeType.HGHHMainChecker)]
+    public class HGHHMainChecker: ATimer<HGHHMainCheckerComponent>
+    {
+        protected override void Run(HGHHMainCheckerComponent self)
+        {
+            try
+            {
+                self.Check();
+            }
+            catch (Exception e)
+            {
+                Log.Error($"move timer error: {self.Id}\n{e}");
+            }
+        }
+    }
+    
+    [ObjectSystem]
+    public class HGHHMainCheckerComponentAwakeSystem: AwakeSystem<HGHHMainCheckerComponent>
+    {
+        protected override void Awake(HGHHMainCheckerComponent self)
+        {
+            Log.Info($"创建黄冈晃晃主逻辑组件...");
+            self.RepeatedTimer = TimerComponent.Instance.NewRepeatedTimer(1000, TimerInvokeType.HGHHMainChecker, self);
+        }
+    }
+    
+    [ObjectSystem]
+    public class HGHHMainCheckerComponentDestroySystem: DestroySystem<HGHHMainCheckerComponent>
+    {
+        protected override void Destroy(HGHHMainCheckerComponent self)
+        {
+            Log.Info($"销毁黄冈晃晃主逻辑组件...");
+            TimerComponent.Instance?.Remove(ref self.RepeatedTimer);
+        }
+    }
+
+    public static class HGHHMainCheckerComponentSystem
+    {
+        // 黄冈晃晃牌库
+        
+        public static void Check(this HGHHMainCheckerComponent self)
+        {
+            Room room = self.GetParent<Room>();
+            if (room == null)
+            {
+                Log.Error($"黄冈晃晃主逻辑组件获取不到主实体...");
+                return;
+            }
+            Log.Debug($"检测: 黄冈晃晃-房间号:{room.RoomId}, 状态:{room.State}...");
+        }
+    }
+}

+ 12 - 1
DotNet/Hotfix/Scenes/Game/Room/RoomSystem.cs

@@ -12,12 +12,23 @@ namespace ET.Server
             {
                 Log.Info($"创建房间实体...");
                 self.RoomId = RandomGenerator.RandRoomId();
-                self.Type = 2;
+                self.Type = 1;
                 self.OwnerId = owner.Id;
                 self.Players = new List<Player>();
                 self.CreateTime = TimeHelper.ServerNow();
                 // 添加房间玩家集合
                 self.Players.Add(owner);
+                // 添加麻将主逻辑组件
+                switch (self.Type)
+                {
+                    case 1:
+                        // 黄冈晃晃
+                        self.AddComponent<HGHHMainCheckerComponent>();
+                        break;
+                    case 2:
+                        break;
+                }
+                
                 // 添加本地房间数据
                 self.DomainScene().GetComponent<GameRoomComponent>().Add(self);
             }

+ 8 - 0
DotNet/Model/Scenes/Game/Room/HGHHMainCheckerComponent.cs

@@ -0,0 +1,8 @@
+namespace ET.Server
+{
+    [ComponentOf(typeof(Room))]
+    public class HGHHMainCheckerComponent: Entity, IAwake, IDestroy
+    {
+        public long RepeatedTimer;
+    }
+}

+ 1 - 1
DotNet/Model/Scenes/Game/Room/Room.cs

@@ -12,7 +12,7 @@ namespace ET.Server
         public string RoomId { get; set; }
         /** 房间玩家集合 **/
         public List<Player> Players { get; set; }
-        /** 房间玩法类型 1:麻将 2:斗地主 **/
+        /** 房间玩法类型 1:黄冈晃晃 **/
         public int Type { get; set; }
         /** 房主playerId **/
         public long OwnerId { get; set; }

+ 1 - 1
GameServer/Config/GenFromExcel/cs/StartConfig/Localhost/StartMachineConfigCategory.bytes

@@ -1,2 +1,2 @@
 
-"	127.0.0.1192.168.1.41"10000
+	127.0.0.1	127.0.0.1"10000

+ 1 - 1
GameServer/Config/GenFromExcel/s/StartConfig/Localhost/StartMachineConfigCategory.bytes

@@ -1,2 +1,2 @@
 
-"	127.0.0.1192.168.1.41"10000
+	127.0.0.1	127.0.0.1"10000

+ 1 - 1
GameServer/Config/GenJson/cs/StartConfig/Localhost/StartMachineConfig.txt

@@ -1,3 +1,3 @@
 {"list":[
-{"_t":"StartMachineConfig","_id":1,"InnerIP":"127.0.0.1","OuterIP":"192.168.1.41","WatcherPort":"10000"},
+{"_t":"StartMachineConfig","_id":1,"InnerIP":"127.0.0.1","OuterIP":"127.0.0.1","WatcherPort":"10000"},
 ]}

+ 1 - 1
GameServer/Config/GenJson/s/StartConfig/Localhost/StartMachineConfig.txt

@@ -1,3 +1,3 @@
 {"list":[
-{"_t":"StartMachineConfig","_id":1,"InnerIP":"127.0.0.1","OuterIP":"192.168.1.41","WatcherPort":"10000"},
+{"_t":"StartMachineConfig","_id":1,"InnerIP":"127.0.0.1","OuterIP":"127.0.0.1","WatcherPort":"10000"},
 ]}

binární
GameServer/DebugBin/Loader.pdb


binární
GameServer/DebugBin/Model.dll


binární
GameServer/DebugBin/Model.pdb


binární
GameServer/DebugBin/Tool.dll


binární
GameServer/DebugBin/Tool.pdb


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

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

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

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

+ 8 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate.meta

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

+ 8 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate/Config.meta

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

+ 11 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/AIConfig.cs.meta

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

+ 11 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/UnitConfig.cs.meta

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

+ 8 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate/Message.meta

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

+ 11 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate/Message/CommonProto_CS_10001.cs.meta

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

+ 11 - 0
Unity/Assets/Scripts/Codes/Model/Client/Generate/Message/OuterMessage_C_30001.cs.meta

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

+ 1 - 0
Unity/Assets/Scripts/Codes/Model/Share/TimerInvokeType.cs

@@ -8,6 +8,7 @@
         public const int SessionIdleChecker = 101;
         public const int ActorLocationSenderChecker = 102;
         public const int ActorMessageSenderChecker = 103;
+        public const int HGHHMainChecker = 104;
         
         // 框架层100-200,逻辑层的timer type 200-300
         public const int MoveTimer = 201;