Beispiel #1
0
        void ServeServiceIcon(HttpClient client, HttpRequest request)
        {
            string servicename = request.GetParameter("service");

            IStreamServiceModule service = context.GetModule <StreamModule>().GetService(servicename);

            client.ServeResource(service.ServiceIcon, ".png");
        }
Beispiel #2
0
 /// <summary>
 /// adds a service to the collection
 /// </summary>
 /// <param name="type">type of service</param>
 /// <param name="module">module handling service calls</param>
 public void AddService(string type, IStreamServiceModule module)
 {
     services[type]    = module;
     module.Connected += () => {
         Logger.Info(this, $"{type} connected");
         ServiceConnected?.Invoke(type);
     };
     module.NewFollower += information => {
         Logger.Info(this, $"New follower '{information.Username}' on {type}.");
         if (ValidUser(information.Service, information.Username))
         {
             NewFollower?.Invoke(information);
         }
     };
     module.NewSubscriber += AddSubscriber;
     if (module is IStreamStatsModule)
     {
         ((IStreamStatsModule)module).ViewersChanged += OnViewersChanged;
     }
 }