using System; namespace ET { [ActorMessageHandler] public class C2M_GatherResourceHandler: AMActorLocationRpcHandler { protected async override ETTask Run(Unit unit, C2M_GatherResource request, M2C_GatherResource response, Action reply) { try { ResourcePoint rs = unit.GetComponent().GetChild(request.ResPointId); if (rs == null) { response.Error = ErrorCode.ERR_ResourceNotFound; reply(); } var (err, gatherId) = GatherOperate.GatherResource(unit, request.ResPointId,request.ResConfigId, request.PeopleIdList, 0); response.Error = err; response.GatherId = gatherId; reply(); } catch (Exception e) { response.Error = ErrorCode.ERR_OperateFail; response.Message = e.Message; reply(); } await ETTask.CompletedTask; } } }