示例#1
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            foreach (var entry in CsIndex.GetEntries(payload.Data))
            {
                ChallengeSetInfo csInfo;

                if (CsIndex.GetValue(entry) > 0)
                {
                    var csIndex = (uint)CsIndex.GetValue(entry);

                    var csInfoCommand   = new GetCsInfoCommand(csIndex);
                    var commandIterator = CommandProcessor.Execute(csInfoCommand);
                    while (commandIterator.MoveNext())
                    {
                        yield return(null);
                    }

                    csInfo = csInfoCommand.CsInfo;
                }
                else
                {
                    csInfo = DefaultChallengeSetInfo;
                }



                CsInfoTarget.SetValue(CsStatsAdapter.PopulateCsStats(csInfo), entry);
            }
            var iterator = Router.TransmitAll(payload);

            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }
示例#2
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            var csIndex = (uint)CsIndex.GetFirstValue(payload.Data);

            //var csInfoCommand = new getcs

            #region Data query
            var csStatsCommand = new GetCsInfoCommand(csIndex);

            var commandIterator = CommandProcessor.Execute(csStatsCommand);
            while (commandIterator.MoveNext())
            {
                yield return(null);
            }


            CsStatsTarget.SetValue(PopulateCsStats(csStatsCommand.CsInfo), payload.Data);
            #endregion

            #region Use default information

            //CsStatsTarget.SetValue( PopulateCsStats( DefaultChallengeSetStats ), payload.Data );

            #endregion


            var binsetCommand = new GetBinsetCommand(csStatsCommand.CsInfo.Binary);

            commandIterator = CommandProcessor.Execute(binsetCommand);
            while (commandIterator.MoveNext())
            {
                yield return(null);
            }


            var binList = new List <BinaryStats>();

            foreach (var binId in binsetCommand.BinIds)
            {
                var binInfoCommand = new GetBinaryStatsCommand(binId);

                commandIterator = CommandProcessor.Execute(binInfoCommand);
                while (commandIterator.MoveNext())
                {
                    yield return(null);
                }

                binList.Add(binInfoCommand.BinStats);
            }

            BinaryStatsTarget.SetValue(PopulateBinaryStats(
                                           binList), payload.Data);

            var iterator = Router.TransmitAll(payload);
            while (iterator.MoveNext())
            {
                yield return(null);
            }
        }