新增私聊相关
This commit is contained in:
@@ -4,7 +4,7 @@ using Fantasy.Helper;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoDB.Bson.Serialization.Options;
|
||||
|
||||
namespace NB.Game;
|
||||
namespace NB.Chat;
|
||||
|
||||
/// <summary>
|
||||
/// 玩家邮件组件
|
||||
|
||||
19
Entity/Social/Mail/Components/MailManageComponent.cs
Normal file
19
Entity/Social/Mail/Components/MailManageComponent.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件管理组件
|
||||
/// </summary>
|
||||
public class MailManageComponent : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 会话列表
|
||||
/// </summary>
|
||||
public Dictionary<string, MailConversation> Conversations = new Dictionary<string, MailConversation>();
|
||||
|
||||
/// <summary>
|
||||
/// 缓存了的列表
|
||||
/// </summary>
|
||||
public HashSet<long> CacheRoleIds = new HashSet<long>();
|
||||
}
|
||||
@@ -1,46 +1,48 @@
|
||||
using Fantasy.Entitas;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using NB.Game;
|
||||
|
||||
namespace NB.Game;
|
||||
namespace NB.Chat;
|
||||
|
||||
public sealed class Mail : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 邮件发送者
|
||||
/// </summary>
|
||||
[BsonElement("send")] public long Sender;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件拥有者
|
||||
/// </summary>
|
||||
public long OwnerId;
|
||||
[BsonElement("owner")] public long OwnerId;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件状态
|
||||
/// </summary>
|
||||
public MailState State = MailState.None;
|
||||
[BsonElement("state")] public MailState State = MailState.None;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件状态
|
||||
/// </summary>
|
||||
public MailType MailType = MailType.None;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件标题
|
||||
/// </summary>
|
||||
public string Title;
|
||||
[BsonElement("type")] public MailType MailType = MailType.None;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件内容
|
||||
/// </summary>
|
||||
public string Content;
|
||||
[BsonElement("con")] public string Content;
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public long CreateTime;
|
||||
[BsonElement("ct")] public long CreateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public long ExpireTime;
|
||||
[BsonElement("et")] public long ExpireTime;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件的附件内容
|
||||
/// </summary>
|
||||
public List<AwardItem> Items = new List<AwardItem>();
|
||||
[BsonElement("item")] public List<AwardItem> Items = new List<AwardItem>();
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace NB.Game;
|
||||
namespace NB.Chat;
|
||||
|
||||
/// <summary>
|
||||
/// 邮件箱,系统群发用
|
||||
/// </summary>
|
||||
public class MailBox : Entity
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
57
Entity/Social/Mail/Entity/MailConversation.cs
Normal file
57
Entity/Social/Mail/Entity/MailConversation.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Fantasy.Entitas;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class MailConversation : Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// 第一id
|
||||
/// </summary>
|
||||
[BsonElement("id1")] public long FirstId;
|
||||
|
||||
/// <summary>
|
||||
/// 第二id
|
||||
/// </summary>
|
||||
[BsonElement("id2")] public long SecondId;
|
||||
|
||||
/// <summary>
|
||||
/// 会话
|
||||
/// </summary>
|
||||
[BsonElement("list")] public List<Mail> Mails = new List<Mail>();
|
||||
|
||||
/// <summary>
|
||||
/// 第一个阅读时间
|
||||
/// </summary>
|
||||
[BsonElement("ft")] public long FirstReadTime;
|
||||
|
||||
/// <summary>
|
||||
/// 第二阅读时间
|
||||
/// </summary>
|
||||
[BsonElement("st")] public long SecondReadTime;
|
||||
|
||||
/// <summary>
|
||||
/// 最后更新时间
|
||||
/// </summary>
|
||||
[BsonElement("ut")] public long UpdateTime;
|
||||
|
||||
/// <summary>
|
||||
/// 删除人标志
|
||||
/// </summary>
|
||||
[BsonElement("rid")] public HashSet<long> RemoveId = new HashSet<long>();
|
||||
|
||||
/// <summary>
|
||||
/// 会话key,id-id,按大小排序
|
||||
/// </summary>
|
||||
[BsonIgnore] public string Key = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 最后保存时间
|
||||
/// </summary>
|
||||
[BsonIgnore] public long NeedSaveTime = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 需要保存
|
||||
/// </summary>
|
||||
[BsonIgnore] public bool NeedSave;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace NB.Game;
|
||||
namespace NB.Chat;
|
||||
|
||||
public enum MailType
|
||||
{
|
||||
|
||||
@@ -8,8 +8,9 @@ public class SocialUnitManageComponent : Entity
|
||||
{
|
||||
public readonly Dictionary<long, SocialUnit> Units = new();
|
||||
|
||||
/// <summary>
|
||||
/// 不在线消息缓存
|
||||
/// </summary>
|
||||
public readonly OneToManyList<long, ChatMessageInfo> NotSendMessage = new();
|
||||
// public List<MailBox>
|
||||
// /// <summary>
|
||||
// /// 不在线消息缓存
|
||||
// /// </summary>
|
||||
// public readonly OneToManyList<long, ChatMessageInfo> NotSendMessage = new();
|
||||
}
|
||||
Reference in New Issue
Block a user