<commit_before>/*
 * Copyright (c) 2013-2015, SteamDB. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
using System;
using System.Text;
using Meebey.SmartIrc4net;

namespace SteamDatabaseBackend
{
    class IRC
    {
        private static IRC _instance = new IRC();
        public static IRC Instance { get { return _instance; } }

        private IrcClient Client;

        public void Init()
        {
            Client = new IrcClient();

            Client.OnConnected += OnConnected;
            Client.OnDisconnected += OnDisconnected;

            Client.Encoding = Encoding.UTF8;
            Client.SendDelay = (int)Settings.Current.IRC.SendDelay;
            Client.AutoRetry = true;
            Client.AutoRetryDelay = 15;
            Client.AutoRetryLimit = 0;
            Client.AutoRejoin = true;
            Client.AutoRelogin = true;
            Client.AutoReconnect = true;
            Client.AutoRejoinOnKick = true;
            Client.ActiveChannelSyncing = true;

            try
            {
                Client.Connect(Settings.Current.IRC.Servers, Settings.Current.IRC.Port);
                Client.Login(Settings.Current.IRC.Nickname, Settings.Current.BaseURL.AbsoluteUri, 4, Settings.Current.IRC.Nickname, Settings.Current.IRC.Password);
                Client.RfcJoin(new string[] { Settings.Current.IRC.Channel.Main, Settings.Current.IRC.Channel.Announce });<commit_msg>Another race condition fix with IRC<commit_after>/*
 * Copyright (c) 2013-2015, SteamDB. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
using System;
using System.Text;
using Meebey.SmartIrc4net;

namespace SteamDatabaseBackend
{
    class IRC
    {
        private static IRC _instance = new IRC();
        public static IRC Instance { get { return _instance; } }

        private readonly IrcClient Client;

        public IRC()
        {
            Client = new IrcClient();

            Client.OnConnected += OnConnected;
            Client.OnDisconnected += OnDisconnected;

            Client.Encoding = Encoding.UTF8;
            Client.SendDelay = (int)Settings.Current.IRC.SendDelay;
            Client.AutoRetry = true;
            Client.AutoRetryDelay = 15;
            Client.AutoRetryLimit = 0;
            Client.AutoRejoin = true;
            Client.AutoRelogin = true;
            Client.AutoReconnect = true;
            Client.AutoRejoinOnKick = true;
            Client.ActiveChannelSyncing = true;
        }

        public void Init()
        {
            try
            {
                Client.Connect(Settings.Current.IRC.Servers, Settings.Current.IRC.Port);
                Client.Login(Settings.Current.IRC.Nickname, Settings.Current.BaseURL.AbsoluteUri, 4, Settings.Current.IRC.Nickname, Settings.Current.IRC.Password);
                Client.RfcJoin(new string[] { Settings.Current.IRC.Channel.Main, Settings.Current.IRC.Channel.Announce });
{'fraction_non_alphanumeric': 0.0901909150757077, 'fraction_numerical': 0.009216589861751152, 'mean_word_length': 2.1689259645464025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6215792', 'n_tokens_mistral': 865, 'n_tokens_neox': 819, 'n_words': 198}