24 lines
756 B
C#
24 lines
756 B
C#
using Fantasy;
|
|
using Fantasy.Async;
|
|
using Fantasy.Network.Interface;
|
|
|
|
namespace NB.Chat;
|
|
|
|
public class
|
|
C2Chat_GetOfflineMessageRequestHandler : RouteRPC<ChatUnit, C2Chat_GetOfflineMessageRequest,
|
|
Caht2C_GetOfflineMessageResponse>
|
|
{
|
|
protected override async FTask Run(ChatUnit entity, C2Chat_GetOfflineMessageRequest request,
|
|
Caht2C_GetOfflineMessageResponse response,
|
|
Action reply)
|
|
{
|
|
var chatUnitManage = entity.Scene.GetComponent<ChatUnitManageComponent>();
|
|
if (chatUnitManage.NotSendMessage.TryGetValue(entity.Id, out var list))
|
|
{
|
|
response.Message.AddRange(list);
|
|
chatUnitManage.NotSendMessage.RemoveByKey(entity.Id);
|
|
}
|
|
|
|
await FTask.CompletedTask;
|
|
}
|
|
} |