Procházet zdrojové kódy

【优化】BattleClientReady

johnclot69 před 2 roky
rodič
revize
ed3b8122c7

+ 5 - 0
Config/Proto/BattleServerMsg_CS_40001.proto

@@ -12,4 +12,9 @@ message BattleEventPush // IActorMessage
 message BattleEventPushToServer // IMessage
 {
   bytes data = 1;
+}
+
+//客户端通知战斗服,i'm ready
+message BattleClientReady // IMessage
+{
 }

+ 12 - 0
DotNet/Hotfix/Module/IceBattle/BattleEventHandler.cs

@@ -14,4 +14,16 @@
             await ETTask.CompletedTask;
         }
     }
+
+    [MessageHandler(SceneType.Game)]
+    public class BattleClientReadyHandler : AMHandler<BattleClientReady>
+    {
+        protected override async ETTask Run(Session session, BattleClientReady message)
+        {
+            Scene scene = session.DomainScene();
+            scene.GetComponent<ObjectWait>().Notify(new Wait_PlayerReady());
+
+            await ETTask.CompletedTask;
+        }
+    }
 }

+ 8 - 0
DotNet/Model/Generate/Message/BattleServerMsg_CS_40001.cs

@@ -26,9 +26,17 @@ namespace ET
 
 	}
 
+//客户端通知战斗服,i'm ready
+	[Message(BattleServerMsg.BattleClientReady)]
+	[ProtoContract]
+	public partial class BattleClientReady: ProtoObject, IMessage
+	{
+	}
+
 	public static class BattleServerMsg
 	{
 		 public const ushort BattleEventPush = 40002;
 		 public const ushort BattleEventPushToServer = 40003;
+		 public const ushort BattleClientReady = 40004;
 	}
 }

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

@@ -26,9 +26,17 @@ namespace ET
 
 	}
 
+//客户端通知战斗服,i'm ready
+	[Message(BattleServerMsg.BattleClientReady)]
+	[ProtoContract]
+	public partial class BattleClientReady: ProtoObject, IMessage
+	{
+	}
+
 	public static class BattleServerMsg
 	{
 		 public const ushort BattleEventPush = 40002;
 		 public const ushort BattleEventPushToServer = 40003;
+		 public const ushort BattleClientReady = 40004;
 	}
 }