Beispiel #1
0
        public void CreateMessage()
        {
            MessageTarget_ target = MessageTarget_.Robot;
            MessageType_   type   = MessageType_.CustomMessage;

            Message result = MessageBuilder.CreateMessage(target, type);

            Assert.AreEqual(result.messageTarget, target);
            Assert.AreEqual(result.messageType, type);
        }
        public static Message CreateMessage(int id, MessageTarget_ target, MessageType_ type)
        {
            Message result = new Message
            {
                id            = id,
                messageTarget = target,
                messageType   = type,
            };

            return(result);
        }
    public void AddDummyBot()
    {
        // Debug.Log("Spoofing prereqs...");

        ProtoBufPresentation pp            = new ProtoBufPresentation();
        DummyReceiver        dummyReceiver = new DummyReceiver();

        pp.SetReceiver(dummyReceiver);

        DummyDataLink datalink = new DummyDataLink(pp);

        Communicator com = new Communicator(datalink, pp);

        //create message, set response

        MessageTarget_ target = MessageTarget_.Robot;
        MessageType_   type   = MessageType_.CustomMessage;

        Message DummyMessage = MessageBuilder.CreateMessage(target, type);

        DummyMessage.SetIdentificationResponse("dummyBot");

        /*
         *    First wait for the other identification messages to be processed to prevent race conditions
         */
        if (_ev.WaitOne(10000))
        {
            _ev.Reset();

            _connection           = com;
            _newMessage           = DummyMessage;
            _continueRegistration = true;

            _ev.WaitOne(1000);
        }
    }