Exemple #1
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);
            }
        }
Exemple #2
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            BinaryStatsTarget.SetValue(PopulateBinaryStats(new List <BinaryStats>()
            {
                DefaultBinaryStats
            }), newSchema);
            CsStatsTarget.SetValue(PopulateCsStats(DefaultChallengeSetStats), newSchema);
            //LocalBinaryIndexTarget.SetValue( (int)0, newSchema );

            Router.TransmitAllSchema(newSchema);
        }