私聊相关协议
This commit is contained in:
@@ -26,6 +26,8 @@ namespace NBC
|
|||||||
Country = default;
|
Country = default;
|
||||||
Level = default;
|
Level = default;
|
||||||
Exp = default;
|
Exp = default;
|
||||||
|
Vip = default;
|
||||||
|
VipInfo = default;
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
GetScene().MessagePoolComponent.Return<RoleBaseInfo>(this);
|
GetScene().MessagePoolComponent.Return<RoleBaseInfo>(this);
|
||||||
#endif
|
#endif
|
||||||
@@ -40,6 +42,10 @@ namespace NBC
|
|||||||
public int Level { get; set; }
|
public int Level { get; set; }
|
||||||
[ProtoMember(5)]
|
[ProtoMember(5)]
|
||||||
public int Exp { get; set; }
|
public int Exp { get; set; }
|
||||||
|
[ProtoMember(6)]
|
||||||
|
public bool Vip { get; set; }
|
||||||
|
[ProtoMember(7)]
|
||||||
|
public VipInfo VipInfo { get; set; }
|
||||||
}
|
}
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class KeyValueStringInt64 : AMessage, IProto
|
public partial class KeyValueStringInt64 : AMessage, IProto
|
||||||
@@ -159,6 +165,7 @@ namespace NBC
|
|||||||
Head = default;
|
Head = default;
|
||||||
Country = default;
|
Country = default;
|
||||||
Level = default;
|
Level = default;
|
||||||
|
Vip = default;
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
GetScene().MessagePoolComponent.Return<RoleSimpleInfo>(this);
|
GetScene().MessagePoolComponent.Return<RoleSimpleInfo>(this);
|
||||||
#endif
|
#endif
|
||||||
@@ -173,6 +180,8 @@ namespace NBC
|
|||||||
public string Country { get; set; }
|
public string Country { get; set; }
|
||||||
[ProtoMember(5)]
|
[ProtoMember(5)]
|
||||||
public int Level { get; set; }
|
public int Level { get; set; }
|
||||||
|
[ProtoMember(6)]
|
||||||
|
public bool Vip { get; set; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// VIP信息
|
/// VIP信息
|
||||||
|
|||||||
@@ -1,375 +0,0 @@
|
|||||||
using ProtoBuf;
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Fantasy;
|
|
||||||
using NBC;
|
|
||||||
using NBC.Network.Interface;
|
|
||||||
using NBC.Serialize;
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
namespace NBC
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 请求邮件列表
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Game_GetMailsRequest : AMessage, ICustomRouteRequest, IProto
|
|
||||||
{
|
|
||||||
public static C2Game_GetMailsRequest Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Game_GetMailsRequest>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Game_GetMailsRequest>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoIgnore]
|
|
||||||
public Game2C_GetMailsResponse ResponseType { get; set; }
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Game_GetMailsRequest; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.GameRoute;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 获取邮件列表响应
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Game2C_GetMailsResponse : AMessage, ICustomRouteResponse, IProto
|
|
||||||
{
|
|
||||||
public static Game2C_GetMailsResponse Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Game2C_GetMailsResponse>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
ErrorCode = default;
|
|
||||||
Mail.Clear();
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Game2C_GetMailsResponse>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Game2C_GetMailsResponse; }
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<MailInfo> Mail = new List<MailInfo>();
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public uint ErrorCode { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 新邮件推送
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Game2C_HaveMail : AMessage, ICustomRouteMessage, IProto
|
|
||||||
{
|
|
||||||
public static Game2C_HaveMail Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Game2C_HaveMail>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Mail = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Game2C_HaveMail>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Game2C_HaveMail; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.GameRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public MailInfo Mail { get; set; }
|
|
||||||
}
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Game2C_MailState : AMessage, ICustomRouteMessage, IProto
|
|
||||||
{
|
|
||||||
public static Game2C_MailState Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Game2C_MailState>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
MailState = default;
|
|
||||||
MailId = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Game2C_MailState>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Game2C_MailState; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.GameRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public int MailState { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public long MailId { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// /////////// ******** 聊天 *******/////////////
|
|
||||||
/// </summary>
|
|
||||||
/// <summary>
|
|
||||||
/// 创建频道
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Chat_CreateChannelRequest : AMessage, ICustomRouteRequest, IProto
|
|
||||||
{
|
|
||||||
public static C2Chat_CreateChannelRequest Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Chat_CreateChannelRequest>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Name = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Chat_CreateChannelRequest>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoIgnore]
|
|
||||||
public Caht2C_CreateChannelResponse ResponseType { get; set; }
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Chat_CreateChannelRequest; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 创建频道响应
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Caht2C_CreateChannelResponse : AMessage, ICustomRouteResponse, IProto
|
|
||||||
{
|
|
||||||
public static Caht2C_CreateChannelResponse Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Caht2C_CreateChannelResponse>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
ErrorCode = default;
|
|
||||||
ChannelId = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Caht2C_CreateChannelResponse>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Caht2C_CreateChannelResponse; }
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public long ChannelId { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public uint ErrorCode { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 请求进入频道
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Chat_JoinChannelRequest : AMessage, ICustomRouteRequest, IProto
|
|
||||||
{
|
|
||||||
public static C2Chat_JoinChannelRequest Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Chat_JoinChannelRequest>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Target = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Chat_JoinChannelRequest>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoIgnore]
|
|
||||||
public Caht2C_JoinChannelResponse ResponseType { get; set; }
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Chat_JoinChannelRequest; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public long Target { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 进入频道响应
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Caht2C_JoinChannelResponse : AMessage, ICustomRouteResponse, IProto
|
|
||||||
{
|
|
||||||
public static Caht2C_JoinChannelResponse Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Caht2C_JoinChannelResponse>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
ErrorCode = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Caht2C_JoinChannelResponse>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Caht2C_JoinChannelResponse; }
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public uint ErrorCode { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 发送聊天
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Chat_SendMessageRequest : AMessage, ICustomRouteRequest, IProto
|
|
||||||
{
|
|
||||||
public static C2Chat_SendMessageRequest Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Chat_SendMessageRequest>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Type = default;
|
|
||||||
Message = default;
|
|
||||||
Target = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Chat_SendMessageRequest>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoIgnore]
|
|
||||||
public Caht2C_SendMessageResponse ResponseType { get; set; }
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Chat_SendMessageRequest; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public int Type { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public string Message { get; set; }
|
|
||||||
[ProtoMember(3)]
|
|
||||||
public long Target { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 发送聊天响应
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Caht2C_SendMessageResponse : AMessage, ICustomRouteResponse, IProto
|
|
||||||
{
|
|
||||||
public static Caht2C_SendMessageResponse Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Caht2C_SendMessageResponse>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
ErrorCode = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Caht2C_SendMessageResponse>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Caht2C_SendMessageResponse; }
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public uint ErrorCode { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 获取离线时的未读私聊
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Chat_GetOfflineMessageRequest : AMessage, ICustomRouteRequest, IProto
|
|
||||||
{
|
|
||||||
public static C2Chat_GetOfflineMessageRequest Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Chat_GetOfflineMessageRequest>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Chat_GetOfflineMessageRequest>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoIgnore]
|
|
||||||
public Caht2C_GetOfflineMessageResponse ResponseType { get; set; }
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Chat_GetOfflineMessageRequest; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 发送聊天响应
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Caht2C_GetOfflineMessageResponse : AMessage, ICustomRouteResponse, IProto
|
|
||||||
{
|
|
||||||
public static Caht2C_GetOfflineMessageResponse Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Caht2C_GetOfflineMessageResponse>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
ErrorCode = default;
|
|
||||||
Message.Clear();
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Caht2C_GetOfflineMessageResponse>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Caht2C_GetOfflineMessageResponse; }
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<ChatMessageInfo> Message = new List<ChatMessageInfo>();
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public uint ErrorCode { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 推送消息
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Chat2C_Message : AMessage, ICustomRouteMessage, IProto
|
|
||||||
{
|
|
||||||
public static Chat2C_Message Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Chat2C_Message>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Message = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Chat2C_Message>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Chat2C_Message; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public ChatMessageInfo Message { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 获取聊天记录请求
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class C2Chat_GetChatRecordRequest : AMessage, ICustomRouteRequest, IProto
|
|
||||||
{
|
|
||||||
public static C2Chat_GetChatRecordRequest Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<C2Chat_GetChatRecordRequest>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Target = default;
|
|
||||||
Type = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<C2Chat_GetChatRecordRequest>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoIgnore]
|
|
||||||
public Caht2C_GetChatRecordResponse ResponseType { get; set; }
|
|
||||||
public uint OpCode() { return OuterOpcode.C2Chat_GetChatRecordRequest; }
|
|
||||||
[ProtoIgnore]
|
|
||||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public long Target { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public int Type { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 获取聊天记录响应
|
|
||||||
/// </summary>
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class Caht2C_GetChatRecordResponse : AMessage, ICustomRouteResponse, IProto
|
|
||||||
{
|
|
||||||
public static Caht2C_GetChatRecordResponse Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<Caht2C_GetChatRecordResponse>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
ErrorCode = default;
|
|
||||||
Messages.Clear();
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<Caht2C_GetChatRecordResponse>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
public uint OpCode() { return OuterOpcode.Caht2C_GetChatRecordResponse; }
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public List<ChatMessageInfo> Messages = new List<ChatMessageInfo>();
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public uint ErrorCode { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d7ddd93076e86d249a0cd3f37f357e31
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
using ProtoBuf;
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Fantasy;
|
|
||||||
using NBC;
|
|
||||||
using NBC.Network.Interface;
|
|
||||||
using NBC.Serialize;
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
namespace NBC
|
|
||||||
{
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class ChatUserInfo : AMessage, IProto
|
|
||||||
{
|
|
||||||
public static ChatUserInfo Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<ChatUserInfo>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Id = default;
|
|
||||||
Name = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<ChatUserInfo>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public long Id { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public long Name { get; set; }
|
|
||||||
}
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class ChatMessageInfo : AMessage, IProto
|
|
||||||
{
|
|
||||||
public static ChatMessageInfo Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<ChatMessageInfo>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Type = default;
|
|
||||||
Source = default;
|
|
||||||
Trigger = default;
|
|
||||||
Content = default;
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<ChatMessageInfo>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public int Type { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public long Source { get; set; }
|
|
||||||
[ProtoMember(3)]
|
|
||||||
public ChatUserInfo Trigger { get; set; }
|
|
||||||
[ProtoMember(4)]
|
|
||||||
public string Content { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b61d5cfc0ac85da449949bc871ec9f52
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
using ProtoBuf;
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Fantasy;
|
|
||||||
using NBC;
|
|
||||||
using NBC.Network.Interface;
|
|
||||||
using NBC.Serialize;
|
|
||||||
#pragma warning disable CS8618
|
|
||||||
|
|
||||||
namespace NBC
|
|
||||||
{
|
|
||||||
[ProtoContract]
|
|
||||||
public partial class MailInfo : AMessage, IProto
|
|
||||||
{
|
|
||||||
public static MailInfo Create(Scene scene)
|
|
||||||
{
|
|
||||||
return scene.MessagePoolComponent.Rent<MailInfo>();
|
|
||||||
}
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Id = default;
|
|
||||||
Title = default;
|
|
||||||
Content = default;
|
|
||||||
CreateTime = default;
|
|
||||||
ExpireTime = default;
|
|
||||||
MailType = default;
|
|
||||||
MailState = default;
|
|
||||||
Items.Clear();
|
|
||||||
#if FANTASY_NET || FANTASY_UNITY
|
|
||||||
GetScene().MessagePoolComponent.Return<MailInfo>(this);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
[ProtoMember(1)]
|
|
||||||
public long Id { get; set; }
|
|
||||||
[ProtoMember(2)]
|
|
||||||
public string Title { get; set; }
|
|
||||||
[ProtoMember(3)]
|
|
||||||
public string Content { get; set; }
|
|
||||||
[ProtoMember(4)]
|
|
||||||
public long CreateTime { get; set; }
|
|
||||||
[ProtoMember(5)]
|
|
||||||
public long ExpireTime { get; set; }
|
|
||||||
[ProtoMember(6)]
|
|
||||||
public int MailType { get; set; }
|
|
||||||
[ProtoMember(7)]
|
|
||||||
public int MailState { get; set; }
|
|
||||||
[ProtoMember(8)]
|
|
||||||
public List<AwardInfo> Items = new List<AwardInfo>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f01d74f516b672a489dd45e5fa448ad7
|
|
||||||
@@ -2,28 +2,28 @@ namespace Fantasy
|
|||||||
{
|
{
|
||||||
public static partial class OuterOpcode
|
public static partial class OuterOpcode
|
||||||
{
|
{
|
||||||
public const uint C2Game_GetMailsRequest = 2281711377;
|
|
||||||
public const uint Game2C_GetMailsResponse = 2415929105;
|
|
||||||
public const uint Game2C_HaveMail = 2147493649;
|
|
||||||
public const uint Game2C_MailState = 2147493650;
|
|
||||||
public const uint C2Chat_CreateChannelRequest = 2281711378;
|
|
||||||
public const uint Caht2C_CreateChannelResponse = 2415929106;
|
|
||||||
public const uint C2Chat_JoinChannelRequest = 2281711379;
|
|
||||||
public const uint Caht2C_JoinChannelResponse = 2415929107;
|
|
||||||
public const uint C2Chat_SendMessageRequest = 2281711380;
|
|
||||||
public const uint Caht2C_SendMessageResponse = 2415929108;
|
|
||||||
public const uint C2Chat_GetOfflineMessageRequest = 2281711381;
|
|
||||||
public const uint Caht2C_GetOfflineMessageResponse = 2415929109;
|
|
||||||
public const uint Chat2C_Message = 2147493651;
|
|
||||||
public const uint C2Chat_GetChatRecordRequest = 2281711382;
|
|
||||||
public const uint Caht2C_GetChatRecordResponse = 2415929110;
|
|
||||||
public const uint C2A_LoginRequest = 268445457;
|
public const uint C2A_LoginRequest = 268445457;
|
||||||
public const uint A2C_LoginResponse = 402663185;
|
public const uint A2C_LoginResponse = 402663185;
|
||||||
public const uint C2G_LoginRequest = 268445458;
|
public const uint C2G_LoginRequest = 268445458;
|
||||||
public const uint G2C_LoginResponse = 402663186;
|
public const uint G2C_LoginResponse = 402663186;
|
||||||
public const uint G2C_RepeatLogin = 134227729;
|
public const uint G2C_RepeatLogin = 134227729;
|
||||||
public const uint C2Game_GetRoleInfoRequest = 2281711383;
|
public const uint C2Game_GetRoleInfoRequest = 2281711377;
|
||||||
public const uint Game2C_GetRoleInfoResponse = 2415929111;
|
public const uint Game2C_GetRoleInfoResponse = 2415929105;
|
||||||
|
public const uint C2S_GetConversationsRequest = 2281711378;
|
||||||
|
public const uint S2C_GetConversationsResponse = 2415929106;
|
||||||
|
public const uint C2S_SendMailRequest = 2281711379;
|
||||||
|
public const uint S2C_SendMailResponse = 2415929107;
|
||||||
|
public const uint C2S_DeleteMailRequest = 2281711380;
|
||||||
|
public const uint S2C_DeleteMailResponse = 2415929108;
|
||||||
|
public const uint S2C_HaveMail = 2147493649;
|
||||||
|
public const uint S2C_MailState = 2147493650;
|
||||||
|
public const uint C2S_CreateChannelRequest = 2281711381;
|
||||||
|
public const uint S2C_CreateChannelResponse = 2415929109;
|
||||||
|
public const uint C2S_JoinChannelRequest = 2281711382;
|
||||||
|
public const uint S2C_JoinChannelResponse = 2415929110;
|
||||||
|
public const uint C2S_SendMessageRequest = 2281711383;
|
||||||
|
public const uint S2C_SendMessageResponse = 2415929111;
|
||||||
|
public const uint S2C_Message = 2147493651;
|
||||||
public const uint C2S_CreateClubRequest = 2281711384;
|
public const uint C2S_CreateClubRequest = 2281711384;
|
||||||
public const uint S2C_CreateClubResponse = 2415929112;
|
public const uint S2C_CreateClubResponse = 2415929112;
|
||||||
public const uint C2S_GetClubInfoRequest = 2281711385;
|
public const uint C2S_GetClubInfoRequest = 2281711385;
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ namespace Fantasy
|
|||||||
public static class RouteType
|
public static class RouteType
|
||||||
{
|
{
|
||||||
public const int GateRoute = 1001; // Gate
|
public const int GateRoute = 1001; // Gate
|
||||||
public const int ChatRoute = 1002; // Chat
|
public const int SocialRoute = 1002; // Social
|
||||||
public const int GameRoute = 1003; // Game
|
public const int GameRoute = 1003; // Game
|
||||||
public const int SocialRoute = 1004; // Social
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,485 @@ using NBC.Serialize;
|
|||||||
|
|
||||||
namespace NBC
|
namespace NBC
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// /////////// ******** 私聊/邮件 *******/////////////
|
||||||
|
/// </summary>
|
||||||
|
/// <summary>
|
||||||
|
/// 会话信息
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class ConversationInfo : AMessage, IProto
|
||||||
|
{
|
||||||
|
public static ConversationInfo Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<ConversationInfo>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
RoleInfo = default;
|
||||||
|
List.Clear();
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<ConversationInfo>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public RoleSimpleInfo RoleInfo { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public List<MailInfo> List = new List<MailInfo>();
|
||||||
|
}
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class MailInfo : AMessage, IProto
|
||||||
|
{
|
||||||
|
public static MailInfo Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<MailInfo>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Id = default;
|
||||||
|
Sender = default;
|
||||||
|
Content = default;
|
||||||
|
CreateTime = default;
|
||||||
|
MailType = default;
|
||||||
|
MailState = default;
|
||||||
|
Items.Clear();
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<MailInfo>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public long Sender { get; set; }
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public string Content { get; set; }
|
||||||
|
[ProtoMember(4)]
|
||||||
|
public long CreateTime { get; set; }
|
||||||
|
[ProtoMember(5)]
|
||||||
|
public int MailType { get; set; }
|
||||||
|
[ProtoMember(6)]
|
||||||
|
public int MailState { get; set; }
|
||||||
|
[ProtoMember(7)]
|
||||||
|
public List<AwardInfo> Items = new List<AwardInfo>();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 请求会话列表
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2S_GetConversationsRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
|
{
|
||||||
|
public static C2S_GetConversationsRequest Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2S_GetConversationsRequest>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2S_GetConversationsRequest>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoIgnore]
|
||||||
|
public S2C_GetConversationsResponse ResponseType { get; set; }
|
||||||
|
public uint OpCode() { return OuterOpcode.C2S_GetConversationsRequest; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 请求会话列表响应
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_GetConversationsResponse : AMessage, ICustomRouteResponse, IProto
|
||||||
|
{
|
||||||
|
public static S2C_GetConversationsResponse Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_GetConversationsResponse>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
ErrorCode = default;
|
||||||
|
List.Clear();
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_GetConversationsResponse>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_GetConversationsResponse; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public List<ConversationInfo> List = new List<ConversationInfo>();
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public uint ErrorCode { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 发送邮件消息
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2S_SendMailRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
|
{
|
||||||
|
public static C2S_SendMailRequest Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2S_SendMailRequest>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Target = default;
|
||||||
|
Content = default;
|
||||||
|
Items.Clear();
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2S_SendMailRequest>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoIgnore]
|
||||||
|
public S2C_SendMailResponse ResponseType { get; set; }
|
||||||
|
public uint OpCode() { return OuterOpcode.C2S_SendMailRequest; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long Target { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public string Content { get; set; }
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public List<AwardInfo> Items = new List<AwardInfo>();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 发送邮件消息响应
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_SendMailResponse : AMessage, ICustomRouteResponse, IProto
|
||||||
|
{
|
||||||
|
public static S2C_SendMailResponse Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_SendMailResponse>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
ErrorCode = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_SendMailResponse>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_SendMailResponse; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public uint ErrorCode { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 发送删除会话消息
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2S_DeleteMailRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
|
{
|
||||||
|
public static C2S_DeleteMailRequest Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2S_DeleteMailRequest>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Id = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2S_DeleteMailRequest>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoIgnore]
|
||||||
|
public S2C_DeleteMailResponse ResponseType { get; set; }
|
||||||
|
public uint OpCode() { return OuterOpcode.C2S_DeleteMailRequest; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 发送删除会话消息响应
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_DeleteMailResponse : AMessage, ICustomRouteResponse, IProto
|
||||||
|
{
|
||||||
|
public static S2C_DeleteMailResponse Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_DeleteMailResponse>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
ErrorCode = default;
|
||||||
|
Id = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_DeleteMailResponse>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_DeleteMailResponse; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public uint ErrorCode { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 新邮件推送
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_HaveMail : AMessage, ICustomRouteMessage, IProto
|
||||||
|
{
|
||||||
|
public static S2C_HaveMail Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_HaveMail>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Mail = default;
|
||||||
|
Key = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_HaveMail>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_HaveMail; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public MailInfo Mail { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public string Key { get; set; }
|
||||||
|
}
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_MailState : AMessage, ICustomRouteMessage, IProto
|
||||||
|
{
|
||||||
|
public static S2C_MailState Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_MailState>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
MailState = default;
|
||||||
|
MailId = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_MailState>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_MailState; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public int MailState { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public long MailId { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// /////////// ******** 频道聊天 *******/////////////
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class ChatUserInfo : AMessage, IProto
|
||||||
|
{
|
||||||
|
public static ChatUserInfo Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<ChatUserInfo>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Id = default;
|
||||||
|
Name = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<ChatUserInfo>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public long Name { get; set; }
|
||||||
|
}
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class ChatMessageInfo : AMessage, IProto
|
||||||
|
{
|
||||||
|
public static ChatMessageInfo Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<ChatMessageInfo>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Type = default;
|
||||||
|
Source = default;
|
||||||
|
Trigger = default;
|
||||||
|
Content = default;
|
||||||
|
SendTime = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<ChatMessageInfo>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public int Type { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public long Source { get; set; }
|
||||||
|
[ProtoMember(3)]
|
||||||
|
public ChatUserInfo Trigger { get; set; }
|
||||||
|
[ProtoMember(4)]
|
||||||
|
public string Content { get; set; }
|
||||||
|
[ProtoMember(5)]
|
||||||
|
public long SendTime { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 创建频道
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2S_CreateChannelRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
|
{
|
||||||
|
public static C2S_CreateChannelRequest Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2S_CreateChannelRequest>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Name = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2S_CreateChannelRequest>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoIgnore]
|
||||||
|
public S2C_CreateChannelResponse ResponseType { get; set; }
|
||||||
|
public uint OpCode() { return OuterOpcode.C2S_CreateChannelRequest; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 创建频道响应
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_CreateChannelResponse : AMessage, ICustomRouteResponse, IProto
|
||||||
|
{
|
||||||
|
public static S2C_CreateChannelResponse Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_CreateChannelResponse>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
ErrorCode = default;
|
||||||
|
ChannelId = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_CreateChannelResponse>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_CreateChannelResponse; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long ChannelId { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public uint ErrorCode { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 请求进入频道
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2S_JoinChannelRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
|
{
|
||||||
|
public static C2S_JoinChannelRequest Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2S_JoinChannelRequest>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Target = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2S_JoinChannelRequest>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoIgnore]
|
||||||
|
public S2C_JoinChannelResponse ResponseType { get; set; }
|
||||||
|
public uint OpCode() { return OuterOpcode.C2S_JoinChannelRequest; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public long Target { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 进入频道响应
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_JoinChannelResponse : AMessage, ICustomRouteResponse, IProto
|
||||||
|
{
|
||||||
|
public static S2C_JoinChannelResponse Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_JoinChannelResponse>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
ErrorCode = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_JoinChannelResponse>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_JoinChannelResponse; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public uint ErrorCode { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 发送消息
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class C2S_SendMessageRequest : AMessage, ICustomRouteRequest, IProto
|
||||||
|
{
|
||||||
|
public static C2S_SendMessageRequest Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<C2S_SendMessageRequest>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Message = default;
|
||||||
|
Target = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<C2S_SendMessageRequest>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
[ProtoIgnore]
|
||||||
|
public S2C_SendMessageResponse ResponseType { get; set; }
|
||||||
|
public uint OpCode() { return OuterOpcode.C2S_SendMessageRequest; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public string Message { get; set; }
|
||||||
|
[ProtoMember(2)]
|
||||||
|
public long Target { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 发送消息响应
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_SendMessageResponse : AMessage, ICustomRouteResponse, IProto
|
||||||
|
{
|
||||||
|
public static S2C_SendMessageResponse Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_SendMessageResponse>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
ErrorCode = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_SendMessageResponse>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_SendMessageResponse; }
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public uint ErrorCode { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 推送消息
|
||||||
|
/// </summary>
|
||||||
|
[ProtoContract]
|
||||||
|
public partial class S2C_Message : AMessage, ICustomRouteMessage, IProto
|
||||||
|
{
|
||||||
|
public static S2C_Message Create(Scene scene)
|
||||||
|
{
|
||||||
|
return scene.MessagePoolComponent.Rent<S2C_Message>();
|
||||||
|
}
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Message = default;
|
||||||
|
#if FANTASY_NET || FANTASY_UNITY
|
||||||
|
GetScene().MessagePoolComponent.Return<S2C_Message>(this);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
public uint OpCode() { return OuterOpcode.S2C_Message; }
|
||||||
|
[ProtoIgnore]
|
||||||
|
public int RouteType => Fantasy.RouteType.SocialRoute;
|
||||||
|
[ProtoMember(1)]
|
||||||
|
public ChatMessageInfo Message { get; set; }
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// /////////// ******** 工会 *******/////////////
|
||||||
|
/// </summary>
|
||||||
[ProtoContract]
|
[ProtoContract]
|
||||||
public partial class ClubInfo : AMessage, IProto
|
public partial class ClubInfo : AMessage, IProto
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ using NBC.Network.Interface;
|
|||||||
|
|
||||||
namespace NBF
|
namespace NBF
|
||||||
{
|
{
|
||||||
public class Chat2C_MessageHandler : Message<Chat2C_Message>
|
public class Chat2C_MessageHandler : Message<S2C_Message>
|
||||||
{
|
{
|
||||||
protected override async FTask Run(Session session, Chat2C_Message message)
|
protected override async FTask Run(Session session, S2C_Message message)
|
||||||
{
|
{
|
||||||
Log.Debug($"收到一条消息推送,message={message.Message}");
|
Log.Debug($"收到一条消息推送,message={message.Message}");
|
||||||
var chatTestPanel = App.UI.GetUI<ChatTestPanel>();
|
var chatTestPanel = App.UI.GetUI<ChatTestPanel>();
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ namespace NBF
|
|||||||
|
|
||||||
private async FTask OnSendMessage(string message)
|
private async FTask OnSendMessage(string message)
|
||||||
{
|
{
|
||||||
var messageResponse = (Caht2C_SendMessageResponse)await _session.Call(new C2Chat_SendMessageRequest()
|
var messageResponse = (S2C_SendMessageResponse)await _session.Call(new C2S_SendMessageRequest()
|
||||||
{
|
{
|
||||||
Message = message
|
Message = message
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user