コード例 #1
0
ファイル: TwitchHub.cs プロジェクト: ooblies/twitcherator
        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);
        }