Эх сурвалжийг харах

Merge branch 'master' of http://115.29.205.206/kimoji/ET

xyh1985 1 жил өмнө
parent
commit
c21fe4e973
25 өөрчлөгдсөн 178 нэмэгдсэн , 11 устгасан
  1. 1 1
      DotNet/Hotfix/Scenes/Game/Handler/C2G_CreatRoomHandler.cs
  2. 11 4
      DotNet/Hotfix/Scenes/Game/Handler/C2G_JoinRoomHandler.cs
  3. 56 0
      DotNet/Hotfix/Scenes/Game/Room/HGHHMainCheckerComponentSystem.cs
  4. 12 1
      DotNet/Hotfix/Scenes/Game/Room/RoomSystem.cs
  5. 8 0
      DotNet/Model/Scenes/Game/Room/HGHHMainCheckerComponent.cs
  6. 3 1
      DotNet/Model/Scenes/Game/Room/Room.cs
  7. 1 1
      GameServer/Config/GenFromExcel/cs/StartConfig/Localhost/StartMachineConfigCategory.bytes
  8. 1 1
      GameServer/Config/GenFromExcel/s/StartConfig/Localhost/StartMachineConfigCategory.bytes
  9. 1 1
      GameServer/Config/GenJson/cs/StartConfig/Localhost/StartMachineConfig.txt
  10. 1 1
      GameServer/Config/GenJson/s/StartConfig/Localhost/StartMachineConfig.txt
  11. BIN
      GameServer/DebugBin/Loader.pdb
  12. BIN
      GameServer/DebugBin/Model.dll
  13. BIN
      GameServer/DebugBin/Model.pdb
  14. BIN
      GameServer/DebugBin/Tool.dll
  15. BIN
      GameServer/DebugBin/Tool.pdb
  16. 7 0
      Unity/Assets/Bundles/Config/AIConfigCategory.bytes.meta
  17. 7 0
      Unity/Assets/Bundles/Config/UnitConfigCategory.bytes.meta
  18. 8 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate.meta
  19. 8 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Config.meta
  20. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/AIConfig.cs.meta
  21. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Config/UnitConfig.cs.meta
  22. 8 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Message.meta
  23. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Message/CommonProto_CS_10001.cs.meta
  24. 11 0
      Unity/Assets/Scripts/Codes/Model/Client/Generate/Message/OuterMessage_C_30001.cs.meta
  25. 1 0
      Unity/Assets/Scripts/Codes/Model/Share/TimerInvokeType.cs

+ 1 - 1
DotNet/Hotfix/Scenes/Game/Handler/C2G_CreatRoomHandler.cs

@@ -21,7 +21,7 @@ namespace ET.Server
                 return;
             }
             
-            // 玩家是否房间
+            // 玩家是否房间
             if (player.GetComponent<PlayerRoomComponent>() != null)
             { 
                 response.Error = ErrorCode.ERR_OperationError;

+ 11 - 4
DotNet/Hotfix/Scenes/Game/Handler/C2G_JoinRoomHandler.cs

@@ -39,7 +39,7 @@ namespace ET.Server
 
             PlayerRoomComponent playerRoomComponent = player.GetComponent<PlayerRoomComponent>();
             
-            // 判断玩家是否带房间加入
+            // 判断玩家是否在其他房间
             if (playerRoomComponent != null && !playerRoomComponent.RoomId.Equals(request.RoomId))
             { 
                 response.Error = ErrorCode.ERR_OperationError;
@@ -59,10 +59,17 @@ namespace ET.Server
                 reply();
                 return;
             }
-            
-            // todo 房间人数是否已满
-            
+
             // todo 玩家是否可以观战,如果可以 下面的判断屏蔽
+            // 房间人数是否已满
+            if (room.Players.Count >= room.MaxNum)
+            {
+                response.Error = ErrorCode.ERR_OperationError;
+                response.Message = "房间人数已满,不可进入...";
+                reply();
+                return;
+            }
+            
             // 房间状态是否可进入
             if (room.State != 0)
             {

+ 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;
+    }
+}

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

@@ -10,9 +10,11 @@ namespace ET.Server
     {
         /** 房间号 **/
         public string RoomId { get; set; }
+        /** 房间最大人数 **/
+        public int MaxNum { 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
GameServer/DebugBin/Loader.pdb


BIN
GameServer/DebugBin/Model.dll


BIN
GameServer/DebugBin/Model.pdb


BIN
GameServer/DebugBin/Tool.dll


BIN
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;