using System; namespace ET { public class C2M_CreateConstructHandler:AMActorLocationRpcHandler { protected async override ETTask Run(Unit unit, C2M_CreateConstruct request, M2C_CreateConstruct response, Action reply) { try { var construct = ConstructOperate.CreateConstruct(unit, request.ConfigId, request.X, request.Y,0,request.BuildingId); if (construct == null) { response.Error = ErrorCode.ERR_CreateConstructFail; reply(); return; } response.Error = ErrorCode.ERR_Success; response.Id = construct.Id; reply(); } catch (Exception e) { response.Message = e.ToString(); response.Error = ErrorCode.ERR_CreateConstructFail; reply(); } await ETTask.CompletedTask; } } }