Esempio n. 1
0
        public ControllerForm()
        {
            InitializeComponent();

            _primaryForwarder   = new UdpForwarder(1234, 1239);
            _secondaryForwarder = new UdpForwarder(1235, 1240);

            _primaryForwarder.OnError = (ex) =>
            {
                Log(null, "Primary forwarder: " + ex);
            };
            _secondaryForwarder.OnError = (ex) =>
            {
                Log(null, "Secondary forwarder: " + ex);
            };

            if (System.IO.File.Exists("ExcludeList.txt"))
            {
                excludeBox.Text = System.IO.File.ReadAllText("ExcludeList.txt");
                excludeBox_TextChanged(this, EventArgs.Empty);
            }

            _random = new Random();

            _grpcServer = new Grpc.Core.Server
            {
                Services = { Jamcast.Controller.BindService(new GrpcServer(this)) },
                Ports    = { new ServerPort("", 8081, ServerCredentials.Insecure) },
            };
            _grpcServer.Start();

            _remoteEndpoints       = new HashSet <EndPoint>();
            _websockets            = new Dictionary <EndPoint, OBSWebsocket>();
            _falconNineIsInStartup = new HashSet <EndPoint>();

            _standbyInput          = null;
            _currentInput          = null;
            _currentInputIsPrimary = false;
            _needsPrepIntoStandby  = true;

            _periodicRemoteClientConfigurationTask = StartThread("Remote Client Config", RemoteClientConfiguration);

            _controllerObs = new OBSWebsocket();
            RegisterWebsocketEvents(_controllerObs);

            Task.Run(Startup);
        }
Esempio n. 2
0
        public ControllerForm()
        {
            InitializeComponent();

            _primaryForwarder   = new UdpForwarder(1234, 1237);
            _secondaryForwarder = new UdpForwarder(1235, 1238);

            _primaryForwarder.OnError = (ex) =>
            {
                Log(null, "Primary forwarder: " + ex);
            };
            _secondaryForwarder.OnError = (ex) =>
            {
                Log(null, "Secondary forwarder: " + ex);
            };

            if (System.IO.File.Exists("ExcludeList.txt"))
            {
                excludeBox.Text = System.IO.File.ReadAllText("ExcludeList.txt");
                excludeBox_TextChanged(this, EventArgs.Empty);
            }

            _random = new Random();

            _remoteEndpoints       = new HashSet <EndPoint>();
            _websockets            = new Dictionary <EndPoint, OBSWebsocket>();
            _listener              = new TcpListener(IPAddress.Any, 8080);
            _listenerTask          = StartThread("TCP Listener", RunListener);
            _falconNineIsInStartup = new HashSet <EndPoint>();

            _standbyInput          = null;
            _currentInput          = null;
            _currentInputIsPrimary = false;
            _needsPrepIntoStandby  = true;

            _periodicRemoteClientConfigurationTask = StartThread("Remote Client Config", RemoteClientConfiguration);

            _controllerObs = new OBSWebsocket();
            RegisterWebsocketEvents(_controllerObs);

            Task.Run(Startup);
        }