Beispiel #1
0
        public async Task <Result> Connect()
        {
            this.IsConnected = false;

            await this.OBSCommandTimeoutWrapper((cancellationToken) =>
            {
                this.OBSWebsocket.Disconnected -= OBSWebsocket_Disconnected;
                this.OBSWebsocket.Connect(ChannelSession.Settings.OBSStudioServerIP, ChannelSession.Settings.OBSStudioServerPassword);
                if (this.OBSWebsocket.IsConnected)
                {
                    this.OBSWebsocket.Disconnected += OBSWebsocket_Disconnected;
                    this.IsConnected = true;
                    return(true);
                }
                return(false);
            }, ConnectTimeoutInMilliseconds);

            if (this.IsConnected)
            {
                await this.StartReplayBuffer();

                this.Connected(this, new EventArgs());
                ChannelSession.ReconnectionOccurred("OBS");
                ChannelSession.Services.Telemetry.TrackService("OBS Studio");
                return(new Result());
            }
            return(new Result(Resources.OBSWebSocketFailed));
        }
Beispiel #2
0
        public async Task <Result> Connect()
        {
            this.IsConnected = false;

            try
            {
                if (await this.TestConnection())
                {
                    await this.StartReplayBuffer();

                    this.Connected(this, new EventArgs());
                    ChannelSession.ReconnectionOccurred("Streamlabs OBS");
                    this.IsConnected = true;
                    ChannelSession.Services.Telemetry.TrackService("Streamlabs OBS");
                    return(new Result());
                }
            }
            catch (UnauthorizedAccessException)
            {
                if (!ChannelSession.IsElevated)
                {
                    return(new Result(Resources.StreamlabsOBSAdminMaybe));
                }
            }
            return(new Result(Resources.StreamlabsOBSFailed));
        }
Beispiel #3
0
        public async Task <Result> Connect()
        {
            this.IsConnected = false;

            try
            {
                if (await this.TestConnection())
                {
                    await this.StartReplayBuffer();

                    this.Connected(this, new EventArgs());
                    ChannelSession.ReconnectionOccurred("Streamlabs OBS");
                    this.IsConnected = true;
                    ChannelSession.Services.Telemetry.TrackService("Streamlabs OBS");
                    return(new Result());
                }
            }
            catch (UnauthorizedAccessException)
            {
                if (!ChannelSession.IsElevated)
                {
                    return(new Result("Streamlabs OBS might be running as administrator and Mix It Up is not. Try running Mix It Up as an Administrator before connecting."));
                }
            }
            return(new Result("Streamlabs OBS could not be reached."));
        }
        private async void SignalRConnection_Connected(object sender, EventArgs e)
        {
            ChannelSession.ReconnectionOccurred(MixItUp.Base.Resources.WebhookEvents);

            var twitchUserOAuthToken = ChannelSession.TwitchUserConnection.Connection.GetOAuthTokenCopy();

            await this.Authenticate(twitchUserOAuthToken?.accessToken);
        }
Beispiel #5
0
        private async void InteractiveClient_OnDisconnectOccurred(object sender, WebSocketCloseStatus e)
        {
            ChannelSession.DisconnectionOccurred("Interactive");

            do
            {
                await Task.Delay(2500);
            }while (!await this.Connect(this.Game, this.Version));

            ChannelSession.ReconnectionOccurred("Interactive");
        }
        private async void BotClient_OnDisconnectOccurred(object sender, WebSocketCloseStatus e)
        {
            ChannelSession.DisconnectionOccurred("Bot Chat");

            do
            {
                await Task.Delay(2500);
            }while (!await this.ConnectBot());

            ChannelSession.ReconnectionOccurred("Bot Chat");
        }
        private async void Socket_OnDisconnected(object sender, EventArgs e)
        {
            ChannelSession.DisconnectionOccurred("Streamlabs");

            do
            {
                await Task.Delay(5000);
            }while (!await this.ConnectSocket());

            ChannelSession.ReconnectionOccurred("Streamlabs");
        }
Beispiel #8
0
        private async void ConstellationClient_OnDisconnectOccurred(object sender, WebSocketCloseStatus e)
        {
            ChannelSession.DisconnectionOccurred("Constellation");

            do
            {
                await this.Disconnect();

                await Task.Delay(2000);
            } while (!await this.Connect());

            ChannelSession.ReconnectionOccurred("Constellation");
        }
        private async void StreamerClient_OnDisconnectOccurred(object sender, WebSocketCloseStatus e)
        {
            ChannelSession.DisconnectionOccurred("Streamer Chat");

            // Force background tasks to stop before reconnecting
            this.backgroundThreadCancellationTokenSource.Cancel();

            do
            {
                await Task.Delay(2500);
            }while (!await this.Connect());

            ChannelSession.ReconnectionOccurred("Streamer Chat");
        }
        private async void InteractiveClient_OnDisconnectOccurred(object sender, WebSocketCloseStatus e)
        {
            ChannelSession.DisconnectionOccurred("Interactive");

            InteractiveGameListingModel game = ChannelSession.Interactive.Client.InteractiveGame;

            do
            {
                await this.Disconnect();

                await Task.Delay(2000);
            } while (!await this.Connect(game));

            ChannelSession.ReconnectionOccurred("Interactive");
        }
Beispiel #11
0
        private async void XSplitServer_Disconnected(object sender, System.EventArgs e)
        {
            await this.Dispatcher.Invoke <Task>(async() =>
            {
                ChannelSession.DisconnectionOccurred("XSplit");

                do
                {
                    await this.DisconnectXSplitService();

                    await Task.Delay(2000);
                } while (!await this.ConnectXSplitService());

                ChannelSession.ReconnectionOccurred("XSplit");
            });
        }
        private async void PubSub_OnDisconnectOccurred(object sender, System.Net.WebSockets.WebSocketCloseStatus e)
        {
            ChannelSession.DisconnectionOccurred("Twitch PubSub");

            Result result;

            await this.Disconnect();

            do
            {
                await Task.Delay(2500);

                result = await this.Connect();
            }while (!result.Success);

            ChannelSession.ReconnectionOccurred("Twitch PubSub");
        }
Beispiel #13
0
        private async void BotClient_OnDisconnectOccurred(object sender, WebSocketCloseStatus closeStatus)
        {
            ChannelSession.DisconnectionOccurred("Twitch Bot Chat");

            Result result;

            await this.DisconnectBot();

            do
            {
                await Task.Delay(2500);

                result = await this.ConnectBot();
            }while (!result.Success);

            ChannelSession.ReconnectionOccurred("Twitch Bot Chat");
        }
Beispiel #14
0
        private async void Websocket_OnDisconnectOccurred(object sender, System.Net.WebSockets.WebSocketCloseStatus e)
        {
            ChannelSession.DisconnectionOccurred(MixItUp.Base.Resources.VTubeStudio);

            Result result = new Result();

            do
            {
                await this.Disconnect();

                await Task.Delay(5000);

                result = await this.InitializeInternal();
            }while (!result.Success);

            ChannelSession.ReconnectionOccurred(MixItUp.Base.Resources.VTubeStudio);
        }
 private void OverlayServer_OnWebSocketConnectedOccurred(object sender, EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("Overlay");
 }
 private void PubSub_OnReconnectReceived(object sender, System.EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("Twitch PubSub");
 }
Beispiel #17
0
 private void XSplitService_OnConnectedOccurred(object sender, EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("XSplit");
     this.Connected(sender, e);
 }
 private void GameWisp_OnWebSocketConnectedOccurred(object sender, EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("GameWisp");
 }
 private void StreamlabsOBSService_Connected(object sender, EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("Streamlabs OBS");
 }
 private void XSplitServer_Connected(object sender, EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("XSplit");
 }
 private void OBSWebsocket_Connected(object sender, EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("OBS");
 }
 public void WebSocketConnectedOccurred()
 {
     ChannelSession.ReconnectionOccurred("TreatStream");
     this.OnWebSocketConnectedOccurred(this, new EventArgs());
 }
 private void TipeeeStream_OnWebSocketConnectedOccurred(object sender, EventArgs e)
 {
     ChannelSession.ReconnectionOccurred("Tipeee Stream");
 }