195 lines
5.2 KiB
C#
195 lines
5.2 KiB
C#
using ProtoBuf;
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
using NBC;
|
|
using NBC.Network.Interface;
|
|
using NBC.Serialize;
|
|
#pragma warning disable CS8618
|
|
|
|
namespace NBC
|
|
{
|
|
/// <summary>
|
|
/// 请求创建房间
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class C2Map_CreateRoomRequest : AMessage, ICustomRouteRequest
|
|
{
|
|
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
|
|
{
|
|
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_ExitRoomRequest : AMessage, IRequest
|
|
{
|
|
public static C2G_ExitRoomRequest Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<C2G_ExitRoomRequest>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
RoomCode = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<C2G_ExitRoomRequest>(this);
|
|
#endif
|
|
}
|
|
[ProtoIgnore]
|
|
public G2C_ExitRoomResponse ResponseType { get; set; }
|
|
public uint OpCode() { return OuterOpcode.C2G_ExitRoomRequest; }
|
|
[ProtoMember(1)]
|
|
public string RoomCode { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 请求网关进入离开响应
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class G2C_ExitRoomResponse : AMessage, IResponse
|
|
{
|
|
public static G2C_ExitRoomResponse Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<G2C_ExitRoomResponse>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
ErrorCode = default;
|
|
RoomCode = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<G2C_ExitRoomResponse>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.G2C_ExitRoomResponse; }
|
|
[ProtoMember(1)]
|
|
public string RoomCode { get; set; }
|
|
[ProtoMember(2)]
|
|
public uint ErrorCode { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 请求网关进入地图
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class C2G_EnterMapRequest : AMessage, IRequest
|
|
{
|
|
public static C2G_EnterMapRequest Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<C2G_EnterMapRequest>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
RoomCode = default;
|
|
MapId = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<C2G_EnterMapRequest>(this);
|
|
#endif
|
|
}
|
|
[ProtoIgnore]
|
|
public G2C_EnterMapResponse ResponseType { get; set; }
|
|
public uint OpCode() { return OuterOpcode.C2G_EnterMapRequest; }
|
|
[ProtoMember(1)]
|
|
public string RoomCode { get; set; }
|
|
[ProtoMember(2)]
|
|
public int MapId { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 请求网关进入房间响应
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class G2C_EnterMapResponse : AMessage, IResponse
|
|
{
|
|
public static G2C_EnterMapResponse Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<G2C_EnterMapResponse>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
ErrorCode = default;
|
|
MapId = default;
|
|
RoomCode = default;
|
|
Units.Clear();
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<G2C_EnterMapResponse>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.G2C_EnterMapResponse; }
|
|
[ProtoMember(1)]
|
|
public int MapId { get; set; }
|
|
[ProtoMember(2)]
|
|
public string RoomCode { get; set; }
|
|
[ProtoMember(3)]
|
|
public List<MapUnitInfo> Units = new List<MapUnitInfo>();
|
|
[ProtoMember(4)]
|
|
public uint ErrorCode { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 通知客户端切换地图
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class Map2C_ChangeMap : AMessage, ICustomRouteMessage
|
|
{
|
|
public static Map2C_ChangeMap Create(Scene scene)
|
|
{
|
|
return scene.MessagePoolComponent.Rent<Map2C_ChangeMap>();
|
|
}
|
|
public override void Dispose()
|
|
{
|
|
MapId = default;
|
|
Node = default;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Map2C_ChangeMap>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.Map2C_ChangeMap; }
|
|
[ProtoIgnore]
|
|
public int RouteType => Fantasy.RouteType.MapRoute;
|
|
[ProtoMember(1)]
|
|
public int MapId { get; set; }
|
|
[ProtoMember(2)]
|
|
public int Node { get; set; }
|
|
}
|
|
}
|
|
|