修改为luban

This commit is contained in:
Bob.Song
2026-03-05 15:03:45 +08:00
parent 13e4315a70
commit 36067705f2
122 changed files with 10497 additions and 2216 deletions

View File

@@ -1,51 +0,0 @@
using System.Collections.Generic;
using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes;
namespace NB.Chat;
/// <summary>
/// 聊天频道实体
/// </summary>
public class ChatChannel : Entity
{
/// <summary>
/// 频道绑定id
/// </summary>
[BsonElement("cid")] public long ChannelId;
/// <summary>
/// 频道类型 0.地图 1.工会频道
/// </summary>
[BsonElement("type")] public uint ChannelType;
/// <summary>
/// 频道名称
/// </summary>
[BsonElement("name")] public string Name = "";
/// <summary>
/// 频道密码
/// </summary>
[BsonElement("pass")] public string Password = "";
/// <summary>
/// 创建者
/// </summary>
[BsonElement("cr")] public long Creator;
/// <summary>
/// 创建时间
/// </summary>
[BsonElement("ct")] public long CreateTime;
/// <summary>
/// 频道地区 0全球 非0地区 如果是地图频道则表示地图位置
/// </summary>
[BsonElement("region")] public int Region;
/// <summary>
/// 当前频道在线人数
/// </summary>
[BsonIgnore] public readonly HashSet<long> Units = new HashSet<long>();
}

View File

@@ -1,12 +0,0 @@
using System.Collections.Generic;
using Fantasy.Entitas;
namespace NB.Chat;
/// <summary>
/// 聊天频道管理
/// </summary>
public class ChatChannelCenterComponent : Entity
{
public readonly Dictionary<long, ChatChannel> Channels = new Dictionary<long, ChatChannel>();
}

View File

@@ -0,0 +1,14 @@
using Fantasy.Entitas;
namespace NB.Chat;
/// <summary>
/// 聊天中控中心
/// 1、申请、创建、解散聊天频道。
/// 2、管理聊天频道成员。
/// 3、根据频道ID找到对应的频道。
/// </summary>
public class ChatChannelCenterComponent : Entity
{
public readonly Dictionary<long, ChatChannelComponent> Channels = new();
}

View File

@@ -0,0 +1,14 @@
using Fantasy.Entitas;
namespace NB.Chat;
/// <summary>
/// 聊天频道实体
/// 1、根据频道内的玩家进行广播聊天信息。
/// 2、当前频道如果没有玩家的话则自动销毁。
/// 3、存放当前频道的玩家信息。
/// </summary>
public sealed class ChatChannelComponent : Entity
{
public readonly HashSet<long> Units = new HashSet<long>();
}

View File

@@ -0,0 +1,50 @@
namespace NB.Chat;
/// <summary>
/// 聊天频道类型
/// </summary>
[Flags]
public enum ChatChannelType
{
None = 0,
World = 1 << 1, // 世界频道
Private = 1 << 2, // 私聊频道
System = 1 << 3, // 系统频道
Broadcast = 1 << 4, // 广播频道
Notice = 1 << 5, // 公告频道
Team = 1 << 6, // 队伍频道
Near = 1 << 7, // 附近频道
CurrentMap = 1 << 8, // 当前地图频道
// 所有频道
All = World | Private | System | Broadcast | Notice | Team | Near,
// 其他聊天栏显示的频道
Display = World | Private | System | Broadcast | Notice | Team | Near | CurrentMap
}
/// <summary>
/// 聊天节点类型
/// </summary>
public enum ChatNodeType
{
None = 0,
Position = 1, // 位置节点
OpenUI = 2, // 打开UI节点
Link = 3, // 链接节点
Item = 4, // 物品节点
Text = 5, // 文本节点
Image = 6, // 图片节点
}
/// <summary>
/// 聊天节点事件类型
/// </summary>
public enum ChatNodeEvent
{
None = 0,
OpenUI = 1, // 打开UI节点
OpenLink = 2, // 点击链接节点
UseItem = 3, // 使用物品节点
Position = 4, // 位置节点
}

View File

@@ -0,0 +1,17 @@
using System.Runtime.Serialization;
using Fantasy;
using LightProto;
using MongoDB.Bson.Serialization.Attributes;
using Newtonsoft.Json;
namespace Fantasy;
public partial class ChatInfoTree
{
[BsonIgnore]
[JsonIgnore]
[ProtoIgnore]
[IgnoreDataMember]
public Scene Scene { get; set; }
}

View File

@@ -0,0 +1,11 @@
// using Fantasy.Entitas;
//
// namespace NB.Chat;
//
// public class ChatUnit : Entity
// {
// public string UserName;
// public long GateRouteId;
// public readonly Dictionary<long, ChatChannelComponent> Channels = new();
// public readonly Dictionary<int, long> SendTime = new Dictionary<int, long>();
// }