提交示例代码
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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user