using System; namespace ET { [ActorMessageHandler] public class C2M_GetSynthesisHandler: AMActorLocationRpcHandler { protected async override ETTask Run(Unit unit, C2M_GetSynthesis request, M2C_GetSynthesis response, Action reply) { try { var sc = unit.GetOrAddComponent(); foreach (var v in sc.Children.Values) { response.SynthesisList.Add(((Synthesis)v).ToMessage()); } response.Error = ErrorCode.ERR_Success; reply(); } catch (Exception e) { response.Message = e.ToString(); response.Error = ErrorCode.ERR_GetStoreFail; reply(); } await ETTask.CompletedTask; } } }