239 lines
6.8 KiB
C#
239 lines
6.8 KiB
C#
using ProtoBuf;
|
|
|
|
using System.Collections.Generic;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using Fantasy;
|
|
using Fantasy.Network.Interface;
|
|
using Fantasy.Serialize;
|
|
// ReSharper disable InconsistentNaming
|
|
// ReSharper disable RedundantUsingDirective
|
|
// ReSharper disable RedundantOverriddenMember
|
|
// ReSharper disable PartialTypeWithSinglePart
|
|
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
|
// ReSharper disable MemberCanBePrivate.Global
|
|
// ReSharper disable CheckNamespace
|
|
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
|
|
#pragma warning disable CS8618
|
|
|
|
namespace Fantasy
|
|
{
|
|
/// <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; }
|
|
}
|
|
/// <summary>
|
|
/// 请求网关离开房间
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class C2G_ExitRoomRequest : AMessage, IRequest, IProto
|
|
{
|
|
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, IProto
|
|
{
|
|
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; }
|
|
}
|
|
[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 string 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;
|
|
#if FANTASY_NET || FANTASY_UNITY
|
|
GetScene().MessagePoolComponent.Return<Map2C_EnterMapResponse>(this);
|
|
#endif
|
|
}
|
|
public uint OpCode() { return OuterOpcode.Map2C_EnterMapResponse; }
|
|
[ProtoMember(1)]
|
|
public uint ErrorCode { get; set; }
|
|
}
|
|
/// <summary>
|
|
/// 通知客户端切换地图
|
|
/// </summary>
|
|
[ProtoContract]
|
|
public partial class Map2C_ChangeMap : AMessage, ICustomRouteMessage, IProto
|
|
{
|
|
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; }
|
|
}
|
|
}
|