Example #1
0
 public IrcClient(IPEndPoint endPoint, string nickname, IPluginLogger logger, IPlugin plugin)
 {
     EndPoint = endPoint;
     _logger = logger;
     _plugin = plugin;
     Nickname = nickname.Replace(' ', '_');
     Start();
 }
Example #2
0
        /// <summary>
        /// Called after all default plugins are loaded, at which point it is safe to assume that any dependencies are loaded.
        /// </summary>
        public void Initialize()
        {
            _logger = Server.GetPluginLogger();
            _logger.Log(LogLevel.Info, Name, "Initialize ircplugin Version {0}.", Version);

            _logger.Log(LogLevel.Debug, Name, "Checking folder {0}", ConfigurationDirectory);
            if (!Directory.Exists(ConfigurationDirectory)) { Directory.CreateDirectory(ConfigurationDirectory); }

            _logger.Log(LogLevel.Debug, Name, "Checking configfile {0}", ConfigurationFilename);
            if (!File.Exists(ConfigurationFilename))
            {
                GenerateNewConfigurationFile();
            }

            LoadConfigurationFile();

            _serverListener = new IrcPluginServerListener(this);
        }