房间创建相关协议
This commit is contained in:
@@ -9,4 +9,152 @@ using NBC.Serialize;
|
||||
|
||||
namespace NBC
|
||||
{
|
||||
/// <summary>
|
||||
/// 请求创建房间
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Map_CreateRoomRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Map_CreateRoomRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Map_CreateRoomRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MapId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Map_CreateRoomRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Map2C_CreateRoomResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Map_CreateRoomRequest; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public int MapId { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求创建房间成功
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Map2C_CreateRoomResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Map2C_CreateRoomResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Map2C_CreateRoomResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
RoomCode = default;
|
||||
Units.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_CreateRoomResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Map2C_CreateRoomResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string RoomCode { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public List<MapUnitInfo> Units = new List<MapUnitInfo>();
|
||||
[ProtoMember(3)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求网关进入房间
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2G_EnterRoomRequest : AMessage, IRequest, IProto
|
||||
{
|
||||
public static C2G_EnterRoomRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_EnterRoomRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
RoomCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_EnterRoomRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public G2C_EnterRoomResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2G_EnterRoomRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string RoomCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 请求网关进入房间响应
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2C_EnterRoomResponse : AMessage, IResponse, IProto
|
||||
{
|
||||
public static G2C_EnterRoomResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2C_EnterRoomResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
RoomCode = default;
|
||||
Units.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2C_EnterRoomResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.G2C_EnterRoomResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string RoomCode { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public List<MapUnitInfo> Units = new List<MapUnitInfo>();
|
||||
[ProtoMember(3)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Map_EnterMapRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Map_EnterMapRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Map_EnterMapRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MapId = default;
|
||||
RoomId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Map_EnterMapRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Map2C_EnterMapResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Map_EnterMapRequest; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MapRoute;
|
||||
[ProtoMember(1)]
|
||||
public int MapId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long RoomId { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Map2C_EnterMapResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Map2C_EnterMapResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Map2C_EnterMapResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
MapId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Map2C_EnterMapResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Map2C_EnterMapResponse; }
|
||||
[ProtoMember(1)]
|
||||
public int MapId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user