大修改
This commit is contained in:
24
Hotfix/Social/Handler/C2S_GetOfflineMessageRequestHandler.cs
Normal file
24
Hotfix/Social/Handler/C2S_GetOfflineMessageRequestHandler.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class
|
||||
C2S_GetOfflineMessageRequestHandler : RouteRPC<SocialUnit, C2S_GetOfflineMessageRequest,
|
||||
S2C_GetOfflineMessageResponse>
|
||||
{
|
||||
protected override async FTask Run(SocialUnit entity, C2S_GetOfflineMessageRequest request,
|
||||
S2C_GetOfflineMessageResponse response,
|
||||
Action reply)
|
||||
{
|
||||
var chatUnitManage = entity.Scene.GetComponent<SocialUnitManageComponent>();
|
||||
if (chatUnitManage.NotSendMessage.TryGetValue(entity.Id, out var list))
|
||||
{
|
||||
response.Message.AddRange(list);
|
||||
chatUnitManage.NotSendMessage.RemoveByKey(entity.Id);
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user