public void OnCommandResponseSecondCommand(CommandResponseOp <global::Improbable.Gdk.Tests.BlittableTypes.BlittableComponent.Commands.SecondCommand> op) { var requestId = op.RequestId.Id; RequestContext requestContext; if (!RequestIdToRequestContext.TryGetValue(requestId, out requestContext)) { LogDispatcher.HandleLog(LogType.Error, new LogEvent("Entity not found during OnCommandResponse.") .WithField(LoggingUtils.LoggerName, LoggerName) .WithField(LoggingUtils.EntityId, op.EntityId.Id) .WithField(MutableView.Component, "SpatialOSBlittableComponent")); return; } RequestIdToRequestContext.Remove(requestId); Unity.Entities.Entity entity; if (requestContext.EntityId == MutableView.WorkerEntityId) { entity = view.WorkerEntity; } else if (!view.TryGetEntity(requestContext.EntityId, out entity)) { return; } var unityResponsePayload = op.Response.HasValue ? global::Generated.Improbable.Gdk.Tests.BlittableTypes.SecondCommandResponse.ToNative(op.Response.Value.Get().Value) : (global::Generated.Improbable.Gdk.Tests.BlittableTypes.SecondCommandResponse?)null; var outgoingRequest = (SecondCommand.OutgoingRequest)requestContext.Request; var response = new SecondCommand.Response(op.EntityId.Id, op.Message, (CommandStatusCode)op.StatusCode, unityResponsePayload, outgoingRequest.RawRequest); view.AddCommandResponse(entity, response, SecondCommandResponsePool); }
public void AddResponse(SecondCommand.Response response) { responseStorage.Add(response); }