using System; using System.Collections.Generic; using ETModel; namespace ETHotfix { [MessageHandler(AppType.DB)] public class DBQueryJsonRequestHandler : AMRpcHandler { protected override void Run(Session session, DBQueryJsonRequest message, Action reply) { RunAsync(session, message, reply).NoAwait(); } protected async ETVoid RunAsync(Session session, DBQueryJsonRequest message, Action reply) { DBQueryJsonResponse response = new DBQueryJsonResponse(); try { List components = await Game.Scene.GetComponent().GetJson(message.CollectionName, message.Json); response.Components = components; reply(response); } catch (Exception e) { ReplyError(response, e, reply); } } } }