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 { /// /// 请求创建房间 /// [ProtoContract] public partial class C2Map_CreateRoomRequest : AMessage, ICustomRouteRequest, IProto { public static C2Map_CreateRoomRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MapId = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(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; } } /// /// 请求创建房间成功 /// [ProtoContract] public partial class Map2C_CreateRoomResponse : AMessage, ICustomRouteResponse, IProto { public static Map2C_CreateRoomResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; RoomCode = default; Units.Clear(); #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Map2C_CreateRoomResponse; } [ProtoMember(1)] public string RoomCode { get; set; } [ProtoMember(2)] public List Units = new List(); [ProtoMember(3)] public uint ErrorCode { get; set; } } /// /// 请求网关离开房间 /// [ProtoContract] public partial class C2G_ExitRoomRequest : AMessage, IRequest, IProto { public static C2G_ExitRoomRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { RoomCode = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public G2C_ExitRoomResponse ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2G_ExitRoomRequest; } [ProtoMember(1)] public string RoomCode { get; set; } } /// /// 请求网关进入离开响应 /// [ProtoContract] public partial class G2C_ExitRoomResponse : AMessage, IResponse, IProto { public static G2C_ExitRoomResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; RoomCode = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(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 C2G_EnterMapRequest : AMessage, IRequest, IProto { public static C2G_EnterMapRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { RoomCode = default; MapId = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(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; } } /// /// 请求网关进入房间响应 /// [ProtoContract] public partial class G2C_EnterMapResponse : AMessage, IResponse, IProto { public static G2C_EnterMapResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; MapId = default; RoomCode = default; Units.Clear(); #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(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 Units = new List(); [ProtoMember(4)] public uint ErrorCode { get; set; } } /// /// 通知客户端切换地图 /// [ProtoContract] public partial class Map2C_ChangeMap : AMessage, ICustomRouteMessage, IProto { public static Map2C_ChangeMap Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MapId = default; Node = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(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; } } }