频道聊天相关
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class ChatComponent : Entity
|
||||
{
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
namespace NB.Chat;
|
||||
|
||||
[Serializable]
|
||||
public abstract class ChatContentData
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ChatContentNormal : ChatContentData
|
||||
{
|
||||
public string Content = "";
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ChatContentFished : ChatContentData
|
||||
{
|
||||
public long Id;
|
||||
public int Weight;
|
||||
public int Type;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ChatContentRecord : ChatContentData
|
||||
{
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
@@ -8,6 +8,11 @@ namespace NB.Chat;
|
||||
/// </summary>
|
||||
public class ChatChannel : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 频道短id
|
||||
/// </summary>
|
||||
[BsonElement("cid")] public uint ChannelId;
|
||||
|
||||
/// <summary>
|
||||
/// 频道类型 0.地图 1.公开 2.私密
|
||||
/// </summary>
|
||||
@@ -37,9 +42,9 @@ public class ChatChannel : Entity
|
||||
/// 频道地区 0,全球 非0地区 如果是地图频道则表示地图位置
|
||||
/// </summary>
|
||||
[BsonElement("region")] public int Region;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 当前频道在线人数
|
||||
/// </summary>
|
||||
[BsonElement("ids")] public readonly HashSet<long> Units = new HashSet<long>();
|
||||
[BsonIgnore] public readonly HashSet<long> Units = new HashSet<long>();
|
||||
}
|
||||
@@ -6,9 +6,19 @@ namespace NB.Chat;
|
||||
public sealed class ChatUnit : Entity
|
||||
{
|
||||
public long GateRouteId;
|
||||
|
||||
|
||||
public RoleSimpleInfo Role;
|
||||
|
||||
/// <summary>
|
||||
/// 当前所在地图
|
||||
/// </summary>
|
||||
public long MapId;
|
||||
|
||||
/// <summary>
|
||||
/// 当前频道
|
||||
/// </summary>
|
||||
public long CurrentChannel;
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
if (IsDisposed)
|
||||
8
Entity/Club/Club.cs
Normal file
8
Entity/Club/Club.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Club;
|
||||
|
||||
public class Club : Entity
|
||||
{
|
||||
|
||||
}
|
||||
@@ -28,7 +28,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Club\" />
|
||||
<Folder Include="Map\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -287,6 +287,49 @@ namespace Fantasy
|
||||
[ProtoMember(2)]
|
||||
public long MailId { get; set; }
|
||||
}
|
||||
[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>
|
||||
@@ -362,4 +405,24 @@ namespace Fantasy
|
||||
[ProtoMember(1)]
|
||||
public ChatMessageInfo Message { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2G_LoginRequest1 : AMessage, IRequest, IProto
|
||||
{
|
||||
public static C2G_LoginRequest1 Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2G_LoginRequest1>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ToKen = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2G_LoginRequest1>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public G2C_LoginResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2G_LoginRequest1; }
|
||||
[ProtoMember(1)]
|
||||
public string ToKen { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,11 @@ namespace Fantasy
|
||||
public const uint Game2C_GetMailsResponse = 2415929106;
|
||||
public const uint Game2C_HaveMail = 2147493649;
|
||||
public const uint Game2C_MailState = 2147493650;
|
||||
public const uint C2Chat_SendMessageRequest = 2281711379;
|
||||
public const uint Caht2C_SendMessageResponse = 2415929107;
|
||||
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 Chat2C_Message = 2147493651;
|
||||
public const uint C2G_LoginRequest1 = 268445459;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,9 @@ public class ErrorCode
|
||||
/// 登录自动注册没有设置地区
|
||||
/// </summary>
|
||||
public const uint RegisterNotRegion = 11011;
|
||||
|
||||
/// <summary>
|
||||
/// 聊天频道不存在
|
||||
/// </summary>
|
||||
public const uint ChatNotChannel = 12011;
|
||||
}
|
||||
Reference in New Issue
Block a user