Просмотр исходного кода

【增加】加入房间协议

johnclot69 1 год назад
Родитель
Сommit
b3173016eb

+ 14 - 0
Config/Proto/OuterMessage_C_30001.proto

@@ -169,6 +169,20 @@ message G2C_CreatRoom // IResponse
 	RoomInfo Info = 4;	// 房间信息
 }
 
+//ResponseType G2C_JoinRoom
+message C2G_JoinRoom // IRequest
+{
+	int32 RpcId = 1;
+}
+
+message G2C_JoinRoom // IResponse
+{
+	int32 RpcId = 1;
+	int32 Error = 2;
+	string Message = 3;
+	RoomInfo Info = 4;	// 房间信息
+}
+
 message G2C_TestHotfixMessage // IMessage
 {
 	string Info = 1;

+ 15 - 0
DotNet/Hotfix/Scenes/Game/Handler/C2G_JoinRoomHandler.cs

@@ -0,0 +1,15 @@
+using System;
+
+namespace ET.Server;
+
+/// <summary>
+/// 加入房间
+/// </summary>
+[MessageHandler(SceneType.Game)]
+public class C2G_JoinRoomHandler : AMRpcHandler<C2G_JoinRoom, G2C_JoinRoom>
+{
+    protected override ETTask Run(Session session, C2G_JoinRoom request, G2C_JoinRoom response, Action reply)
+    {
+        throw new NotImplementedException();
+    }
+}

+ 35 - 5
DotNet/Model/Generate/Message/OuterMessage_C_30001.cs

@@ -342,6 +342,34 @@ namespace ET
 
 	}
 
+	[ResponseType(nameof(G2C_JoinRoom))]
+	[Message(OuterMessage.C2G_JoinRoom)]
+	[ProtoContract]
+	public partial class C2G_JoinRoom: ProtoObject, IRequest
+	{
+		[ProtoMember(1)]
+		public int RpcId { get; set; }
+
+	}
+
+	[Message(OuterMessage.G2C_JoinRoom)]
+	[ProtoContract]
+	public partial class G2C_JoinRoom: ProtoObject, IResponse
+	{
+		[ProtoMember(1)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(2)]
+		public int Error { get; set; }
+
+		[ProtoMember(3)]
+		public string Message { get; set; }
+
+		[ProtoMember(4)]
+		public RoomInfo Info { get; set; }
+
+	}
+
 	[Message(OuterMessage.G2C_TestHotfixMessage)]
 	[ProtoContract]
 	public partial class G2C_TestHotfixMessage: ProtoObject, IMessage
@@ -427,10 +455,12 @@ namespace ET
 		 public const ushort G2C_LoginGame = 30023;
 		 public const ushort C2G_CreatRoom = 30024;
 		 public const ushort G2C_CreatRoom = 30025;
-		 public const ushort G2C_TestHotfixMessage = 30026;
-		 public const ushort C2M_TransferMap = 30027;
-		 public const ushort M2C_TransferMap = 30028;
-		 public const ushort C2G_Benchmark = 30029;
-		 public const ushort G2C_Benchmark = 30030;
+		 public const ushort C2G_JoinRoom = 30026;
+		 public const ushort G2C_JoinRoom = 30027;
+		 public const ushort G2C_TestHotfixMessage = 30028;
+		 public const ushort C2M_TransferMap = 30029;
+		 public const ushort M2C_TransferMap = 30030;
+		 public const ushort C2G_Benchmark = 30031;
+		 public const ushort G2C_Benchmark = 30032;
 	}
 }

+ 35 - 5
Unity/Assets/Scripts/Codes/Model/Generate/Client/Message/OuterMessage_C_30001.cs

@@ -342,6 +342,34 @@ namespace ET
 
 	}
 
+	[ResponseType(nameof(G2C_JoinRoom))]
+	[Message(OuterMessage.C2G_JoinRoom)]
+	[ProtoContract]
+	public partial class C2G_JoinRoom: ProtoObject, IRequest
+	{
+		[ProtoMember(1)]
+		public int RpcId { get; set; }
+
+	}
+
+	[Message(OuterMessage.G2C_JoinRoom)]
+	[ProtoContract]
+	public partial class G2C_JoinRoom: ProtoObject, IResponse
+	{
+		[ProtoMember(1)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(2)]
+		public int Error { get; set; }
+
+		[ProtoMember(3)]
+		public string Message { get; set; }
+
+		[ProtoMember(4)]
+		public RoomInfo Info { get; set; }
+
+	}
+
 	[Message(OuterMessage.G2C_TestHotfixMessage)]
 	[ProtoContract]
 	public partial class G2C_TestHotfixMessage: ProtoObject, IMessage
@@ -427,10 +455,12 @@ namespace ET
 		 public const ushort G2C_LoginGame = 30023;
 		 public const ushort C2G_CreatRoom = 30024;
 		 public const ushort G2C_CreatRoom = 30025;
-		 public const ushort G2C_TestHotfixMessage = 30026;
-		 public const ushort C2M_TransferMap = 30027;
-		 public const ushort M2C_TransferMap = 30028;
-		 public const ushort C2G_Benchmark = 30029;
-		 public const ushort G2C_Benchmark = 30030;
+		 public const ushort C2G_JoinRoom = 30026;
+		 public const ushort G2C_JoinRoom = 30027;
+		 public const ushort G2C_TestHotfixMessage = 30028;
+		 public const ushort C2M_TransferMap = 30029;
+		 public const ushort M2C_TransferMap = 30030;
+		 public const ushort C2G_Benchmark = 30031;
+		 public const ushort G2C_Benchmark = 30032;
 	}
 }

+ 35 - 5
Unity/Assets/Scripts/Codes/Model/Generate/ClientServer/Message/OuterMessage_C_30001.cs

@@ -342,6 +342,34 @@ namespace ET
 
 	}
 
+	[ResponseType(nameof(G2C_JoinRoom))]
+	[Message(OuterMessage.C2G_JoinRoom)]
+	[ProtoContract]
+	public partial class C2G_JoinRoom: ProtoObject, IRequest
+	{
+		[ProtoMember(1)]
+		public int RpcId { get; set; }
+
+	}
+
+	[Message(OuterMessage.G2C_JoinRoom)]
+	[ProtoContract]
+	public partial class G2C_JoinRoom: ProtoObject, IResponse
+	{
+		[ProtoMember(1)]
+		public int RpcId { get; set; }
+
+		[ProtoMember(2)]
+		public int Error { get; set; }
+
+		[ProtoMember(3)]
+		public string Message { get; set; }
+
+		[ProtoMember(4)]
+		public RoomInfo Info { get; set; }
+
+	}
+
 	[Message(OuterMessage.G2C_TestHotfixMessage)]
 	[ProtoContract]
 	public partial class G2C_TestHotfixMessage: ProtoObject, IMessage
@@ -427,10 +455,12 @@ namespace ET
 		 public const ushort G2C_LoginGame = 30023;
 		 public const ushort C2G_CreatRoom = 30024;
 		 public const ushort G2C_CreatRoom = 30025;
-		 public const ushort G2C_TestHotfixMessage = 30026;
-		 public const ushort C2M_TransferMap = 30027;
-		 public const ushort M2C_TransferMap = 30028;
-		 public const ushort C2G_Benchmark = 30029;
-		 public const ushort G2C_Benchmark = 30030;
+		 public const ushort C2G_JoinRoom = 30026;
+		 public const ushort G2C_JoinRoom = 30027;
+		 public const ushort G2C_TestHotfixMessage = 30028;
+		 public const ushort C2M_TransferMap = 30029;
+		 public const ushort M2C_TransferMap = 30030;
+		 public const ushort C2G_Benchmark = 30031;
+		 public const ushort G2C_Benchmark = 30032;
 	}
 }