using System; namespace ET { public class C2M_CabinHarvestHandler: AMActorLocationRpcHandler { protected async override ETTask Run(Unit unit, C2M_CabinHarvest request, M2C_CabinHarvest response, Action reply) { try { Farmland farmland = unit.GetGrandChild(request.FarmlandId); if (farmland == null) { response.Error = ErrorCode.ERR_FarmlandNotFound; } else { response.Error = CabinOperate.CabinHarvest(unit, farmland); reply(); } } catch (Exception e) { response.Message = e.ToString(); response.Error = ErrorCode.ERR_OperateFail; reply(); } await ETTask.CompletedTask; } } }