聊天频道

This commit is contained in:
2025-08-08 09:12:30 +08:00
parent 3c39f4a3c9
commit 3fb2c6a7d3
595 changed files with 63 additions and 12 deletions

View File

@@ -9,4 +9,47 @@ using NBC.Serialize;
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;
Trigger = default;
Content.Clear();
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<ChatMessageInfo>(this);
#endif
}
[ProtoMember(1)]
public int Type { get; set; }
[ProtoMember(2)]
public ChatUserInfo Trigger { get; set; }
[ProtoMember(3)]
public List<string> Content = new List<string>();
}
}

View File

@@ -291,7 +291,9 @@ namespace NBC
}
public override void Dispose()
{
Type = default;
Message = default;
Target = default;
#if FANTASY_NET || FANTASY_UNITY
GetScene().MessagePoolComponent.Return<C2Chat_SendMessageRequest>(this);
#endif
@@ -302,7 +304,11 @@ namespace NBC
[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>
/// 发送聊天响应
@@ -346,6 +352,6 @@ namespace NBC
[ProtoIgnore]
public int RouteType => Fantasy.RouteType.ChatRoute;
[ProtoMember(1)]
public string Message { get; set; }
public ChatMessageInfo Message { get; set; }
}
}

View File

@@ -1,9 +1,8 @@
fileFormatVersion: 2
guid: 9194a5b74ff9c1e45b6c20994dea20c6
guid: 14648aea12f348aea0f8a0d9348230f2
folderAsset: yes
timeCreated: 1446193142
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More