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 { /// /// 登陆到Gate服务器 /// [ProtoContract] public partial class C2G_LoginRequest : AMessage, IRequest, IProto { public static C2G_LoginRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { Name = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public G2C_LoginResponse ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2G_LoginRequest; } [ProtoMember(1)] public string Name { get; set; } } [ProtoContract] public partial class G2C_LoginResponse : AMessage, IResponse, IProto { public static G2C_LoginResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.G2C_LoginResponse; } [ProtoMember(1)] public uint ErrorCode { get; set; } } /// /// 客户端通知服务器退出游戏 /// [ProtoContract] public partial class C2G_Exit : AMessage, IMessage, IProto { public static C2G_Exit Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.C2G_Exit; } } /// /// 测试Mail自定义Route协议 /// [ProtoContract] public partial class C2Mail_TestRequest : AMessage, ICustomRouteRequest, IProto { public static C2Mail_TestRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { Tag = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public Mail2C_TestResponse ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2Mail_TestRequest; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; [ProtoMember(1)] public string Tag { get; set; } } [ProtoContract] public partial class Mail2C_TestResponse : AMessage, ICustomRouteResponse, IProto { public static Mail2C_TestResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; Tag = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_TestResponse; } [ProtoMember(1)] public string Tag { get; set; } [ProtoMember(2)] public uint ErrorCode { get; set; } } /// /// 一个邮件的完整信息 /// [ProtoContract] public partial class MailInfo : AMessage, IProto { public static MailInfo Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MailId = default; OwnerId = default; Title = default; Content = default; CreateTime = default; ExpireTime = default; Money = default; MailState = default; MailType = default; Items.Clear(); #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoMember(1)] public long MailId { get; set; } [ProtoMember(2)] public long OwnerId { get; set; } [ProtoMember(3)] public string Title { get; set; } [ProtoMember(4)] public string Content { get; set; } [ProtoMember(5)] public long CreateTime { get; set; } [ProtoMember(6)] public long ExpireTime { get; set; } [ProtoMember(7)] public int Money { get; set; } [ProtoMember(8)] public int MailState { get; set; } [ProtoMember(9)] public int MailType { get; set; } [ProtoMember(10)] public List Items = new List(); } /// /// 一个邮件的简单版消息 /// [ProtoContract] public partial class MailSimplifyInfo : AMessage, IProto { public static MailSimplifyInfo Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MailId = default; OwnerId = default; Title = default; Content = default; CreateTime = default; ExpireTime = default; MailState = default; MailType = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoMember(1)] public long MailId { get; set; } [ProtoMember(2)] public long OwnerId { get; set; } [ProtoMember(3)] public string Title { get; set; } [ProtoMember(4)] public string Content { get; set; } [ProtoMember(5)] public long CreateTime { get; set; } [ProtoMember(6)] public long ExpireTime { get; set; } [ProtoMember(7)] public int MailState { get; set; } [ProtoMember(8)] public int MailType { get; set; } } /// /// 一个简单的物品信息 /// [ProtoContract] public partial class ItemInfo : AMessage, IProto { public static ItemInfo Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ItemId = default; Name = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoMember(1)] public long ItemId { get; set; } [ProtoMember(2)] public string Name { get; set; } } /// /// Mail通知客户端有新的邮件 /// [ProtoContract] public partial class Mail2C_HaveMail : AMessage, ICustomRouteMessage, IProto { public static Mail2C_HaveMail Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { Mail = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_HaveMail; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; [ProtoMember(1)] public MailSimplifyInfo Mail { get; set; } } /// /// Mail通知客户端邮件状态变化 /// [ProtoContract] public partial class Mail2C_MailState : AMessage, ICustomRouteMessage, IProto { public static Mail2C_MailState Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MailState = default; MailId = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_MailState; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; [ProtoMember(1)] public int MailState { get; set; } [ProtoMember(2)] public long MailId { get; set; } } /// /// 客户端获取档期所有邮件的信息 /// [ProtoContract] public partial class C2Mail_GetHaveMailRequest : AMessage, ICustomRouteRequest, IProto { public static C2Mail_GetHaveMailRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public Mail2C_GetHaveMailResposne ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2Mail_GetHaveMailRequest; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; } [ProtoContract] public partial class Mail2C_GetHaveMailResposne : AMessage, ICustomRouteResponse, IProto { public static Mail2C_GetHaveMailResposne Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; Mails.Clear(); #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_GetHaveMailResposne; } [ProtoMember(1)] public List Mails = new List(); [ProtoMember(2)] public uint ErrorCode { get; set; } } /// /// 客户端发开一个邮件 /// [ProtoContract] public partial class C2Mail_OpenMailRequest : AMessage, ICustomRouteRequest, IProto { public static C2Mail_OpenMailRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MailId = default; ReturnMailInfo = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public Mail2C_OpenMailResposne ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2Mail_OpenMailRequest; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; [ProtoMember(1)] public long MailId { get; set; } [ProtoMember(2)] public bool ReturnMailInfo { get; set; } } [ProtoContract] public partial class Mail2C_OpenMailResposne : AMessage, ICustomRouteResponse, IProto { public static Mail2C_OpenMailResposne Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; MailInfo = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_OpenMailResposne; } [ProtoMember(1)] public MailInfo MailInfo { get; set; } [ProtoMember(2)] public uint ErrorCode { get; set; } } /// /// 客户端领取邮件的附件 /// [ProtoContract] public partial class C2Mail_ReceiveMailRequest : AMessage, ICustomRouteRequest, IProto { public static C2Mail_ReceiveMailRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MailId = default; Money = default; ItemId.Clear(); #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public Mail2C_ReceiveMailResponse ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2Mail_ReceiveMailRequest; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; [ProtoMember(1)] public long MailId { get; set; } [ProtoMember(2)] public bool Money { get; set; } [ProtoMember(3)] public List ItemId = new List(); } [ProtoContract] public partial class Mail2C_ReceiveMailResponse : AMessage, ICustomRouteResponse, IProto { public static Mail2C_ReceiveMailResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_ReceiveMailResponse; } [ProtoMember(1)] public uint ErrorCode { get; set; } } /// /// 客户端通知服务器删除一个邮件 /// [ProtoContract] public partial class C2Mail_RemoveMailRequest : AMessage, ICustomRouteRequest, IProto { public static C2Mail_RemoveMailRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { MailId = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public Mail2C_RemoveMailResponse ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2Mail_RemoveMailRequest; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; [ProtoMember(1)] public long MailId { get; set; } } [ProtoContract] public partial class Mail2C_RemoveMailResponse : AMessage, ICustomRouteResponse, IProto { public static Mail2C_RemoveMailResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_RemoveMailResponse; } [ProtoMember(1)] public uint ErrorCode { get; set; } } /// /// 客户端玩家发送邮件到另外一个玩家 /// [ProtoContract] public partial class C2Mail_SendMailRequest : AMessage, ICustomRouteRequest, IProto { public static C2Mail_SendMailRequest Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { UserName = default; Title = default; Content = default; Money = default; ItemId.Clear(); #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } [ProtoIgnore] public Mail2C_SendMailResponse ResponseType { get; set; } public uint OpCode() { return OuterOpcode.C2Mail_SendMailRequest; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MailRoute; [ProtoMember(1)] public string UserName { get; set; } [ProtoMember(2)] public string Title { get; set; } [ProtoMember(3)] public string Content { get; set; } [ProtoMember(4)] public int Money { get; set; } [ProtoMember(5)] public List ItemId = new List(); } [ProtoContract] public partial class Mail2C_SendMailResponse : AMessage, ICustomRouteResponse, IProto { public static Mail2C_SendMailResponse Create(Scene scene) { return scene.MessagePoolComponent.Rent(); } public override void Dispose() { ErrorCode = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } public uint OpCode() { return OuterOpcode.Mail2C_SendMailResponse; } [ProtoMember(1)] public uint ErrorCode { get; set; } } }