Provides data for the IrcClient.ProtocolError event.
Inheritance: System.EventArgs
Esempio n. 1
0
 private static void ClientOnProtocolError(object sender, IrcProtocolErrorEventArgs ircProtocolErrorEventArgs)
 {
     if (ircProtocolErrorEventArgs.Code == 433)
     {
         
     }
 }
Esempio n. 2
0
 /// <summary>
 /// </summary>
 /// <param name="sender">
 /// </param>
 /// <param name="e">
 /// </param>
 public virtual void IrcClient_ProtocolError(object sender, IrcProtocolErrorEventArgs e)
 {
 }
Esempio n. 3
0
        /// <summary>
        /// </summary>
        /// <param name="sender">
        /// </param>
        /// <param name="e">
        /// </param>
        public override void IrcClient_ProtocolError(object sender, IrcProtocolErrorEventArgs e)
        {
            // on Protocol Error 433 (Nickname in Use) change to an alternate one
            if (e.Code == 433)
            {
                IrcClient client = (IrcClient)sender;
                string actualName = client.LocalUser.NickName;
                int temp = -1;
                if (actualName.Replace(Config.Instance.CurrentConfig.RelayBotNick, string.Empty) != string.Empty)
                {
                    int.TryParse(actualName.Replace(Config.Instance.CurrentConfig.RelayBotNick, string.Empty), out temp);
                    temp++;
                }
                else
                {
                    temp = 1;
                }

                actualName = Config.Instance.CurrentConfig.RelayBotNick + temp;
                client.LocalUser.SetNickName(actualName);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Raises the <see cref="ProtocolError"/> event.
 /// </summary>
 /// <param name="e">The <see cref="IrcProtocolErrorEventArgs"/> instance containing the event data.</param>
 protected virtual void OnProtocolError(IrcProtocolErrorEventArgs e)
 {
     var handler = this.ProtocolError;
     if (handler != null)
         handler(this, e);
 }
Esempio n. 5
0
        private static void ClientOnProtocolError(object sender, IrcProtocolErrorEventArgs ircProtocolErrorEventArgs)
        {
            Log("Error: " + ircProtocolErrorEventArgs.Message, ConsoleColor.Magenta);
            if (ircProtocolErrorEventArgs.Code == 433)
            {

            }
        }
Esempio n. 6
0
 void ircConnection_ProtocolError(object sender, IrcProtocolErrorEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.Red;
     Console.WriteLine(e.Message);
     Console.ForegroundColor = ConsoleColor.Gray;
     LogWrite(String.Format("IRC Protocol Error: {0}", e.Message));
 }
Esempio n. 7
0
 private void Client_ProtocolError(object sender, IrcProtocolErrorEventArgs e)
 {
     connection.AddHistory(HtmlWriter.WriteError(e.Message));
 }