Ejemplo n.º 1
0
 // Will be called if failed connecting (mostly due to Discord being closed)
 private void ClientOnConnFailed(object sender, DiscordRPC.Message.ConnectionFailedMessage args)
 {
     connectionState = 2;
     Invoke(new MethodInvoker(() => {
         textBoxID.BackColor             = System.Drawing.Color.FromArgb(255, 192, 192);
         toolStripStatusLabelStatus.Text = Strings.statusConnectionFailed;
     }));
 }
Ejemplo n.º 2
0
 private static void Client_OnConnectionFailed(object sender, DiscordRPC.Message.ConnectionFailedMessage args)
 {
     if (!Failed)
     {
         Failed = true;
         Log.Error("RPC", $"Discord client invalid, {args.Type}");
         MainWindow.SetLiveView(ViewType.Error, "Attempting to reconnect");
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Called on unsuccessful connection to Discord.
        /// </summary>
        private void ConnectionFailed(object sender, DiscordRPC.Message.ConnectionFailedMessage args)
        {
            try
            {
                Invoke(new MethodInvoker(() =>
                {
                    pictureBoxAvatar.ImageLocation = "https://cdn.discordapp.com/embed/avatars/4.png";
                    labelUsername.Text             = "Can't connect.";
                }));
            }
            catch
            {
                // Form has been closed, just do nothing
            }

            client.Dispose();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Will be called if failed connecting (mostly due to Discord being closed).
        /// </summary>
        private void ClientOnConnFailed(object sender, DiscordRPC.Message.ConnectionFailedMessage args)
        {
            ConnectionManager.State = ConnectionType.Error;

            Invoke(new MethodInvoker(() =>
            {
                if (buttonConnect.Enabled) // Ignore if the user disconnected before connection was established
                {
                    return;
                }

                textBoxID.BackColor             = CurrentColors.BgTextFieldsError;
                toolStripStatusLabelStatus.Text = Strings.statusConnectionFailed;
            }));

            if (ConnectionManager.HasChanged()) // Ignore repeated calls caused by auto reconnect
            {
                Analytics.TrackEvent("Connection failed");
            }

            restartTimer.Start();
        }
Ejemplo n.º 5
0
 private void Client_OnConnectionFailed(object sender, DiscordRPC.Message.ConnectionFailedMessage args)
 {
     SetStateText($"Failed to connect to pipe {args.FailedPipe}. Is Discord open?");
 }