Example #1
0
 //private readonly ILog _logger = LogManager.GetLogger("Runtime");
 /// <summary>
 /// Create the Runtime object to combine all the various components of the livetiming.
 /// </summary>
 /// <param name="liveStream">A stream used to represent the incoming data of the live stream.</param>
 /// <param name="authKeyService">Provider for authorization key requests.</param>
 /// <param name="keyFrameService">Provider for keyframes.</param>
 /// <param name="messageDispatch">A receiver for messages.</param>
 public Runtime(Stream liveStream, IAuthKey authKeyService, IKeyFrame keyFrameService, IMessageDispatch messageDispatch)
 {
     _decryptor = new DataDecryptor();
     _packetReader = new PacketReader(liveStream, new DecryptStreamDecorator(liveStream, _decryptor));
     _messageDispatch = messageDispatch;
     _authKeyService = authKeyService;
     _keyFrameService = keyFrameService;
 }
Example #2
0
        //private readonly ILog _logger = LogManager.GetLogger("Runtime");


        /// <summary>
        /// Create the Runtime object to combine all the various components of the livetiming.
        /// </summary>
        /// <param name="liveStream">A stream used to represent the incoming data of the live stream.</param>
        /// <param name="authKeyService">Provider for authorization key requests.</param>
        /// <param name="keyFrameService">Provider for keyframes.</param>
        /// <param name="messageDispatch">A receiver for messages.</param>
        public Runtime(Stream liveStream, IAuthKey authKeyService, IKeyFrame keyFrameService, IMessageDispatch messageDispatch)
        {
            _decryptor       = new DataDecryptor();
            _packetReader    = new PacketReader(liveStream, new DecryptStreamDecorator(liveStream, _decryptor));
            _messageDispatch = messageDispatch;
            _authKeyService  = authKeyService;
            _keyFrameService = keyFrameService;
        }
Example #3
0
        private void DoTests(IAuthKey authKey)
        {
            {
                const string session = "6630"; // 0xF3C3476F

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xF3C3476F, key);
            }

            {
                const string session = "6629"; // 0xE5BCF17C

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xE5BCF17C, key);
            }

            {
                const string session = "6628"; // 0xcf0a3056

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xcf0a3056, key);
            }

            {
                const string session = "6632"; // 0xdc8af5ee

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xdc8af5ee, key);
            }


            {
                const string session = "6708"; // 0xdc8af5ee

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xdc8af5ee, key);
            }

            {
                const string session = "_040109"; // 0xcf0a3056

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0, key);
            }
        }
Example #4
0
        private void InitRuntime()
        {
            //_log.Info("Connecting to live stream....");
            try
            {
                IAuthKey authKeyService = Login(_username, _password);

                IKeyFrame keyFrameService = new KeyFrame();

                _handler = new MessageDispatcherImpl(this);

                MemoryStream memStream = new MemoryStream(MEMSTREAM_SIZE);

                _runtime = new Runtime.Runtime(memStream, authKeyService, keyFrameService, _handler);

                //  Create network component that drives the Runtime with data.
                CreateDriver(keyFrameService, memStream);
            }
            catch (AuthorizationException)
            {
                DoDispatchMessage(new F1.Messages.Control.AuthorizationProblem());
                Stop(true);
            }
        }
        private void DoTests(IAuthKey authKey)
        {
            {
                const string session = "6630"; // 0xF3C3476F

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xF3C3476F, key);
            }

            {
                const string session = "6629"; // 0xE5BCF17C

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xE5BCF17C, key);
            }

            {
                const string session = "6628"; // 0xcf0a3056

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xcf0a3056, key);
            }

            {
                const string session = "6632"; // 0xdc8af5ee

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xdc8af5ee, key);
            }

            {
                const string session = "6708"; // 0xdc8af5ee

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0xdc8af5ee, key);
            }

            {
                const string session = "_040109"; // 0xcf0a3056

                uint key = authKey.GetKey(session);

                Assert.AreNotEqual(AuthorizationKey.INVALID_KEY, key);
                Assert.AreEqual((uint)0, key);
            }
        }