Files
Fishing2Server/Hotfix/Game/Mail/Handler/Outer/C2Mail_ReceiveMailRequestHandler.cs
2026-03-19 16:14:33 +08:00

22 lines
651 B
C#

using Fantasy.Async;
using Fantasy.Network.Interface;
using NB;
using NB.Game;
using NBF;
namespace Fantasy;
public class C2Mail_ReceiveMailRequestHandler : AddressRPC<Player, C2Mail_ReceiveMailRequest, Mail2C_ReceiveMailResponse>
{
protected override async FTask Run(Player mailUnit, C2Mail_ReceiveMailRequest request, Mail2C_ReceiveMailResponse response, Action reply)
{
if (request.MailId <= 0)
{
response.ErrorCode = 100;
return;
}
response.ErrorCode = await mailUnit.GetComponent<MailComponent>()
.Receive(request.MailId, request.Money, request.ItemId, true);
}
}