示例#1
0
        public Broadcaster()
        {
            _hubContext   = GlobalHost.ConnectionManager.GetHubContext <TwitchHub>();
            _model        = new TwitcheratorMessage();
            _twitcherator = new Twitcherator();
            _modelUpdated = false;

            _breadcastLoop = new Timer(
                BroadcastObject,
                null,
                BroadcastInterval,
                BroadcastInterval);
        }
示例#2
0
        public bool GetMessage(TwitcheratorMessage oldMsg, out TwitcheratorMessage newMsg)
        {
            _oldMessage = oldMsg;
            TwitcheratorMessage msg = new TwitcheratorMessage
            {
                Followers   = GetFollowers(),
                Subscribers = GetSubscribers(),
                Viewers     = GetViewers(),
                BitsInLast5 = GetBits(),
            };

            msg.Increment = GetIncrement(msg.Viewers, msg.Followers, msg.Subscribers);

            newMsg = msg;

            return(true);// !oldMsg.Equals(newMsg);
        }