Пример #1
0
        public JoinMessageService(
            ILogger logger,
            IResponder responder,
            ISession session,
            ModuleConfiguration configuration,
            IGeolocationService geolocationService,
            IIrcClient client,
            IBlockMonitoringService blockMonitoringService)
        {
            this.logger                 = logger;
            this.responder              = responder;
            this.session                = session;
            this.configuration          = configuration.JoinMessageRateLimits;
            this.geolocationService     = geolocationService;
            this.client                 = client;
            this.blockMonitoringService = blockMonitoringService;

            this.blockMonitoringService.JoinMessageService = this;
        }
Пример #2
0
 public BlockMonitorConfigurationCommand(
     string commandSource,
     IUser user,
     IList <string> arguments,
     ILogger logger,
     IFlagService flagService,
     IConfigurationProvider configurationProvider,
     IIrcClient client,
     IBlockMonitoringService blockMonitoringService,
     ISession databaseSession,
     IResponder responder) : base(
         commandSource,
         user,
         arguments,
         logger,
         flagService,
         configurationProvider,
         client)
 {
     this.blockMonitoringService = blockMonitoringService;
     this.databaseSession        = databaseSession;
     this.responder = responder;
 }
Пример #3
0
        /// <summary>
        /// The initialise bot.
        /// </summary>
        private static void InitialiseBot()
        {
            dbal = container.Resolve<ILegacyDatabase>();

            if (!dbal.Connect())
            {
                // can't Connect to database, DIE
                return;
            }

            LegacyConfig.Singleton();

            var configurationHelper = container.Resolve<IConfigurationHelper>();

            INetworkClient networkClient;
            if (configurationHelper.IrcConfiguration.Ssl)
            {
                networkClient = new SslNetworkClient(
                    configurationHelper.IrcConfiguration.Hostname,
                    configurationHelper.IrcConfiguration.Port,
                    container.Resolve<ILogger>().CreateChildLogger("NetworkClient"));
            }
            else
            {
                networkClient = new NetworkClient(
                    configurationHelper.IrcConfiguration.Hostname,
                    configurationHelper.IrcConfiguration.Port,
                    container.Resolve<ILogger>().CreateChildLogger("NetworkClient"));
            }

            newIrc =
                new IrcClient(
                    networkClient,
                    container.Resolve<ILogger>().CreateChildLogger("IrcClient"),
                    configurationHelper.IrcConfiguration,
                    configurationHelper.PrivateConfiguration.IrcPassword);

            JoinChannels();

            // TODO: remove me!
            container.Register(Component.For<IIrcClient>().Instance(newIrc));

            joinMessageService = container.Resolve<IJoinMessageService>();
            blockMonitoringService = container.Resolve<IBlockMonitoringService>();

            SetupEvents();

            // initialise the deferred installers.
            container.Install(FromAssembly.This(new DeferredWindsorBootstrap()));
        }