Beispiel #1
0
        /// <summary>
        /// Channel join queue thread loop.
        /// </summary>
        protected void __RunChannelJoinQueue()
        {
            try
            {
                while (KeepThreadsAlive)
                {
                    try
                    {
                        if (Status == ClientStatus.Started && channelJoinQueue.Count > 0)
                        {
                            lock (channelJoinQueue)
                            {
                                string nextToJoin = channelJoinQueue.Dequeue();

                                if (nextToJoin != null)
                                {
                                    if (!channelList.Contains(nextToJoin))
                                    {
                                        TmiLog.Error($"Skipping channel join, no longer on list: {nextToJoin}");
                                    }
                                    else
                                    {
                                        TmiLog.Error($"Joining channel: #{nextToJoin}");
                                        client.Channels.Join($"#{nextToJoin}");
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        TmiLog.Error($"Exception in channel join queue: {ex}");
                    }
                    finally
                    {
                        Thread.Sleep(100);
                    }
                }
            }
            catch (ThreadAbortException) { }
            catch (ThreadInterruptedException) { }

            TmiLog.Log("Channel join queue thread exited.");
        }
Beispiel #2
0
 /// <summary>
 /// IRC event: connection was closed, by any means.
 /// May also indicate failed authentication or general timeout.
 /// </summary>
 private void Client_Disconnected(object sender, EventArgs e)
 {
     TmiLog.Error("Disconnected from Twitch IRC.");
     Stop();
 }
Beispiel #3
0
 /// <summary>
 /// IRC event: the server sent us an error message.
 /// </summary>
 private void Client_ErrorMessageReceived(object sender, IrcErrorMessageEventArgs e)
 {
     TmiLog.Error("Error message received: " + e.Message);
 }
Beispiel #4
0
 /// <summary>
 /// IRC event: the IRC client library has encountered an error.
 /// </summary>
 private void Client_Error(object sender, IrcErrorEventArgs e)
 {
     TmiLog.Error("Error in client: " + e.Error.Message);
 }
Beispiel #5
0
 /// <summary>
 /// IRC event: a protocol error message was received by us, e.g. because we sent an invalid command.
 /// </summary>
 private void Client_ProtocolError(object sender, IrcProtocolErrorEventArgs e)
 {
     TmiLog.Error($"Error in IRC protocol: {e.Message}");
 }
Beispiel #6
0
 /// <summary>
 /// IRC event: failed to establish a connection to the server (pre auth).
 /// </summary>
 private void Client_ConnectFailed(object sender, IrcErrorEventArgs e)
 {
     TmiLog.Error($"Connection to Twitch IRC failed: {e.Error}");
     Stop();
 }