You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
927 B
31 lines
927 B
3 years ago
|
using System;
|
||
|
|
||
|
namespace ET
|
||
|
{
|
||
|
|
||
|
[ActorMessageHandler]
|
||
|
public class C2M_GetSynthesisHandler: AMActorLocationRpcHandler<Unit, C2M_GetSynthesis, M2C_GetSynthesis>
|
||
|
{
|
||
|
protected async override ETTask Run(Unit unit, C2M_GetSynthesis request, M2C_GetSynthesis response, Action reply)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
var sc = unit.GetOrAddComponent<SynthesisComponent>();
|
||
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|