频道聊天相关

This commit is contained in:
2025-08-12 14:05:23 +08:00
parent 12c328d538
commit 15723850c0
17 changed files with 212 additions and 66 deletions

View File

@@ -1,7 +0,0 @@
using Fantasy.Entitas;
namespace NB.Chat;
public class ChatComponent : Entity
{
}

View File

@@ -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
{
}

View File

@@ -1,4 +0,0 @@
using Fantasy.Entitas;
namespace NB.Chat;

View File

@@ -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>();
}

View File

@@ -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)