Esempio n. 1
0
        public StreamingService(BotService bot, RocksmithService rocksmith)
        {
            // Бот
            Bot       = bot;
            Rocksmith = rocksmith;

            // Настройки приложения
            JObject settings = JsonCommon.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "settings.json"));

            contentProviders = new List <ContentProvider>();
            Broadcast        = new Broadcast();

            JToken streamingConfigs = settings["streaming"];

            if (!streamingConfigs.IsNullOrEmpty())
            {
                if (!streamingConfigs["twitch"].IsNullOrEmpty())
                {
                    Twitch = new TwitchConnector(Bot, JsonConvert.DeserializeObject <TwitchConnectorConfig>(streamingConfigs["twitch"].ToString()));
                }
                if (!streamingConfigs["youtube"].IsNullOrEmpty())
                {
                    Youtube = new YoutubeConnector(Bot, JsonConvert.DeserializeObject <YoutubeConnectorConfig>(streamingConfigs["youtube"].ToString()));
                }
            }

            InitProviders((JObject)settings["providers"]);
            InitWidgetsSchemes(settings["scheme"].ToString());
            InitBroadcastHandlers();
        }
Esempio n. 2
0
		public BasicWhisperConnection(TwitchConnector connector, IrcConnection connection, MessageBus bus)
		{
			Verify.NotNull(connector, "connector");
			Verify.NotNull(connection, "connection");
			Verify.NotNull(bus, "bus");
			Connector = connector;
			Connection = connection;
			Connection.ResponseReceived += Connection_ResponseReceived;
			Bus = bus;
		}
Esempio n. 3
0
		public BasicChannel(TwitchConnector connector, IrcConnection connection, MessageBus bus, string channelName)
		{
			Verify.NotNull(connector, "connector");
			Verify.NotNull(connection, "connection");
			Verify.NotNull(bus, "bus");
			Verify.ChannelName(channelName, "channelName");
			ActiveUsers = new ReadOnlyCollection<User>(_activeUsers);
			Connector = connector;
			Connector.Decoder.ChatReceived += Decoder_ChatReceived;
			Connector.Decoder.UserJoinedChannel += Decoder_UserJoinedChannel;
			Connector.Decoder.UserLefthannel += Decoder_UserLefthannel;
			Connection = connection;
			Name = channelName;
			Bus = bus;
		}
Esempio n. 4
0
		public static void Whisper(this User user, TwitchConnector connector, string message)
		{
			Verify.NotNull(connector, "connector");
			Whisper(user, connector.WhisperServer, message);
		}
Esempio n. 5
0
		public BasicProtocolDecoder(TwitchConnector connector)
		{
			Verify.NotNull(connector, "connector");
			Connector = connector;
		}