提交示例代码
This commit is contained in:
@@ -0,0 +1,171 @@
|
||||
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>
|
||||
/// Gate服务器登陆到Mail服务器
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2Mail_LoginRequest : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2Mail_LoginRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2Mail_LoginRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Name = default;
|
||||
AccountId = default;
|
||||
CreateTime = default;
|
||||
GateRouteId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2Mail_LoginRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Mail2G_LoginResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2Mail_LoginRequest; }
|
||||
[ProtoMember(1)]
|
||||
public string Name { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public long AccountId { get; set; }
|
||||
[ProtoMember(3)]
|
||||
public long CreateTime { get; set; }
|
||||
[ProtoMember(4)]
|
||||
public long GateRouteId { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Mail2G_LoginResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static Mail2G_LoginResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Mail2G_LoginResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
MailUnitRouteId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2G_LoginResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.Mail2G_LoginResponse; }
|
||||
[ProtoMember(1)]
|
||||
public long MailUnitRouteId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送一个Gate服务器发送给Mail之间的测试协议
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2Mail_TestMessage : AMessage, IRouteMessage, IProto
|
||||
{
|
||||
public static G2Mail_TestMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2Mail_TestMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2Mail_TestMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.G2Mail_TestMessage; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送给Mail服务器进行下线
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class G2Mail_ExitRequest : AMessage, IRouteRequest, IProto
|
||||
{
|
||||
public static G2Mail_ExitRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<G2Mail_ExitRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2Mail_ExitRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Mail2G_ExitResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.G2Mail_ExitRequest; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Mail2G_ExitResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static Mail2G_ExitResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Mail2G_ExitResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2G_ExitResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.Mail2G_ExitResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 其他服务器发送邮件
|
||||
/// </summary>
|
||||
public partial class Other2Mail_SendMailRequest : AMessage, IRouteRequest
|
||||
{
|
||||
public static Other2Mail_SendMailRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Other2Mail_SendMailRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MailBox = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Other2Mail_SendMailRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[BsonIgnore]
|
||||
public Mail2Other_SendMailResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return InnerOpcode.Other2Mail_SendMailRequest; }
|
||||
public MailBox MailBox { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Mail2Other_SendMailResponse : AMessage, IRouteResponse, IProto
|
||||
{
|
||||
public static Mail2Other_SendMailResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Mail2Other_SendMailResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2Other_SendMailResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.Mail2Other_SendMailResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Fantasy
|
||||
{
|
||||
public static partial class InnerOpcode
|
||||
{
|
||||
public const uint G2Mail_LoginRequest = 1073751825;
|
||||
public const uint Mail2G_LoginResponse = 1207969553;
|
||||
public const uint G2Mail_TestMessage = 939534097;
|
||||
public const uint G2Mail_ExitRequest = 1073751826;
|
||||
public const uint Mail2G_ExitResponse = 1207969554;
|
||||
public const uint Other2Mail_SendMailRequest = 1082140435;
|
||||
public const uint Mail2Other_SendMailResponse = 1207969555;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,524 @@
|
||||
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>
|
||||
/// 登陆到Gate服务器
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2G_LoginRequest : AMessage, IRequest, IProto
|
||||
{
|
||||
public static C2G_LoginRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_LoginRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Name = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_LoginRequest>(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<G2C_LoginResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<G2C_LoginResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.G2C_LoginResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端通知服务器退出游戏
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2G_Exit : AMessage, IMessage, IProto
|
||||
{
|
||||
public static C2G_Exit Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_Exit>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_Exit>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.C2G_Exit; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 测试Mail自定义Route协议
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Mail_TestRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Mail_TestRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Mail_TestRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Mail_TestRequest>(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<Mail2C_TestResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Tag = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_TestResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Mail2C_TestResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string Tag { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 一个邮件的完整信息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class MailInfo : AMessage, IProto
|
||||
{
|
||||
public static MailInfo Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<MailInfo>();
|
||||
}
|
||||
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<MailInfo>(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<ItemInfo> Items = new List<ItemInfo>();
|
||||
}
|
||||
/// <summary>
|
||||
/// 一个邮件的简单版消息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class MailSimplifyInfo : AMessage, IProto
|
||||
{
|
||||
public static MailSimplifyInfo Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<MailSimplifyInfo>();
|
||||
}
|
||||
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<MailSimplifyInfo>(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; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 一个简单的物品信息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class ItemInfo : AMessage, IProto
|
||||
{
|
||||
public static ItemInfo Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<ItemInfo>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ItemId = default;
|
||||
Name = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<ItemInfo>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoMember(1)]
|
||||
public long ItemId { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Mail通知客户端有新的邮件
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Mail2C_HaveMail : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static Mail2C_HaveMail Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Mail2C_HaveMail>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Mail = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_HaveMail>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Mail2C_HaveMail; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.MailRoute;
|
||||
[ProtoMember(1)]
|
||||
public MailSimplifyInfo Mail { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Mail通知客户端邮件状态变化
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class Mail2C_MailState : AMessage, ICustomRouteMessage, IProto
|
||||
{
|
||||
public static Mail2C_MailState Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Mail2C_MailState>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MailState = default;
|
||||
MailId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_MailState>(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; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端获取档期所有邮件的信息
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Mail_GetHaveMailRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Mail_GetHaveMailRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Mail_GetHaveMailRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Mail_GetHaveMailRequest>(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<Mail2C_GetHaveMailResposne>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Mails.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_GetHaveMailResposne>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Mail2C_GetHaveMailResposne; }
|
||||
[ProtoMember(1)]
|
||||
public List<MailSimplifyInfo> Mails = new List<MailSimplifyInfo>();
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端发开一个邮件
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Mail_OpenMailRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Mail_OpenMailRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Mail_OpenMailRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MailId = default;
|
||||
ReturnMailInfo = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Mail_OpenMailRequest>(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<Mail2C_OpenMailResposne>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
MailInfo = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_OpenMailResposne>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Mail2C_OpenMailResposne; }
|
||||
[ProtoMember(1)]
|
||||
public MailInfo MailInfo { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端领取邮件的附件
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Mail_ReceiveMailRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Mail_ReceiveMailRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Mail_ReceiveMailRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MailId = default;
|
||||
Money = default;
|
||||
ItemId.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Mail_ReceiveMailRequest>(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<long> ItemId = new List<long>();
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Mail2C_ReceiveMailResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Mail2C_ReceiveMailResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Mail2C_ReceiveMailResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_ReceiveMailResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Mail2C_ReceiveMailResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端通知服务器删除一个邮件
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Mail_RemoveMailRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Mail_RemoveMailRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Mail_RemoveMailRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
MailId = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Mail_RemoveMailRequest>(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<Mail2C_RemoveMailResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_RemoveMailResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Mail2C_RemoveMailResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 客户端玩家发送邮件到另外一个玩家
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
public partial class C2Mail_SendMailRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Mail_SendMailRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Mail_SendMailRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
UserName = default;
|
||||
Title = default;
|
||||
Content = default;
|
||||
Money = default;
|
||||
ItemId.Clear();
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Mail_SendMailRequest>(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<long> ItemId = new List<long>();
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Mail2C_SendMailResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Mail2C_SendMailResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Mail2C_SendMailResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Mail2C_SendMailResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Mail2C_SendMailResponse; }
|
||||
[ProtoMember(1)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace Fantasy
|
||||
{
|
||||
public static partial class OuterOpcode
|
||||
{
|
||||
public const uint C2G_LoginRequest = 268445457;
|
||||
public const uint G2C_LoginResponse = 402663185;
|
||||
public const uint C2G_Exit = 134227729;
|
||||
public const uint C2Mail_TestRequest = 2281711377;
|
||||
public const uint Mail2C_TestResponse = 2415929105;
|
||||
public const uint Mail2C_HaveMail = 2147493649;
|
||||
public const uint Mail2C_MailState = 2147493650;
|
||||
public const uint C2Mail_GetHaveMailRequest = 2281711378;
|
||||
public const uint Mail2C_GetHaveMailResposne = 2415929106;
|
||||
public const uint C2Mail_OpenMailRequest = 2281711379;
|
||||
public const uint Mail2C_OpenMailResposne = 2415929107;
|
||||
public const uint C2Mail_ReceiveMailRequest = 2281711380;
|
||||
public const uint Mail2C_ReceiveMailResponse = 2415929108;
|
||||
public const uint C2Mail_RemoveMailRequest = 2281711381;
|
||||
public const uint Mail2C_RemoveMailResponse = 2415929109;
|
||||
public const uint C2Mail_SendMailRequest = 2281711382;
|
||||
public const uint Mail2C_SendMailResponse = 2415929110;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Fantasy
|
||||
{
|
||||
// Route协议定义(需要定义1000以上、因为1000以内的框架预留)
|
||||
public static class RouteType
|
||||
{
|
||||
public const int MailRoute = 1001; // Mail
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user