2021-04-08 20:09:59 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Net;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
[ActorMessageHandler]
|
|
|
|
|
public class C2M_AddMapCoinCountHandler : AMActorLocationRpcHandler<Unit, C2M_AddMapCoinCount, M2C_AddMapCoinCount>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
protected override async ETTask Run(Unit unit, C2M_AddMapCoinCount request, M2C_AddMapCoinCount response, Action reply)
|
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
string ret = CharacterHelper.ReduceMoney(unit, CharacterHelper.MoneyType.Voucher, ConstDefine.AddMapCointPrice);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (ret != null)
|
|
|
|
|
{
|
|
|
|
|
response.Message = ret;
|
|
|
|
|
reply();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
PlayerData data = unit.GetComponent<PlayerData>();
|
|
|
|
|
data.mapCoinCount++;
|
2021-06-29 11:28:15 +08:00
|
|
|
|
UnitHelper.SaveComponenet(data);
|
2021-04-08 20:09:59 +08:00
|
|
|
|
reply();
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|