Esempio n. 1
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            var filename = TraceFilename.GetFirstValue(payload.Data);

            var trace = Trace.LoadFromFile(filename);

            var newExecution = new Execution
            {
                CbAuthor      = CbAuthor.GetFirstValue(payload.Data),
                CbId          = 0,
                ExecutionId   = (uint)ExecutionID.GetFirstValue(payload.Data),
                PovType       = PovType.GetFirstValue(payload.Data),
                RequestId     = (uint)RequestId.GetFirstValue(payload.Data),
                ServiceId     = new ServiceIdentifier(),
                RequestNature = RequestNature.GetFirstValue(payload.Data),
                Success       = Success.GetFirstValue(payload.Data),
                Traces        = new List <Trace> {
                    trace
                }
            };

            var executionMutable = ExecutionAdapter.ExecutionToMutable(
                newExecution,
                IncludeMemory.GetFirstValue(payload.Data),
                PovType.GetFirstValue(payload.Data));

            ExecutionTarget.SetValue(executionMutable, payload.Data);

            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
Esempio n. 2
0
        private IEnumerator UpdateExecutionId(MutableObject mutable)
        {
            BinaryId = new BinaryIdentifier((uint)BinaryIdNumber.GetFirstValue(mutable), "Unknown");

            FoundRequestId = (uint)RequestId.GetFirstValue(mutable);

            var idsId = IdsId.GetFirstValue(mutable);

            if (ServiceId.Id == 0 ||
                BinaryId == null ||
                FoundRequestId == 0)
            {
                FoundExecutionId = 0;

                Debug.LogError("Incomplete selection: binary " + (BinaryId == null ? "null" : ("" + BinaryId)) + ", request " + FoundRequestId);

                yield break;
            }

            var requestNature = RequestNature.GetFirstValue(mutable);

            var executionCommand = new GetExecutionIdCommand(requestNature,
                                                             FoundRequestId, BinaryId.Id, idsId);

            PriorExecutionIdCommand = executionCommand;

            Debug.Log("Executing command " + executionCommand.RelativeUrl);

            var iterator = CommandProcessor.Execute(executionCommand);

            while (iterator.MoveNext())
            {
                yield return(null);
            }

            //Debug.LogFormat( "Execution id is {0}", executionIdCommand.ExecutionId );

            if (!executionCommand.Ok)
            {
                FoundExecutionId = 0;

                yield break;
            }

            CsSuccess = executionCommand.CsSuccess;

            PovType = executionCommand.PovType;

            FoundExecutionId = executionCommand.ExecutionId;
        }
Esempio n. 3
0
 public GetExecutionIdCommand(RequestNature requestNature, uint requestId, uint binaryId, int idsId = -1)
 {
     RequestNature = requestNature;
     RequestId     = requestId;
     BinaryId      = binaryId;
     if (idsId > -1)
     {
         IdsId = (uint)idsId;
     }
     else
     {
         IdsId = null;
     }
 }
Esempio n. 4
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            IEnumerator iterator;

            if (SpoofExecution.GetFirstValue(payload.Data))
            {
                ExecutionTarget.SetValue(SpoofTrace(10000, 1), payload.Data);

                iterator = ParseExecution(payload.VisualData.Bound, payload.Data);
                while (iterator.MoveNext())
                {
                    yield return(null);
                }
            }
            else
            {
                UseCachedResults = false;

                bool isMemoryTrace = IncludeMemtrace.GetFirstValue(payload.Data);

                var execId = ExecutionId.GetFirstValue(payload.Data);
                if (execId < 0)
                {
                    iterator = UpdateExecutionId(payload.Data);
                    while (iterator.MoveNext())
                    {
                        yield return(null);
                    }
                }
                else
                {
                    FoundExecutionId = (uint)execId;
                }

                if (!UseCachedResults)
                {
                    iterator = GetTracesForCurrentSelections(payload.Data);
                    while (iterator.MoveNext())
                    {
                        yield return(null);
                    }
                }

                var execution = new Execution()
                {
                    ServiceId     = ServiceId,
                    CbId          = BinaryId.Id,
                    CbAuthor      = BinaryId.Author,
                    RequestId     = FoundRequestId,
                    RequestNature = RequestNature.GetFirstValue(payload.Data),
                    ExecutionId   = FoundExecutionId,
                    Success       = CsSuccess,
                    Traces        = Traces,
                    PovType       = PovType
                };


                ExecutionTarget.SetValue(ExecutionToMutable(execution, isMemoryTrace, PovType), payload.Data);

                iterator = ParseExecution(payload.VisualData.Bound, payload.Data);
                while (iterator.MoveNext())
                {
                    yield return(null);
                }
            }
        }