房间创建相关协议

This commit is contained in:
2025-08-27 00:04:58 +08:00
parent 50bcc2c497
commit c235422f97
8 changed files with 428 additions and 517 deletions

View File

@@ -9,169 +9,4 @@ using NBC.Serialize;
namespace NBC
{
/// <summary>
/// 请求创建房间
/// </summary>
[ProtoContract]
public partial class C2Game_CreateRoomRequest : AMessage, ICustomRouteRequest, IProto
{
public static C2Game_CreateRoomRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2Game_CreateRoomRequest>();
}
public override void Dispose()
{
MapId = default;
Password = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Game_CreateRoomRequest>(this);
#endif
}
[ProtoIgnore]
public Game2C_CreateRoomResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2Game_CreateRoomRequest; }
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.MapRoute;
[ProtoMember(1)]
public int MapId { get; set; }
[ProtoMember(2)]
public string Password { get; set; }
}
/// <summary>
/// 请求创建房间成功
/// </summary>
[ProtoContract]
public partial class Game2C_CreateRoomResponse : AMessage, ICustomRouteResponse, IProto
{
public static Game2C_CreateRoomResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Game2C_CreateRoomResponse>();
}
public override void Dispose()
{
ErrorCode = default;
MapId = default;
RoomId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Game2C_CreateRoomResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Game2C_CreateRoomResponse; }
[ProtoMember(1)]
public int MapId { get; set; }
[ProtoMember(2)]
public long RoomId { get; set; }
[ProtoMember(3)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// 请求进入地图
/// </summary>
[ProtoContract]
public partial class C2Game_EnterMapRequest : AMessage, ICustomRouteRequest, IProto
{
public static C2Game_EnterMapRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2Game_EnterMapRequest>();
}
public override void Dispose()
{
MapId = default;
Type = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Game_EnterMapRequest>(this);
#endif
}
[ProtoIgnore]
public Game2C_EnterMapResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2Game_EnterMapRequest; }
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.MapRoute;
[ProtoMember(1)]
public int MapId { get; set; }
[ProtoMember(2)]
public int Type { get; set; }
}
/// <summary>
/// 请求进入地图响应
/// </summary>
[ProtoContract]
public partial class Game2C_EnterMapResponse : AMessage, ICustomRouteResponse, IProto
{
public static Game2C_EnterMapResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Game2C_EnterMapResponse>();
}
public override void Dispose()
{
ErrorCode = default;
MapId = default;
Pos = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Game2C_EnterMapResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Game2C_EnterMapResponse; }
[ProtoMember(1)]
public int MapId { get; set; }
[ProtoMember(2)]
public int Pos { get; set; }
[ProtoMember(3)]
public uint ErrorCode { get; set; }
}
/// <summary>
/// 请求进入房间
/// </summary>
[ProtoContract]
public partial class C2Game_EnterRoomRequest : AMessage, ICustomRouteRequest, IProto
{
public static C2Game_EnterRoomRequest Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<C2Game_EnterRoomRequest>();
}
public override void Dispose()
{
MapId = default;
Password = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Game_EnterRoomRequest>(this);
#endif
}
[ProtoIgnore]
public Game2C_EnterRoomResponse ResponseType { get; set; }
public uint OpCode() { return OuterOpcode.C2Game_EnterRoomRequest; }
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.MapRoute;
[ProtoMember(1)]
public int MapId { get; set; }
[ProtoMember(2)]
public string Password { get; set; }
}
/// <summary>
/// 请求进入房间响应
/// </summary>
[ProtoContract]
public partial class Game2C_EnterRoomResponse : AMessage, ICustomRouteResponse, IProto
{
public static Game2C_EnterRoomResponse Create(Scene scene)
{
return scene.MessagePoolComponent.Rent<Game2C_EnterRoomResponse>();
}
public override void Dispose()
{
ErrorCode = default;
MapId = default;
RoomId = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<Game2C_EnterRoomResponse>(this);
#endif
}
public uint OpCode() { return OuterOpcode.Game2C_EnterRoomResponse; }
[ProtoMember(1)]
public int MapId { get; set; }
[ProtoMember(2)]
public long RoomId { get; set; }
[ProtoMember(3)]
public uint ErrorCode { get; set; }
}
}