Example #1
0
        public void OnEntityQueryResponse(EntityQueryResponseOp op)
        {
            EntityQueryRequest request = requestIdToEntityQueryRequest[op.RequestId.Id];

            requestIdToEntityQueryRequest.Remove(op.RequestId.Id);

            var result = new Dictionary <long, Worker.Entity>();

            foreach (var pair in op.Result)
            {
                result.Add(pair.Key.Id, pair.Value);
            }

            Entity entity;

            if (!TryGetEntityFromEntityId(request.SenderEntityId, "EntityQuery", out entity))
            {
                return;
            }

            var response =
                new EntityQueryResponse((CommandStatusCode)op.StatusCode, op.Message, op.ResultCount, result, request);

            view.AddCommandResponse(entity, response, entityQueryResponsePool);
        }
Example #2
0
 internal EntityQueryResponse(CommandStatusCode statusCode, string message, int resultCount,
                              Dictionary <long, Worker.Entity> result, EntityQueryRequest req)
 {
     StatusCode  = statusCode;
     Message     = message;
     ResultCount = resultCount;
     Result      = result;
     RawRequest  = req;
 }