예제 #1
0
        protected override void OnProcessOutputSchema(MutableObject newSchema)
        {
            //var info = new MutableObject {
            //    {"Team", 0}
            //};

            TeamTarget.SetValue(0, newSchema);

            base.OnProcessOutputSchema(newSchema);
        }
예제 #2
0
        public override IEnumerator ReceivePayload(VisualPayload payload)
        {
            if (!SpoofData.GetFirstValue(payload.Data))
            {
                var requestNature = RequestNatureField.GetFirstValue(payload.Data);
                var requestId     = RequestIdField.GetFirstValue(payload.Data);

                var command = new GetPovInfoCommand(requestId);
                var team    = 0;

                if (requestNature == RequestNature.Pov && requestId > 0)
                {
                    var commandIterator = CommandProcessor.Execute(command);
                    while (commandIterator.MoveNext())
                    {
                        yield return(null);
                    }

                    team = command.TeamId;
                }

                //var info = new MutableObject();
                //
                //if ( requestNature == RequestNature.Pov )
                //{
                //    var commandIterator = CommandProcessor.Execute( command );
                //    while ( commandIterator.MoveNext() )
                //        yield return null;

                //    info[ "Team" ] = command.Team;
                //    info[ "CsId" ] = command.CsId;
                //    info[ "File" ] = command.File;
                //    info[ "Submissions" ] = new List< MutableObject > {
                //        new MutableObject {
                //            { "Id", command.Submissions[0].Id },
                //            { "Round", command.Submissions[0].Round },
                //            { "Target", command.Submissions[0].Target },
                //            { "ThrowCount", command.Submissions[0].ThrowCount },
                //        }
                //    };
                //}
                //else
                //{
                //    // These are so incorrect, I have simplified this entire class to just return the requesting team id.
                //
                //    info["Team"] = 8;
                //    info["CsId"] = 0;
                //    info["File"] = "";
                //    info["Submissions"] = new List<MutableObject> {
                //        new MutableObject {
                //            { "Id", 0 },
                //            { "Round", 0 },
                //            { "Target", 0 },
                //            { "ThrowCount", 0 },
                //        }
                //    };
                //}

                //var info = new MutableObject {
                //    {"Team", team}
                //};

                TeamTarget.SetValue(team, payload.Data);
            }
            else
            {
                TeamTarget.SetValue(3, payload.Data);
            }

            var routerIterator = Router.TransmitAll(payload);

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