using System; using ETModel; namespace ETHotfix { [MessageHandler(AppType.DB)] public class DBQueryRequestHandler : AMRpcHandler { protected override void Run(Session session, DBQueryRequest message, Action reply) { RunAsync(session, message, reply).NoAwait(); } protected async ETVoid RunAsync(Session session, DBQueryRequest message, Action reply) { DBQueryResponse response = new DBQueryResponse(); try { ComponentWithId component = await Game.Scene.GetComponent().Get(message.CollectionName, message.Id); response.Component = component; reply(response); } catch (Exception e) { ReplyError(response, e, reply); } } } }