2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
[ActorMessageHandler]
|
|
|
|
|
public class C2M_ChargeVoucherHandler : AMActorLocationRpcHandler<Unit,C2M_ChargeVoucher,M2C_ChargeVoucher>
|
|
|
|
|
{
|
|
|
|
|
protected override async ETTask Run(Unit unit, C2M_ChargeVoucher request,M2C_ChargeVoucher response,Action reply)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
string ret = CharacterHelper.ReduceMoney(unit, CharacterHelper.MoneyType.YuanBao, request.YuanBao);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (ret != null)
|
|
|
|
|
{
|
|
|
|
|
response.Message = ret;
|
|
|
|
|
reply();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
CharacterHelper.AddMoney(unit, CharacterHelper.MoneyType.Voucher, request.YuanBao * 2);
|
|
|
|
|
reply();
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|