Example #1
0
        public static void Main(string[] args)
        {
            //Initialize DataManagement
            BGC.IO.DataManagement.Initialize("TASagentBotIRCOnly");

            IWebHost host = WebHost
                            .CreateDefaultBuilder(args)
                            .UseKestrel()
                            .UseUrls("http://0.0.0.0:5000")
                            .UseIISIntegration()
                            .UseStartup <Startup>()
                            .Build();

            host.StartAsync().Wait();

            Core.ICommunication communication = host.Services.GetService(typeof(Core.ICommunication)) as Core.ICommunication;

            BGC.Debug.LogCallback        += communication.SendDebugMessage;
            BGC.Debug.LogWarningCallback += communication.SendWarningMessage;
            BGC.Debug.LogErrorCallback   += communication.SendErrorMessage;

            VerifySetup(
                botConfigContainer: host.Services.GetService(typeof(Core.Config.IBotConfigContainer)) as Core.Config.IBotConfigContainer,
                helixHelper: host.Services.GetService(typeof(Core.API.Twitch.HelixHelper)) as Core.API.Twitch.HelixHelper,
                botTokenValidator: host.Services.GetService(typeof(Core.API.Twitch.IBotTokenValidator)) as Core.API.Twitch.IBotTokenValidator).Wait();

            IRCOnlyApplication application = host.Services.GetService(typeof(IRCOnlyApplication)) as IRCOnlyApplication;

            application.RunAsync().Wait();

            host.StopAsync().Wait();

            host.Dispose();
        }
 public ControllerManager(
     Core.ICommunication communication,
     IHubContext <Web.Hubs.ControllerSpyHub> controllerSpyHub)
 {
     this.communication    = communication;
     this.controllerSpyHub = controllerSpyHub;
 }
        public ChatListener(
            Core.ICommunication communication,
            IButtonPressDispatcher buttonPressDispatcher)
        {
            this.communication         = communication;
            this.buttonPressDispatcher = buttonPressDispatcher;

            communication.ReceiveMessageHandlers += ReceiveMessageHandler;
        }
 public TTTASRedemptionHandler(
     Core.ICommunication communication,
     ITTTASHandler tttasHandler,
     TTTASConfiguration tttasConfig,
     HelixHelper helixHelper)
 {
     this.communication = communication;
     this.tttasHandler  = tttasHandler;
     this.tttasConfig   = tttasConfig;
     this.helixHelper   = helixHelper;
 }
 public TTTASFullHandler(
     Core.ICommunication communication,
     Core.Notifications.FullActivityProvider fullActivityProvider,
     Core.Notifications.IActivityDispatcher activityDispatcher,
     Core.Audio.ISoundEffectSystem soundEffectSystem,
     ITTTASRenderer tttasRenderer,
     TTTASConfiguration tttasConfig)
 {
     this.communication        = communication;
     this.fullActivityProvider = fullActivityProvider;
     this.activityDispatcher   = activityDispatcher;
     this.soundEffectSystem    = soundEffectSystem;
     this.tttasRenderer        = tttasRenderer;
     this.tttasConfig          = tttasConfig;
 }
Example #6
0
        //private readonly Core.API.Twitch.IBroadcasterTokenValidator broadcasterTokenValidator;

        public IRCOnlyApplication(
            Core.ICommunication communication,
            Core.ErrorHandler errorHandler,
            Core.ApplicationManagement applicationManagement,
            Core.IRC.IrcClient ircClient,
            //Core.API.Twitch.IBroadcasterTokenValidator broadcasterTokenValidator,
            Core.API.Twitch.IBotTokenValidator botTokenValidator)
        {
            this.communication         = communication;
            this.errorHandler          = errorHandler;
            this.applicationManagement = applicationManagement;

            this.ircClient         = ircClient;
            this.botTokenValidator = botTokenValidator;
            //this.broadcasterTokenValidator = broadcasterTokenValidator;

            BGC.Debug.ExceptionCallback += errorHandler.LogExternalException;
        }
Example #7
0
 public ChatMessageHandler(
     Core.ICommunication communication)
 {
     this.communication = communication;
 }